Skip to content

Commit afe6b49

Browse files
Add Enterprise to security_posture_config.mode (#10852) (#18334)
[upstream:6888073642618b5c67a2d8045e7477a0304d5e3f] Signed-off-by: Modular Magician <[email protected]>
1 parent bb88b83 commit afe6b49

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

google/services/container/resource_container_cluster.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,8 @@ func ResourceContainerCluster() *schema.Resource {
10211021
Type: schema.TypeString,
10221022
Optional: true,
10231023
Computed: true,
1024-
ValidateFunc: validation.StringInSlice([]string{"DISABLED", "BASIC", "MODE_UNSPECIFIED"}, false),
1025-
Description: `Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED and BASIC.`,
1024+
ValidateFunc: validation.StringInSlice([]string{"DISABLED", "BASIC", "ENTERPRISE", "MODE_UNSPECIFIED"}, false),
1025+
Description: `Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED, BASIC, and ENTERPRISE.`,
10261026
DiffSuppressFunc: tpgresource.EmptyOrDefaultStringSuppress("MODE_UNSPECIFIED"),
10271027
},
10281028
"vulnerability_mode": {

google/services/container/resource_container_cluster_migratev1.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ func resourceContainerClusterResourceV1() *schema.Resource {
794794
Type: schema.TypeString,
795795
Optional: true,
796796
Computed: true,
797-
ValidateFunc: validation.StringInSlice([]string{"DISABLED", "BASIC", "MODE_UNSPECIFIED"}, false),
798-
Description: `Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED and BASIC.`,
797+
ValidateFunc: validation.StringInSlice([]string{"DISABLED", "BASIC", "ENTERPRISE", "MODE_UNSPECIFIED"}, false),
798+
Description: `Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include DISABLED, BASIC, and ENTERPRISE.`,
799799
DiffSuppressFunc: tpgresource.EmptyOrDefaultStringSuppress("MODE_UNSPECIFIED"),
800800
},
801801
"vulnerability_mode": {

google/services/container/resource_container_cluster_test.go

+25
Original file line numberDiff line numberDiff line change
@@ -3922,6 +3922,15 @@ func TestAccContainerCluster_withSecurityPostureConfig(t *testing.T) {
39223922
ImportStateVerify: true,
39233923
ImportStateVerifyIgnore: []string{"deletion_protection"},
39243924
},
3925+
{
3926+
Config: testAccContainerCluster_SetSecurityPostureToEnterprise(clusterName, networkName, subnetworkName),
3927+
},
3928+
{
3929+
ResourceName: "google_container_cluster.with_security_posture_config",
3930+
ImportState: true,
3931+
ImportStateVerify: true,
3932+
ImportStateVerifyIgnore: []string{"deletion_protection"},
3933+
},
39253934
{
39263935
Config: testAccContainerCluster_SetWorkloadVulnerabilityToStandard(clusterName, networkName, subnetworkName),
39273936
},
@@ -4053,6 +4062,22 @@ resource "google_container_cluster" "with_security_posture_config" {
40534062
`, resource_name, networkName, subnetworkName)
40544063
}
40554064

4065+
func testAccContainerCluster_SetSecurityPostureToEnterprise(resource_name, networkName, subnetworkName string) string {
4066+
return fmt.Sprintf(`
4067+
resource "google_container_cluster" "with_security_posture_config" {
4068+
name = "%s"
4069+
location = "us-central1-a"
4070+
initial_node_count = 1
4071+
security_posture_config {
4072+
mode = "ENTERPRISE"
4073+
}
4074+
deletion_protection = false
4075+
network = "%s"
4076+
subnetwork = "%s"
4077+
}
4078+
`, resource_name, networkName, subnetworkName)
4079+
}
4080+
40564081
func testAccContainerCluster_SetWorkloadVulnerabilityToStandard(resource_name, networkName, subnetworkName string) string {
40574082
return fmt.Sprintf(`
40584083
resource "google_container_cluster" "with_security_posture_config" {

website/docs/r/container_cluster.html.markdown

+3-1
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,9 @@ linux_node_config {
13351335

13361336
<a name="nested_security_posture_config"></a>The `security_posture_config` block supports:
13371337

1338-
* `mode` - (Optional) Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include `DISABLED` and `BASIC`.
1338+
**Note:** `ENTERPRISE` and `VULNERABILITY_ENTERPRISE` are only available for [GKE Enterprise](http://cloud/kubernetes-engine/enterprise/docs/concepts/overview) projects.
1339+
1340+
* `mode` - (Optional) Sets the mode of the Kubernetes security posture API's off-cluster features. Available options include `DISABLED`, `BASIC`, and `ENTERPRISE`.
13391341

13401342

13411343
* `vulnerability_mode` - (Optional) Sets the mode of the Kubernetes security posture API's workload vulnerability scanning. Available options include `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC` and `VULNERABILITY_ENTERPRISE`.

0 commit comments

Comments
 (0)