Skip to content

Commit

Permalink
Promote google_compute_service_attachment to GA (#5031) (#3566)
Browse files Browse the repository at this point in the history
Co-authored-by: upodroid <cy@borg.dev>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: upodroid <cy@borg.dev>
  • Loading branch information
modular-magician and upodroid authored Aug 25, 2021
1 parent 5179ee6 commit 24fe588
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 78 deletions.
6 changes: 6 additions & 0 deletions .changelog/5031.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:enhancement
compute: promoted `google_compute_service_attachment` to ga
```
```release-note:enhancement
compute: promoted `role` and `purpose` fields in `google_compute_subnetwork` to ga
```
52 changes: 14 additions & 38 deletions google-beta/resource_compute_service_attachment_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,25 @@ func TestAccComputeServiceAttachment_serviceAttachmentBasicExample(t *testing.T)

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeServiceAttachmentDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeServiceAttachment_serviceAttachmentBasicExample(context),
},
{
ResourceName: "google_compute_service_attachment.psc_ilb_service_attachment",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"target_service", "region"},
},
},
})
}

func testAccComputeServiceAttachment_serviceAttachmentBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
provider = "google-beta"
name = "tf-test-my-psc-ilb%{random_suffix}"
region = "us-west2"
description = "A service attachment configured with Terraform"
Expand All @@ -58,8 +62,6 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
}
resource "google_compute_address" "psc_ilb_consumer_address" {
provider = "google-beta"
name = "tf-test-psc-ilb-consumer-address%{random_suffix}"
region = "us-west2"
Expand All @@ -69,8 +71,6 @@ resource "google_compute_address" "psc_ilb_consumer_address" {
}
resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
provider = "google-beta"
name = "tf-test-psc-ilb-consumer-forwarding-rule%{random_suffix}"
region = "us-west2"
Expand All @@ -81,8 +81,6 @@ resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
}
resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
provider = "google-beta"
name = "tf-test-producer-forwarding-rule%{random_suffix}"
region = "us-west2"
Expand All @@ -94,17 +92,13 @@ resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
}
resource "google_compute_region_backend_service" "producer_service_backend" {
provider = "google-beta"
name = "tf-test-producer-service%{random_suffix}"
region = "us-west2"
health_checks = [google_compute_health_check.producer_service_health_check.id]
}
resource "google_compute_health_check" "producer_service_health_check" {
provider = "google-beta"
name = "tf-test-producer-service-health-check%{random_suffix}"
check_interval_sec = 1
Expand All @@ -115,15 +109,11 @@ resource "google_compute_health_check" "producer_service_health_check" {
}
resource "google_compute_network" "psc_ilb_network" {
provider = "google-beta"
name = "tf-test-psc-ilb-network%{random_suffix}"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
provider = "google-beta"
name = "tf-test-psc-ilb-producer-subnetwork%{random_suffix}"
region = "us-west2"
Expand All @@ -132,8 +122,6 @@ resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
}
resource "google_compute_subnetwork" "psc_ilb_nat" {
provider = "google-beta"
name = "tf-test-psc-ilb-nat%{random_suffix}"
region = "us-west2"
Expand All @@ -153,21 +141,25 @@ func TestAccComputeServiceAttachment_serviceAttachmentExplicitProjectsExample(t

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeServiceAttachmentDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccComputeServiceAttachment_serviceAttachmentExplicitProjectsExample(context),
},
{
ResourceName: "google_compute_service_attachment.psc_ilb_service_attachment",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"target_service", "region"},
},
},
})
}

func testAccComputeServiceAttachment_serviceAttachmentExplicitProjectsExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
provider = "google-beta"
name = "tf-test-my-psc-ilb%{random_suffix}"
region = "us-west2"
description = "A service attachment configured with Terraform"
Expand All @@ -186,8 +178,6 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
}
resource "google_compute_address" "psc_ilb_consumer_address" {
provider = "google-beta"
name = "tf-test-psc-ilb-consumer-address%{random_suffix}"
region = "us-west2"
Expand All @@ -197,8 +187,6 @@ resource "google_compute_address" "psc_ilb_consumer_address" {
}
resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
provider = "google-beta"
name = "tf-test-psc-ilb-consumer-forwarding-rule%{random_suffix}"
region = "us-west2"
Expand All @@ -209,8 +197,6 @@ resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
}
resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
provider = "google-beta"
name = "tf-test-producer-forwarding-rule%{random_suffix}"
region = "us-west2"
Expand All @@ -222,17 +208,13 @@ resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
}
resource "google_compute_region_backend_service" "producer_service_backend" {
provider = "google-beta"
name = "tf-test-producer-service%{random_suffix}"
region = "us-west2"
health_checks = [google_compute_health_check.producer_service_health_check.id]
}
resource "google_compute_health_check" "producer_service_health_check" {
provider = "google-beta"
name = "tf-test-producer-service-health-check%{random_suffix}"
check_interval_sec = 1
Expand All @@ -243,15 +225,11 @@ resource "google_compute_health_check" "producer_service_health_check" {
}
resource "google_compute_network" "psc_ilb_network" {
provider = "google-beta"
name = "tf-test-psc-ilb-network%{random_suffix}"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
provider = "google-beta"
name = "tf-test-psc-ilb-producer-subnetwork%{random_suffix}"
region = "us-west2"
Expand All @@ -260,8 +238,6 @@ resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
}
resource "google_compute_subnetwork" "psc_ilb_nat" {
provider = "google-beta"
name = "tf-test-psc-ilb-nat%{random_suffix}"
region = "us-west2"
Expand Down
38 changes: 0 additions & 38 deletions website/docs/r/compute_service_attachment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ description: |-

Represents a ServiceAttachment resource.

~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.

To get more information about ServiceAttachment, see:

Expand All @@ -43,8 +41,6 @@ To get more information about ServiceAttachment, see:

```hcl
resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
provider = "google-beta"
name = "my-psc-ilb"
region = "us-west2"
description = "A service attachment configured with Terraform"
Expand All @@ -56,8 +52,6 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
}
resource "google_compute_address" "psc_ilb_consumer_address" {
provider = "google-beta"
name = "psc-ilb-consumer-address"
region = "us-west2"
Expand All @@ -67,8 +61,6 @@ resource "google_compute_address" "psc_ilb_consumer_address" {
}
resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
provider = "google-beta"
name = "psc-ilb-consumer-forwarding-rule"
region = "us-west2"
Expand All @@ -79,8 +71,6 @@ resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
}
resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
provider = "google-beta"
name = "producer-forwarding-rule"
region = "us-west2"
Expand All @@ -92,17 +82,13 @@ resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
}
resource "google_compute_region_backend_service" "producer_service_backend" {
provider = "google-beta"
name = "producer-service"
region = "us-west2"
health_checks = [google_compute_health_check.producer_service_health_check.id]
}
resource "google_compute_health_check" "producer_service_health_check" {
provider = "google-beta"
name = "producer-service-health-check"
check_interval_sec = 1
Expand All @@ -113,15 +99,11 @@ resource "google_compute_health_check" "producer_service_health_check" {
}
resource "google_compute_network" "psc_ilb_network" {
provider = "google-beta"
name = "psc-ilb-network"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
provider = "google-beta"
name = "psc-ilb-producer-subnetwork"
region = "us-west2"
Expand All @@ -130,8 +112,6 @@ resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
}
resource "google_compute_subnetwork" "psc_ilb_nat" {
provider = "google-beta"
name = "psc-ilb-nat"
region = "us-west2"
Expand All @@ -150,8 +130,6 @@ resource "google_compute_subnetwork" "psc_ilb_nat" {

```hcl
resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
provider = "google-beta"
name = "my-psc-ilb"
region = "us-west2"
description = "A service attachment configured with Terraform"
Expand All @@ -170,8 +148,6 @@ resource "google_compute_service_attachment" "psc_ilb_service_attachment" {
}
resource "google_compute_address" "psc_ilb_consumer_address" {
provider = "google-beta"
name = "psc-ilb-consumer-address"
region = "us-west2"
Expand All @@ -181,8 +157,6 @@ resource "google_compute_address" "psc_ilb_consumer_address" {
}
resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
provider = "google-beta"
name = "psc-ilb-consumer-forwarding-rule"
region = "us-west2"
Expand All @@ -193,8 +167,6 @@ resource "google_compute_forwarding_rule" "psc_ilb_consumer" {
}
resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
provider = "google-beta"
name = "producer-forwarding-rule"
region = "us-west2"
Expand All @@ -206,17 +178,13 @@ resource "google_compute_forwarding_rule" "psc_ilb_target_service" {
}
resource "google_compute_region_backend_service" "producer_service_backend" {
provider = "google-beta"
name = "producer-service"
region = "us-west2"
health_checks = [google_compute_health_check.producer_service_health_check.id]
}
resource "google_compute_health_check" "producer_service_health_check" {
provider = "google-beta"
name = "producer-service-health-check"
check_interval_sec = 1
Expand All @@ -227,15 +195,11 @@ resource "google_compute_health_check" "producer_service_health_check" {
}
resource "google_compute_network" "psc_ilb_network" {
provider = "google-beta"
name = "psc-ilb-network"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
provider = "google-beta"
name = "psc-ilb-producer-subnetwork"
region = "us-west2"
Expand All @@ -244,8 +208,6 @@ resource "google_compute_subnetwork" "psc_ilb_producer_subnetwork" {
}
resource "google_compute_subnetwork" "psc_ilb_nat" {
provider = "google-beta"
name = "psc-ilb-nat"
region = "us-west2"
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/compute_subnetwork.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ The following arguments are supported:
creation time.

* `purpose` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
(Optional)
The purpose of the resource. This field can be either PRIVATE
or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to
INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is
Expand All @@ -181,7 +181,7 @@ The following arguments are supported:
If set to INTERNAL_HTTPS_LOAD_BALANCER you must also set `role`.

* `role` -
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
(Optional)
The role of subnetwork. Currently, this field is only used when
purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE
or BACKUP. An ACTIVE subnetwork is one that is currently being used
Expand Down

0 comments on commit 24fe588

Please sign in to comment.