Skip to content

Commit

Permalink
limit to beta only
Browse files Browse the repository at this point in the history
  • Loading branch information
spapi17 committed Dec 13, 2023
1 parent 3f64df9 commit 230b521
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,15 @@ func ResourceComposerEnvironment() *schema.Resource {
},
},
},
<% unless version == "ga" -%>
"composer_internal_ipv4_cidr_block": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
Description: `IPv4 cidr range that will be used by Composer internal components.`,
},
<% end -%>
},
},
},
Expand Down Expand Up @@ -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}
}

Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1149,6 +1150,7 @@ func TestAccComposerEnvironmentComposer3_basic(t *testing.T) {
},
})
}
<% end -%>

func testAccComposerEnvironment_customBucket(bucketName, envName, network, subnetwork string) string {
return fmt.Sprintf(`
Expand Down Expand Up @@ -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" {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 230b521

Please sign in to comment.