Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,12 @@ func ResourceContainerCluster() *schema.Resource {
Computed: true,
Description: `Location of the fleet membership, for example "us-central1".`,
},
"membership_type": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"LIGHTWEIGHT"}, false),
Description: `The type of the cluster's fleet membership.`,
},
},
},
},
Expand Down Expand Up @@ -6570,6 +6576,7 @@ func expandFleet(configured interface{}) *container.Fleet {
config := l[0].(map[string]interface{})
return &container.Fleet{
Project: config["project"].(string),
MembershipType: config["membership_type"].(string),
}
}

Expand Down Expand Up @@ -7680,6 +7687,7 @@ func flattenFleet(c *container.Fleet) []map[string]interface{} {
"membership_id": membership_id,
"membership_location": membership_location,
"pre_registered": c.PreRegistered,
"membership_type": c.MembershipType,
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5863,6 +5863,15 @@ func TestAccContainerCluster_withFleetConfig(t *testing.T) {
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"deletion_protection"},
},
{
Config: testAccContainerCluster_withFleetConfigLightweightMembership(clusterName, projectID, networkName, subnetworkName),
},
{
ResourceName: "google_container_cluster.primary",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"deletion_protection"},
},
},
})
}
Expand Down Expand Up @@ -5989,6 +5998,26 @@ resource "google_container_cluster" "primary" {
`, resource_name, networkName, subnetworkName)
}

func testAccContainerCluster_withFleetConfigLightweightMembership(name, projectID, networkName, subnetworkName string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "primary" {
name = "%s"
location = "us-central1-a"
initial_node_count = 1

fleet {
project = "%s"
membership_type = "LIGHTWEIGHT"
}

network = "%s"
subnetwork = "%s"

deletion_protection = false
}
`, name, projectID, networkName, subnetworkName)
}

func testAccContainerCluster_withIncompatibleMasterVersionNodeVersion(name, networkName, subnetworkName string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "gke_cluster" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,8 @@ linux_node_config {

* `project` - (Optional) The name of the Fleet host project where this cluster will be registered.

* `membership_type` - (Optional) Sets the membership type of the cluster. Available option is `LIGHTWEIGHT` to support only lightweight compatible features. If unspecified, the membership_type will be a regular membership that supports all features.

<a name="nested_workload_alts_config"></a>The `workload_alts_config` block supports:

* `enable_alts` - (Required) Whether the alts handshaker should be enabled or not for direct-path. Requires Workload Identity ([workloadPool]((#nested_workload_identity_config)) must be non-empty).
Expand Down
Loading