Skip to content

Commit

Permalink
changes to terraform/website/docs/d from terrafmt upgrade012
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 committed Oct 31, 2019
1 parent 80b42a7 commit 1221920
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ output "project" {
## Example Usage: Configure Kubernetes provider with OAuth2 access token

```tf
data "google_client_config" "default" {}
data "google_client_config" "default" {
}
data "google_container_cluster" "my_cluster" {
name = "my-cluster"
zone = "us-east1-a"
name = "my-cluster"
zone = "us-east1-a"
}
provider "kubernetes" {
load_config_file = false
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = "${data.google_client_config.default.access_token}"
cluster_ca_certificate = "${base64decode(data.google_container_cluster.my_cluster.master_auth.0.cluster_ca_certificate)}"
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = data.google_client_config.default.access_token
cluster_ca_certificate = base64decode(
data.google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate,
)
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ The most common use of this datasource will be to fetch information about the in

```hcl
resource "google_compute_region_instance_group_manager" "foo" {
name = "some_name"
name = "some_name"
...
base_instance_name = "foo"
base_instance_name = "foo"
...
instance_template = "${google_compute_instance_template.foo.self_link}"
target_pools = ["${google_compute_target_pool.foo.self_link}"]
instance_template = google_compute_instance_template.foo.self_link
target_pools = [google_compute_target_pool.foo.self_link]
...
}
data "google_compute_region_instance_group" "data_source" {
self_link = "${google_compute_region_instance_group_manager.foo.instance_group}"
self_link = google_compute_region_instance_group_manager.foo.instance_group
}
```

## Argument Reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,25 @@ output "my-email" {
## Example Usage - OpenID Connect w/ Kubernetes provider + RBAC IAM role

```hcl
data "google_client_openid_userinfo" "provider_identity" {}
data "google_client_openid_userinfo" "provider_identity" {
}
data "google_client_config" "provider" {}
data "google_client_config" "provider" {
}
data "google_container_cluster" "my_cluster" {
name = "my-cluster"
zone = "us-east1-a"
name = "my-cluster"
zone = "us-east1-a"
}
provider "kubernetes" {
load_config_file = false
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = "${data.google_client_config.provider.access_token}"
cluster_ca_certificate = "${base64decode(data.google_container_cluster.my_cluster.master_auth.0.cluster_ca_certificate)}"
host = "https://${data.google_container_cluster.my_cluster.endpoint}"
token = data.google_client_config.provider.access_token
cluster_ca_certificate = base64decode(
data.google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate,
)
}
resource "kubernetes_cluster_role_binding" "user" {
Expand All @@ -64,7 +68,7 @@ resource "kubernetes_cluster_role_binding" "user" {
subject {
kind = "User"
name = "${data.google_client_openid_userinfo.provider_identity.email}"
name = data.google_client_openid_userinfo.provider_identity.email
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data "google_compute_backend_service" "baz" {
resource "google_compute_backend_service" "default" {
name = "backend-service"
health_checks = ["${tolist(data.google_compute_backend_service.baz.health_checks)[0]}"]
health_checks = [tolist(data.google_compute_backend_service.baz.health_checks)[0]]
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ data "google_service_account" "myaccount" {
}
resource "google_service_account_key" "mykey" {
service_account_id = "${data.google_service_account.myaccount.name}"
service_account_id = data.google_service_account.myaccount.name
}
resource "kubernetes_secret" "google-application-credentials" {
metadata = {
metadata {
name = "google-application-credentials"
}
data {
credentials.json = "${base64decode(google_service_account_key.mykey.private_key)}"
data = {
credentials.json = base64decode(google_service_account_key.mykey.private_key)
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Finally, reference the encrypted ciphertext in your resource definitions:

```hcl
data "google_kms_secret" "sql_user_password" {
crypto_key = "${google_kms_crypto_key.my_crypto_key.self_link}"
crypto_key = google_kms_crypto_key.my_crypto_key.self_link
ciphertext = "CiQAqD+xX4SXOSziF4a8JYvq4spfAuWhhYSNul33H85HnVtNQW4SOgDu2UZ46dQCRFl5MF6ekabviN8xq+F+2035ZJ85B+xTYXqNf4mZs0RJitnWWuXlYQh6axnnJYu3kDU="
}
Expand All @@ -73,9 +73,9 @@ resource "google_sql_database_instance" "master" {
resource "google_sql_user" "users" {
name = "me"
instance = "${google_sql_database_instance.master.name}"
instance = google_sql_database_instance.master.name
host = "me.com"
password = "${data.google_kms_secret.sql_user_password.plaintext}"
password = data.google_kms_secret.sql_user_password.plaintext
}
```

Expand Down

0 comments on commit 1221920

Please sign in to comment.