MembershipBinding is a subresource of a Membership, representing what Fleet Scopes (or other, future Fleet resources) a Membership is bound to.
To get more information about MembershipBinding, see:
resource "google_container_cluster" "primary" {
name = "basic-cluster"
location = "us-central1-a"
initial_node_count = 1
deletion_protection = "true"
network = "default"
subnetwork = "default"
}
resource "google_gke_hub_membership" "membership" {
membership_id = "tf-test-membership%{random_suffix}"
endpoint {
gke_cluster {
resource_link = "//container.googleapis.com/${google_container_cluster.primary.id}"
}
}
depends_on = [google_container_cluster.primary]
}
resource "google_gke_hub_scope" "scope" {
scope_id = "tf-test-scope%{random_suffix}"
}
resource "google_gke_hub_membership_binding" "membership_binding" {
membership_binding_id = "tf-test-membership-binding%{random_suffix}"
scope = google_gke_hub_scope.scope.name
membership_id = google_gke_hub_membership.membership.membership_id
location = "global"
labels = {
keyb = "valueb"
keya = "valuea"
keyc = "valuec"
}
depends_on = [
google_gke_hub_membership.membership,
google_gke_hub_scope.scope
]
}
The following arguments are supported:
membership_binding_id
-
(Required)
The client-provided identifier of the membership binding.
scope
-
(Required)
A Workspace resource name in the format
projects/*/locations/*/scopes/*
.
membership_id
-
(Required)
Id of the membership
location
-
(Required)
Location of the membership
labels
-
(Optional)
Labels for this Membership binding.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}/bindings/{{membership_binding_id}}
name
-
The resource name for the membershipbinding itself
uid
-
Google-generated UUID for this resource.
create_time
-
Time the MembershipBinding was created in UTC.
update_time
-
Time the MembershipBinding was updated in UTC.
delete_time
-
Time the MembershipBinding was deleted in UTC.
state
-
State of the membership binding resource.
Structure is documented below.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
code
-
(Output)
Code describes the state of a MembershipBinding resource.This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.MembershipBinding can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}/bindings/{{membership_binding_id}}
{{project}}/{{location}}/{{membership_id}}/{{membership_binding_id}}
{{location}}/{{membership_id}}/{{membership_binding_id}}
In Terraform v1.5.0 and later, use an import
block to import MembershipBinding using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}/bindings/{{membership_binding_id}}"
to = google_gke_hub_membership_binding.default
}
When using the terraform import
command, MembershipBinding can be imported using one of the formats above. For example:
$ terraform import google_gke_hub_membership_binding.default projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}/bindings/{{membership_binding_id}}
$ terraform import google_gke_hub_membership_binding.default {{project}}/{{location}}/{{membership_id}}/{{membership_binding_id}}
$ terraform import google_gke_hub_membership_binding.default {{location}}/{{membership_id}}/{{membership_binding_id}}
This resource supports User Project Overrides.