Skip to content

Commit

Permalink
GA compute address labels (#9159)
Browse files Browse the repository at this point in the history
[upstream:f420f56f39ac9bbfe2813fe0cc06499e2144e949]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician committed Oct 4, 2023
1 parent b0a7f6f commit 7a80ad5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .changelog/9159.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: added `labels`, `effective_labels`, `terraform_labels`, and `label_fingerprint` to `google_compute_address` (GA)
```
16 changes: 4 additions & 12 deletions google-beta/services/compute/resource_compute_address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,19 @@ func TestAccComputeAddress_networkTier_withProvider5(t *testing.T) {
acctest.SkipIfVcr(t)
t.Parallel()

oldVersion := map[string]resource.ExternalProvider{
"google": {
VersionConstraint: "4.75.0", // a version that doesn't separate user defined labels and system labels
Source: "registry.terraform.io/hashicorp/google",
},
}

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
Steps: []resource.TestStep{
{
Config: testAccComputeAddress_networkTier(acctest.RandString(t, 10)),
ExternalProviders: oldVersion,
Config: testAccComputeAddress_networkTier(acctest.RandString(t, 10)),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckNoResourceAttr("google_compute_address.foobar", "labels.%"),
resource.TestCheckNoResourceAttr("google_compute_address.foobar", "effective_labels.%"),
),
},
{
Config: testAccComputeAddress_networkTier_withLabels(acctest.RandString(t, 10)),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
Config: testAccComputeAddress_networkTier_withLabels(acctest.RandString(t, 10)),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("google_compute_address.foobar", "labels.%", "2"),
resource.TestCheckResourceAttr("google_compute_address.foobar", "labels.env", "foo"),
Expand Down
5 changes: 1 addition & 4 deletions website/docs/r/compute_address.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ The following arguments are supported:
GCE_ENDPOINT/DNS_RESOLVER purposes.

* `labels` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
(Optional)
Labels to apply to this address. A list of key->value pairs.

**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
Expand Down Expand Up @@ -275,17 +275,14 @@ In addition to the arguments listed above, the following computed attributes are
The URLs of the resources that are using this address.

* `label_fingerprint` -
([Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
The fingerprint used for optimistic locking of this resource. Used
internally during updates.

* `terraform_labels` -
([Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
The combination of labels configured directly on the resource
and default labels configured on the provider.

* `effective_labels` -
([Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
* `self_link` - The URI of the created resource.

Expand Down

0 comments on commit 7a80ad5

Please sign in to comment.