From 06fa75423ef7e6b44bd8f2f677e448b54f12365b Mon Sep 17 00:00:00 2001 From: George Christou Date: Sat, 18 Feb 2017 22:48:50 +0000 Subject: [PATCH] website/docs: Run `terraform fmt` on code examples (#12075) * docs/vsphere: Fix code block * docs: Convert `...` to `# ...` to allow `terraform fmt`ing * docs: Trim trailing whitespace * docs: First-pass run of `terraform fmt` on code examples --- d/google_iam_policy.html.markdown | 3 ++ ...mpute_global_forwarding_rule.html.markdown | 1 + r/compute_health_check.html.markdown | 1 + r/compute_image.html.markdown | 5 ++- r/compute_instance.html.markdown | 5 ++- r/compute_instance_group.html.markdown | 2 +- r/compute_instance_template.html.markdown | 42 +++++++++---------- r/compute_network.html.markdown | 2 +- r/compute_project_metadata.html.markdown | 4 +- ...mpute_region_backend_service.html.markdown | 11 ++--- r/compute_subnetwork.html.markdown | 2 +- r/compute_target_http_proxy.html.markdown | 2 +- r/compute_target_https_proxy.html.markdown | 2 +- r/compute_vpn_gateway.html.markdown | 2 +- r/compute_vpn_tunnel.html.markdown | 2 +- r/container_cluster.html.markdown | 12 +++--- r/dns_record_set.markdown | 5 ++- r/google_project.html.markdown | 8 ++-- r/google_project_iam_policy.html.markdown | 7 ++-- r/google_project_services.html.markdown | 4 +- r/google_service_account.html.markdown | 11 ++--- r/pubsub_subscription.html.markdown | 1 + r/storage_bucket.html.markdown | 2 +- r/storage_object_acl.html.markdown | 2 +- 24 files changed, 75 insertions(+), 63 deletions(-) diff --git a/d/google_iam_policy.html.markdown b/d/google_iam_policy.html.markdown index 81be62a1..fe0c4dca 100644 --- a/d/google_iam_policy.html.markdown +++ b/d/google_iam_policy.html.markdown @@ -16,12 +16,15 @@ other Google Cloud Platform resources, such as the `google_project` resource. data "google_iam_policy" "admin" { binding { role = "roles/compute.instanceAdmin" + members = [ "serviceAccount:your-custom-sa@your-project.iam.gserviceaccount.com", ] } + binding { role = "roles/storage.objectViewer" + members = [ "user:evanbrown@google.com", ] diff --git a/r/compute_global_forwarding_rule.html.markdown b/r/compute_global_forwarding_rule.html.markdown index 7f39d4e2..9b5b9c81 100644 --- a/r/compute_global_forwarding_rule.html.markdown +++ b/r/compute_global_forwarding_rule.html.markdown @@ -41,6 +41,7 @@ resource "google_compute_url_map" "default" { path_matcher { name = "allpaths" default_service = "${google_compute_backend_service.default.self_link}" + path_rule { paths = ["/*"] service = "${google_compute_backend_service.default.self_link}" diff --git a/r/compute_health_check.html.markdown b/r/compute_health_check.html.markdown index a24e656d..f9690144 100644 --- a/r/compute_health_check.html.markdown +++ b/r/compute_health_check.html.markdown @@ -23,6 +23,7 @@ resource "google_compute_health_check" "default" { timeout_sec = 1 check_interval_sec = 1 + tcp_health_check { port = "80" } diff --git a/r/compute_image.html.markdown b/r/compute_image.html.markdown index 0b64155a..3983d981 100644 --- a/r/compute_image.html.markdown +++ b/r/compute_image.html.markdown @@ -17,7 +17,8 @@ tarball. For more information see [the official documentation](https://cloud.goo ```js resource "google_compute_image" "bootable-image" { - name = "my-custom-image" + name = "my-custom-image" + raw_disk { source = "https://storage.googleapis.com/my-bucket/my-disk-image-tarball.tar.gz" } @@ -33,7 +34,7 @@ resource "google_compute_instance" "vm" { } network_interface { - network = "default" + network = "default" } } ``` diff --git a/r/compute_instance.html.markdown b/r/compute_instance.html.markdown index 7a0ad756..174feee9 100644 --- a/r/compute_instance.html.markdown +++ b/r/compute_instance.html.markdown @@ -36,6 +36,7 @@ resource "google_compute_instance" "default" { network_interface { network = "default" + access_config { // Ephemeral IP } @@ -72,7 +73,7 @@ The following arguments are supported: * `network_interface` - (Required) Networks to attach to the instance. This can be specified multiple times for multiple networks, but GCE is currently limited to just 1. Structure is documented below. - + - - - * `can_ip_forward` - (Optional) Whether to allow sending and receiving of @@ -103,7 +104,7 @@ The following arguments are supported: * `create_timeout` - (Optional) Configurable timeout in minutes for creating instances. Default is 4 minutes. Changing this forces a new resource to be created. - + --- * `network` - (DEPRECATED, Required) Networks to attach to the instance. This diff --git a/r/compute_instance_group.html.markdown b/r/compute_instance_group.html.markdown index c6061eb8..2fe52062 100644 --- a/r/compute_instance_group.html.markdown +++ b/r/compute_instance_group.html.markdown @@ -32,7 +32,7 @@ resource "google_compute_instance_group" "webservers" { instances = [ "${google_compute_instance.test.self_link}", - "${google_compute_instance.test2.self_link}" + "${google_compute_instance.test2.self_link}", ] named_port { diff --git a/r/compute_instance_template.html.markdown b/r/compute_instance_template.html.markdown index 796cb4e9..0774f0e2 100644 --- a/r/compute_instance_template.html.markdown +++ b/r/compute_instance_template.html.markdown @@ -36,8 +36,8 @@ resource "google_compute_instance_template" "foobar" { // Create a new boot disk from an image disk { source_image = "debian-cloud/debian-8" - auto_delete = true - boot = true + auto_delete = true + boot = true } // Use an existing disk resource @@ -73,31 +73,31 @@ with `name_prefix`. Example: ``` resource "google_compute_instance_template" "instance_template" { - name_prefix = "instance-template-" - machine_type = "n1-standard-1" - region = "us-central1" + name_prefix = "instance-template-" + machine_type = "n1-standard-1" + region = "us-central1" - // boot disk - disk { - ... - } + // boot disk + disk { + # ... + } - // networking - network_interface { - ... - } + // networking + network_interface { + # ... + } - lifecycle { - create_before_destroy = true - } + lifecycle { + create_before_destroy = true + } } resource "google_compute_instance_group_manager" "instance_group_manager" { - name = "instance-group-manager" - instance_template = "${google_compute_instance_template.instance_template.self_link}" - base_instance_name = "instance-group-manager" - zone = "us-central1-f" - target_size = "1" + name = "instance-group-manager" + instance_template = "${google_compute_instance_template.instance_template.self_link}" + base_instance_name = "instance-group-manager" + zone = "us-central1-f" + target_size = "1" } ``` diff --git a/r/compute_network.html.markdown b/r/compute_network.html.markdown index 358b05a2..7cea11ad 100644 --- a/r/compute_network.html.markdown +++ b/r/compute_network.html.markdown @@ -39,7 +39,7 @@ The following arguments are supported: * `ipv4_range` - (DEPRECATED, Optional) The IPv4 address range that machines in this network are assigned to, represented as a CIDR block. If not set, an auto or custom - subnetted network will be created, depending on the value of + subnetted network will be created, depending on the value of `auto_create_subnetworks` attribute. This attribute may not be used if `auto_create_subnetworks` is specified. This attribute is deprecated. diff --git a/r/compute_project_metadata.html.markdown b/r/compute_project_metadata.html.markdown index d1f1652a..dfe9c250 100644 --- a/r/compute_project_metadata.html.markdown +++ b/r/compute_project_metadata.html.markdown @@ -12,12 +12,12 @@ Manages metadata common to all instances for a project in GCE. ## Example Usage -```js +``` resource "google_compute_project_metadata" "default" { metadata { foo = "bar" fizz = "buzz" - 13 = "42" + "13" = "42" } } ``` diff --git a/r/compute_region_backend_service.html.markdown b/r/compute_region_backend_service.html.markdown index 10ee1256..583fa17d 100644 --- a/r/compute_region_backend_service.html.markdown +++ b/r/compute_region_backend_service.html.markdown @@ -16,11 +16,11 @@ See [backendServices](https://cloud.google.com/compute/docs/reference/latest/bac ```tf resource "google_compute_region_backend_service" "foobar" { - name = "blablah" - description = "Hello World 1234" - protocol = "TCP" - timeout_sec = 10 - session_affinity = "CLIENT_IP" + name = "blablah" + description = "Hello World 1234" + protocol = "TCP" + timeout_sec = 10 + session_affinity = "CLIENT_IP" backend { group = "${google_compute_instance_group_manager.foo.instance_group}" @@ -57,6 +57,7 @@ resource "google_compute_health_check" "default" { check_interval_sec = 1 timeout_sec = 1 type = "TCP" + tcp_health_check { port = "80" } diff --git a/r/compute_subnetwork.html.markdown b/r/compute_subnetwork.html.markdown index 6425fbe9..81f7c138 100644 --- a/r/compute_subnetwork.html.markdown +++ b/r/compute_subnetwork.html.markdown @@ -31,7 +31,7 @@ The following arguments are supported: * `name` - (Required) A unique name for the resource, required by GCE. Changing this forces a new resource to be created. -* `network` - (Required) The network name or resource link to the parent +* `network` - (Required) The network name or resource link to the parent network of this subnetwork. The parent network must have been created in custom subnet mode. diff --git a/r/compute_target_http_proxy.html.markdown b/r/compute_target_http_proxy.html.markdown index 3b36f414..18071e41 100644 --- a/r/compute_target_http_proxy.html.markdown +++ b/r/compute_target_http_proxy.html.markdown @@ -39,7 +39,7 @@ resource "google_compute_url_map" "default" { default_service = "${google_compute_backend_service.default.self_link}" path_rule { - paths = ["/*"] + paths = ["/*"] service = "${google_compute_backend_service.default.self_link}" } } diff --git a/r/compute_target_https_proxy.html.markdown b/r/compute_target_https_proxy.html.markdown index 5f3d82d1..932c71b7 100644 --- a/r/compute_target_https_proxy.html.markdown +++ b/r/compute_target_https_proxy.html.markdown @@ -47,7 +47,7 @@ resource "google_compute_url_map" "default" { default_service = "${google_compute_backend_service.default.self_link}" path_rule { - paths = ["/*"] + paths = ["/*"] service = "${google_compute_backend_service.default.self_link}" } } diff --git a/r/compute_vpn_gateway.html.markdown b/r/compute_vpn_gateway.html.markdown index e7304fb9..0c511b55 100644 --- a/r/compute_vpn_gateway.html.markdown +++ b/r/compute_vpn_gateway.html.markdown @@ -89,7 +89,7 @@ The following arguments are supported: * `name` - (Required) A unique name for the resource, required by GCE. Changing this forces a new resource to be created. -* `network` - (Required) The name or resource link to the network this VPN gateway +* `network` - (Required) The name or resource link to the network this VPN gateway is accepting traffic for. Changing this forces a new resource to be created. - - - diff --git a/r/compute_vpn_tunnel.html.markdown b/r/compute_vpn_tunnel.html.markdown index 142d6c5a..a3673273 100644 --- a/r/compute_vpn_tunnel.html.markdown +++ b/r/compute_vpn_tunnel.html.markdown @@ -66,7 +66,7 @@ resource "google_compute_vpn_tunnel" "tunnel1" { target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}" - local_traffic_selector = ["${google_compute_subnetwork.subnet1.ip_cidr_range}"] + local_traffic_selector = ["${google_compute_subnetwork.subnet1.ip_cidr_range}"] remote_traffic_selector = ["172.16.0.0/12"] depends_on = [ diff --git a/r/container_cluster.html.markdown b/r/container_cluster.html.markdown index 9c2306fe..9375319a 100644 --- a/r/container_cluster.html.markdown +++ b/r/container_cluster.html.markdown @@ -16,13 +16,13 @@ whole cluster! ```js resource "google_container_cluster" "primary" { - name = "marcellus-wallace" - zone = "us-central1-a" + name = "marcellus-wallace" + zone = "us-central1-a" initial_node_count = 3 additional_zones = [ "us-central1-b", - "us-central1-c" + "us-central1-c", ] master_auth { @@ -35,7 +35,7 @@ resource "google_container_cluster" "primary" { "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", - "https://www.googleapis.com/auth/monitoring" + "https://www.googleapis.com/auth/monitoring", ] } } @@ -83,8 +83,8 @@ resource "google_container_cluster" "primary" { this cluster * `node_version` - (Optional) The Kubernetes version on the nodes. Also affects - the initial master version on cluster creation. Updates affect nodes only. - Defaults to the default version set by GKE which is not necessarily the latest + the initial master version on cluster creation. Updates affect nodes only. + Defaults to the default version set by GKE which is not necessarily the latest version. * `project` - (Optional) The project in which the resource belongs. If it diff --git a/r/dns_record_set.markdown b/r/dns_record_set.markdown index 50810913..1f4b39d2 100644 --- a/r/dns_record_set.markdown +++ b/r/dns_record_set.markdown @@ -25,10 +25,11 @@ resource "google_compute_instance" "frontend" { } network_interface { - network = "default" - access_config {} + network = "default" + access_config = {} } } + resource "google_dns_managed_zone" "prod" { name = "prod-zone" dns_name = "prod.mydomain.com." diff --git a/r/google_project.html.markdown b/r/google_project.html.markdown index 2fdcf275..3e662c2a 100755 --- a/r/google_project.html.markdown +++ b/r/google_project.html.markdown @@ -3,7 +3,7 @@ layout: "google" page_title: "Google: google_project" sidebar_current: "docs-google-project" description: |- - Allows management of a Google Cloud Platform project. + Allows management of a Google Cloud Platform project. --- # google\_project @@ -23,9 +23,9 @@ doc for more information. ```js resource "google_project" "my_project" { - project_id = "your-project-id" - org_id = "1234567" - services = ["compute_component", "storage-component-json.googleapis.com", "iam.googleapis.com"] + project_id = "your-project-id" + org_id = "1234567" + services = ["compute_component", "storage-component-json.googleapis.com", "iam.googleapis.com"] } ``` diff --git a/r/google_project_iam_policy.html.markdown b/r/google_project_iam_policy.html.markdown index a62c0273..94a991f9 100644 --- a/r/google_project_iam_policy.html.markdown +++ b/r/google_project_iam_policy.html.markdown @@ -3,7 +3,7 @@ layout: "google" page_title: "Google: google_project_iam_policy" sidebar_current: "docs-google-project-iam-policy" description: |- - Allows management of an IAM policy for a Google Cloud Platform project. + Allows management of an IAM policy for a Google Cloud Platform project. --- # google\_project\_iam\_policy @@ -15,13 +15,14 @@ Platform project. ```js resource "google_project_iam_policy" "project" { - project = "your-project-id" - policy_data = "${data.google_iam_policy.admin.policy_data}" + project = "your-project-id" + policy_data = "${data.google_iam_policy.admin.policy_data}" } data "google_iam_policy" "admin" { binding { role = "roles/editor" + members = [ "user:jane@example.com", ] diff --git a/r/google_project_services.html.markdown b/r/google_project_services.html.markdown index 4d16c857..98bd0481 100644 --- a/r/google_project_services.html.markdown +++ b/r/google_project_services.html.markdown @@ -3,7 +3,7 @@ layout: "google" page_title: "Google: google_project_services" sidebar_current: "docs-google-project-services" description: |- - Allows management of API services for a Google Cloud Platform project. + Allows management of API services for a Google Cloud Platform project. --- # google\_project\_services @@ -17,7 +17,7 @@ in the config will be removed. ```js resource "google_project_services" "project" { project_id = "your-project-id" - services = ["iam.googleapis.com", "cloudresourcemanager.googleapis.com"] + services = ["iam.googleapis.com", "cloudresourcemanager.googleapis.com"] } ``` diff --git a/r/google_service_account.html.markdown b/r/google_service_account.html.markdown index a1840c1f..7c0c6350 100644 --- a/r/google_service_account.html.markdown +++ b/r/google_service_account.html.markdown @@ -3,7 +3,7 @@ layout: "google" page_title: "Google: google_service_account" sidebar_current: "docs-google-service-account" description: |- - Allows management of a Google Cloud Platform service account. + Allows management of a Google Cloud Platform service account. --- # google\_service\_account @@ -17,18 +17,19 @@ permission in a project. ```js resource "google_service_account" "object_viewer" { - account_id = "object-viewer" - display_name = "Object viewer" + account_id = "object-viewer" + display_name = "Object viewer" } resource "google_project" "my_project" { - id = "your-project-id" - policy_data = "${data.google_iam_policy.admin.policy_data}" + id = "your-project-id" + policy_data = "${data.google_iam_policy.admin.policy_data}" } data "google_iam_policy" "admin" { binding { role = "roles/storage.objectViewer" + members = [ "serviceAccount:${google_service_account.object_viewer.email}", ] diff --git a/r/pubsub_subscription.html.markdown b/r/pubsub_subscription.html.markdown index e2b4ccaa..66715dab 100644 --- a/r/pubsub_subscription.html.markdown +++ b/r/pubsub_subscription.html.markdown @@ -24,6 +24,7 @@ resource "google_pubsub_subscription" "default" { push_config { endpoint = "https://example.com/push" + attributes { x-goog-version = "v1" } diff --git a/r/storage_bucket.html.markdown b/r/storage_bucket.html.markdown index df2eae69..dbd482c6 100644 --- a/r/storage_bucket.html.markdown +++ b/r/storage_bucket.html.markdown @@ -22,7 +22,7 @@ resource "google_storage_bucket" "image-store" { website { main_page_suffix = "index.html" - not_found_page = "404.html" + not_found_page = "404.html" } } ``` diff --git a/r/storage_object_acl.html.markdown b/r/storage_object_acl.html.markdown index 046e310c..1b27da3f 100644 --- a/r/storage_object_acl.html.markdown +++ b/r/storage_object_acl.html.markdown @@ -21,7 +21,7 @@ resource "google_storage_bucket" "image-store" { } resource "google_storage_bucket_object" "image" { - name = "image1" + name = "image1" bucket = "${google_storage_bucket.name}" source = "image1.jpg" }