From 230b521ed8398c7fa95f90e21f5618adfcf906ce Mon Sep 17 00:00:00 2001 From: Salome Papiashvili Date: Wed, 13 Dec 2023 17:01:27 +0100 Subject: [PATCH] limit to beta only --- .../services/composer/resource_composer_environment.go.erb | 6 ++++++ .../composer/resource_composer_environment_test.go.erb | 4 ++++ .../website/docs/r/composer_environment.html.markdown | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb b/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb index 4bb97e001f7d..437bb9d4806b 100644 --- a/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb +++ b/mmv1/third_party/terraform/services/composer/resource_composer_environment.go.erb @@ -348,6 +348,7 @@ func ResourceComposerEnvironment() *schema.Resource { }, }, }, +<% unless version == "ga" -%> "composer_internal_ipv4_cidr_block": { Type: schema.TypeString, Computed: true, @@ -355,6 +356,7 @@ func ResourceComposerEnvironment() *schema.Resource { ForceNew: true, Description: `IPv4 cidr range that will be used by Composer internal components.`, }, +<% end -%> }, }, }, @@ -1624,7 +1626,9 @@ func flattenComposerEnvironmentConfigNodeConfig(nodeCfg *composer.NodeConfig) in transformed["enable_ip_masq_agent"] = nodeCfg.EnableIpMasqAgent transformed["tags"] = flattenComposerEnvironmentConfigNodeConfigTags(nodeCfg.Tags) transformed["ip_allocation_policy"] = flattenComposerEnvironmentConfigNodeConfigIPAllocationPolicy(nodeCfg.IpAllocationPolicy) +<% unless version == "ga" -%> transformed["composer_internal_ipv4_cidr_block"] = nodeCfg.ComposerInternalIpv4CidrBlock +<% end -%> return []interface{}{transformed} } @@ -2167,9 +2171,11 @@ func expandComposerEnvironmentConfigNodeConfig(v interface{}, d *schema.Resource } transformed.Tags = transformedTags +<% unless version == "ga" -%> if transformedComposerInternalIpv4CidrBlock, ok := original["composer_internal_ipv4_cidr_block"]; ok { transformed.ComposerInternalIpv4CidrBlock = transformedComposerInternalIpv4CidrBlock.(string) } +<% end -%> return transformed, nil } diff --git a/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb b/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb index 2948624392ed..46eb7a6d269c 100644 --- a/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb +++ b/mmv1/third_party/terraform/services/composer/resource_composer_environment_test.go.erb @@ -1116,6 +1116,7 @@ func TestAccComposerEnvironment_customBucket(t *testing.T) { }) } +<% unless version == "ga" -%> // Checks Composer 3 environment creation with new fields. func TestAccComposerEnvironmentComposer3_basic(t *testing.T) { t.Parallel() @@ -1149,6 +1150,7 @@ func TestAccComposerEnvironmentComposer3_basic(t *testing.T) { }, }) } +<% end -%> func testAccComposerEnvironment_customBucket(bucketName, envName, network, subnetwork string) string { return fmt.Sprintf(` @@ -2711,6 +2713,7 @@ resource "google_project_iam_member" "composer-worker" { `, environment, network, subnetwork, serviceAccount) } +<% unless version == "ga" -%> func testAccComposerEnvironmentComposer3_basic(name, network, subnetwork string) string { return fmt.Sprintf(` resource "google_composer_environment" "test" { @@ -2741,6 +2744,7 @@ resource "google_compute_subnetwork" "test" { } `, name, network, subnetwork) } +<% end -%> // WARNING: This is not actually a check and is a terrible clean-up step because Composer Environments // have a bug that hasn't been fixed. Composer will add firewalls to non-default networks for environments diff --git a/mmv1/third_party/terraform/website/docs/r/composer_environment.html.markdown b/mmv1/third_party/terraform/website/docs/r/composer_environment.html.markdown index b3b0d1014248..e31ba2a158cd 100644 --- a/mmv1/third_party/terraform/website/docs/r/composer_environment.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/composer_environment.html.markdown @@ -770,7 +770,7 @@ The `node_config` block supports: See the [documentation](https://cloud.google.com/composer/docs/enable-ip-masquerade-agent). * `composer_internal_ipv4_cidr_block` - - (Optional, Cloud Composer 3 only) + (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html), Cloud Composer 3 only) At least /20 IPv4 cidr range that will be used by Composer internal components. Cannot be updated.