-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[terraform] Add AuthenticatorGroupsConfig to google_container_cluster (…
…#669) Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
c030c9c
commit 2cc07c6
Showing
3 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,6 +316,27 @@ func TestAccContainerCluster_withCloudRunEnabled(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccContainerCluster_withAuthenticatorGroupsConfig(t *testing.T) { | ||
t.Parallel() | ||
clusterName := fmt.Sprintf("cluster-test-%s", acctest.RandString(10)) | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckContainerClusterDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccContainerCluster_withAuthenticatorGroupsConfig(clusterName), | ||
}, | ||
{ | ||
ResourceName: "google_container_cluster.with_authenticator_groups", | ||
ImportStateIdPrefix: "us-central1-a/", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccContainerCluster_withNetworkPolicyEnabled(t *testing.T) { | ||
t.Parallel() | ||
|
||
|
@@ -2102,6 +2123,50 @@ resource "google_container_cluster" "with_cloudrun_enabled" { | |
}`, clusterName) | ||
} | ||
|
||
func testAccContainerCluster_withAuthenticatorGroupsConfig(clusterName string) string { | ||
return fmt.Sprintf(` | ||
resource "google_compute_network" "container_network" { | ||
name = "container-net-%s" | ||
auto_create_subnetworks = false | ||
} | ||
resource "google_compute_subnetwork" "container_subnetwork" { | ||
name = "${google_compute_network.container_network.name}" | ||
network = "${google_compute_network.container_network.name}" | ||
ip_cidr_range = "10.0.36.0/24" | ||
region = "us-central1" | ||
private_ip_google_access = true | ||
secondary_ip_range { | ||
range_name = "pod" | ||
ip_cidr_range = "10.0.0.0/19" | ||
} | ||
secondary_ip_range { | ||
range_name = "svc" | ||
ip_cidr_range = "10.0.32.0/22" | ||
} | ||
} | ||
resource "google_container_cluster" "with_authenticator_groups" { | ||
name = "%s" | ||
zone = "us-central1-a" | ||
initial_node_count = 1 | ||
network = "${google_compute_network.container_network.name}" | ||
subnetwork = "${google_compute_subnetwork.container_subnetwork.name}" | ||
authenticator_groups_config { | ||
security_group = "[email protected]" | ||
} | ||
ip_allocation_policy { | ||
cluster_secondary_range_name = "${google_compute_subnetwork.container_subnetwork.secondary_ip_range.0.range_name}" | ||
services_secondary_range_name = "${google_compute_subnetwork.container_subnetwork.secondary_ip_range.1.range_name}" | ||
} | ||
} | ||
`, clusterName, clusterName) | ||
} | ||
|
||
func testAccContainerCluster_withMasterAuthorizedNetworksConfig(clusterName string, cidrs []string, emptyValue string) string { | ||
|
||
cidrBlocks := emptyValue | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,6 +267,10 @@ to the datasource. A `region` can have a different set of supported versions tha | |
[PodSecurityPolicy](https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies) feature. | ||
Structure is documented below. | ||
|
||
* `authenticator_groups_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/provider_versions.html)) Configuration for the | ||
[Google Groups for GKE](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#groups-setup-gsuite) feature. | ||
Structure is documented below. | ||
|
||
* `private_cluster_config` - (Optional) A set of options for creating | ||
a private cluster. Structure is documented below. | ||
|
||
|
@@ -361,6 +365,10 @@ The `resource_limits` block supports: | |
|
||
* `maximum` - (Optional) The maximum value for the resource type specified. | ||
|
||
The `authenticator_groups_config` block supports: | ||
|
||
* `security_group` - (Required) The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format `[email protected]`. | ||
|
||
The `maintenance_policy` block supports: | ||
|
||
* `daily_maintenance_window` - (Required) Time window specified for daily maintenance operations. | ||
|