Skip to content

Commit

Permalink
Add SHARED_LOADBALANCER_VIP purpose to regional addresses. (#4169) (#…
Browse files Browse the repository at this point in the history
…2773)

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Dec 10, 2020
1 parent 8e0ccf4 commit b13a8f2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/4169.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: added SHARED_LOADBALANCER_VIP as a valid option for `google_compute_address.purpose`
```
7 changes: 5 additions & 2 deletions google-beta/resource_compute_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,16 @@ specified, it is assumed to be PREMIUM. Possible values: ["PREMIUM", "STANDARD"]
Computed: true,
Optional: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"GCE_ENDPOINT", "SHARED_LOADBALANCER_VIP", ""}, false),
ValidateFunc: validation.StringInSlice([]string{"GCE_ENDPOINT", "VPC_PEERING", "SHARED_LOADBALANCER_VIP", ""}, false),
Description: `The purpose of this resource, which can be one of the following values:
* GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources.
* SHARED_LOADBALANCER_VIP for an address that can be used by multiple internal load balancers.
This should only be set when using an Internal address. Possible values: ["GCE_ENDPOINT", "SHARED_LOADBALANCER_VIP"]`,
* VPC_PEERING for addresses that are reserved for VPC peer networks.
This should only be set when using an Internal address. Possible values: ["GCE_ENDPOINT", "VPC_PEERING", "SHARED_LOADBALANCER_VIP"]`,
},
"region": {
Type: schema.TypeString,
Expand Down
9 changes: 7 additions & 2 deletions google-beta/resource_compute_address_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestAccComputeAddress_addressWithSharedLoadbalancerVipExample(t *testing.T)

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
ExternalProviders: map[string]resource.ExternalProvider{
"random": {},
},
Expand All @@ -166,14 +166,19 @@ func TestAccComputeAddress_addressWithSharedLoadbalancerVipExample(t *testing.T)
{
Config: testAccComputeAddress_addressWithSharedLoadbalancerVipExample(context),
},
{
ResourceName: "google_compute_address.internal_with_shared_loadbalancer_vip",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"subnetwork", "region"},
},
},
})
}

func testAccComputeAddress_addressWithSharedLoadbalancerVipExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_address" "internal_with_shared_loadbalancer_vip" {
provider = google-beta
name = "tf-test-my-internal-address%{random_suffix}"
address_type = "INTERNAL"
purpose = "SHARED_LOADBALANCER_VIP"
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/compute_address.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ The following arguments are supported:
The purpose of this resource, which can be one of the following values:
* GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources.
* SHARED_LOADBALANCER_VIP for an address that can be used by multiple internal load balancers.
* VPC_PEERING for addresses that are reserved for VPC peer networks.
This should only be set when using an Internal address.
Possible values are `GCE_ENDPOINT` and `SHARED_LOADBALANCER_VIP`.
Possible values are `GCE_ENDPOINT`, `VPC_PEERING`, and `SHARED_LOADBALANCER_VIP`.

* `network_tier` -
(Optional)
Expand Down

0 comments on commit b13a8f2

Please sign in to comment.