Skip to content

Commit

Permalink
Updating the documentation for feature membership with the current st…
Browse files Browse the repository at this point in the history
…ate of the resource. Adding the membership_location field to the resource (GoogleCloudPlatform#9508)

* Adding Terraform resources for Tenancy APIs in GKEHub

* Segregating MembershipBinding and MembershipRBACRoleBinding to keep things simpler in the review

* Fixing the docu URIs

* Adding TF support for Tenancy API for Membership Binding

* Adding dependent membership binding to the same commit chain

* Making Scope un-updatable and replacing hard coded project number with the one from test env

* Making Scope RRBAC updatable

* Making Namespace immutable

* Adding update test cases

* Removing all memberships field from Scope since it is no longer supported

* Removing all_memberships field for Scope from all test cases

* Making naming in examples consistent across Tenancy APIs documentation

* Update mmv1/templates/terraform/examples/gkehub_membership_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Update mmv1/templates/terraform/examples/gkehub_membership_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Update mmv1/templates/terraform/examples/gkehub_membership_rbac_role_binding_basic.tf.erb

Co-authored-by: Shuya Ma <[email protected]>

* Fixing typo in the resource name

* Adding state migrations for Membership

* Updating the feature_membership documentation with the current resource state. Adding membership_location field to the doc

---------

Co-authored-by: Shuya Ma <[email protected]>
  • Loading branch information
2 people authored and jialei-chen committed Nov 29, 2023
1 parent f7f0919 commit eeb51c9
Showing 1 changed file with 50 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ resource "google_container_cluster" "cluster" {
name = "my-cluster"
location = "us-central1-a"
initial_node_count = 1
provider = google-beta
}
resource "google_gke_hub_membership" "membership" {
Expand All @@ -25,7 +24,6 @@ resource "google_gke_hub_membership" "membership" {
resource_link = "//container.googleapis.com/${google_container_cluster.cluster.id}"
}
}
provider = google-beta
}
resource "google_gke_hub_feature" "feature" {
Expand All @@ -35,7 +33,6 @@ resource "google_gke_hub_feature" "feature" {
labels = {
foo = "bar"
}
provider = google-beta
}
resource "google_gke_hub_feature_membership" "feature_member" {
Expand All @@ -50,7 +47,6 @@ resource "google_gke_hub_feature_membership" "feature_member" {
}
}
}
provider = google-beta
}
```
## Example Usage - Config Management with OCI
Expand All @@ -60,7 +56,6 @@ resource "google_container_cluster" "cluster" {
name = "my-cluster"
location = "us-central1-a"
initial_node_count = 1
provider = google-beta
}
resource "google_gke_hub_membership" "membership" {
Expand All @@ -70,7 +65,6 @@ resource "google_gke_hub_membership" "membership" {
resource_link = "//container.googleapis.com/${google_container_cluster.cluster.id}"
}
}
provider = google-beta
}
resource "google_gke_hub_feature" "feature" {
Expand All @@ -80,7 +74,6 @@ resource "google_gke_hub_feature" "feature" {
labels = {
foo = "bar"
}
provider = google-beta
}
resource "google_gke_hub_feature_membership" "feature_member" {
Expand All @@ -99,7 +92,6 @@ resource "google_gke_hub_feature_membership" "feature_member" {
}
}
}
provider = google-beta
}
```

Expand All @@ -112,7 +104,6 @@ resource "google_gke_hub_feature" "feature" {
labels = {
foo = "bar"
}
provider = google-beta
}
```

Expand All @@ -123,7 +114,6 @@ resource "google_container_cluster" "cluster" {
name = "my-cluster"
location = "us-central1-a"
initial_node_count = 1
provider = google-beta
}
resource "google_gke_hub_membership" "membership" {
Expand All @@ -133,14 +123,11 @@ resource "google_gke_hub_membership" "membership" {
resource_link = "//container.googleapis.com/${google_container_cluster.cluster.id}"
}
}
provider = google-beta
}
resource "google_gke_hub_feature" "feature" {
name = "servicemesh"
location = "global"
provider = google-beta
}
resource "google_gke_hub_feature_membership" "feature_member" {
Expand All @@ -150,7 +137,50 @@ resource "google_gke_hub_feature_membership" "feature_member" {
mesh {
management = "MANAGEMENT_AUTOMATIC"
}
provider = google-beta
}
```

## Example Usage - Config Management with Regional Membership

```hcl
resource "google_container_cluster" "cluster" {
name = "my-cluster"
location = "us-central1-a"
initial_node_count = 1
}
resource "google_gke_hub_membership" "membership" {
membership_id = "my-membership"
location = "us-central1"
endpoint {
gke_cluster {
resource_link = "//container.googleapis.com/${google_container_cluster.cluster.id}"
}
}
}
resource "google_gke_hub_feature" "feature" {
name = "configmanagement"
location = "global"
labels = {
foo = "bar"
}
}
resource "google_gke_hub_feature_membership" "feature_member" {
location = "global"
feature = google_gke_hub_feature.feature.name
membership = google_gke_hub_membership.membership.membership_id
membership_location = google_gke_hub_membership.membership.location
configmanagement {
version = "1.6.2"
config_sync {
git {
sync_repo = "https://github.com/hashicorp/terraform"
}
}
}
}
```

Expand Down Expand Up @@ -178,7 +208,11 @@ The following arguments are supported:

* `membership` -
(Optional)
The name of the membership
The name of the membership

* `membership_location` -
(Optional)
The location of the membership, for example, "us-central1". Default is "global".

* `project` -
(Optional)
Expand Down Expand Up @@ -334,7 +368,7 @@ The following arguments are supported:

* `monitoring` -
(Optional)
Specifies the backends Policy Controller should export metrics to. For example, to specify metrics should be exported to Cloud Monitoring and Prometheus, specify backends: [\"cloudmonitoring\", \"prometheus\"]. Default: [\"cloudmonitoring\", \"prometheus\"]
Specifies the backends Policy Controller should export metrics to. For example, to specify metrics should be exported to Cloud Monitoring and Prometheus, specify backends: ["cloudmonitoring", "prometheus"]. Default: ["cloudmonitoring", "prometheus"]

<a name="nested_mesh"></a>The `mesh` block supports:

Expand Down

0 comments on commit eeb51c9

Please sign in to comment.