Skip to content

Commit

Permalink
deprecate 0.11 syntax in docs (resources) (#2574)
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 authored and rileykarson committed Nov 11, 2019
1 parent 7dd51a0 commit 92874ec
Show file tree
Hide file tree
Showing 78 changed files with 758 additions and 767 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Get a Compute Instance Group within GCE.
For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/#unmanaged_instance_groups)
and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroups)

```
```hcl
data "google_compute_instance_group" "all" {
name = "instance-group-name"
zone = "us-central1-a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: |-
Generates an IAM policy document that may be referenced by and applied to
other Google Cloud Platform resources, such as the `google_project` resource.

```
```hcl
data "google_iam_policy" "admin" {
binding {
role = "roles/compute.instanceAdmin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "google_project" "my_project" {
}
resource "google_app_engine_application" "app" {
project = "${google_project.my_project.project_id}"
project = google_project.my_project.project_id
location_id = "us-central"
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "google_bigquery_dataset" "default" {
}
resource "google_bigquery_table" "default" {
dataset_id = "${google_bigquery_dataset.default.dataset_id}"
dataset_id = google_bigquery_dataset.default.dataset_id
table_id = "bar"
time_partitioning {
Expand All @@ -57,10 +57,11 @@ resource "google_bigquery_table" "default" {
}
]
EOF
}
resource "google_bigquery_table" "sheet" {
dataset_id = "${google_bigquery_dataset.default.dataset_id}"
dataset_id = google_bigquery_dataset.default.dataset_id
table_id = "sheet"
external_data_configuration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,48 @@ Creates a Google Cloud Bigtable GC Policy inside a family. For more information

```hcl
resource "google_bigtable_instance" "instance" {
name = "tf-instance"
cluster_id = "tf-instance-cluster"
zone = "us-central1-b"
num_nodes = 3
storage_type = "HDD"
name = "tf-instance"
cluster {
cluster_id = "tf-instance-cluster"
zone = "us-central1-b"
num_nodes = 3
storage_type = "HDD"
}
}
resource "google_bigtable_table" "table" {
name = "tf-table"
instance_name = "${google_bigtable_instance.instance.name}"
instance_name = google_bigtable_instance.instance.name
column_family {
family = "name"
}
}
resource "google_bigtable_gc_policy" "policy" {
instance_name = "${google_bigtable_instance.instance.name}"
table = "${google_bigtable_table.table.name}"
instance_name = google_bigtable_instance.instance.name
table = google_bigtable_table.table.name
column_family = "name"
max_age {
days = 7
}
}
```

Multiple conditions is also supported. `UNION` when any of its sub-policies apply (OR). `INTERSECTION` when all its sub-policies apply (AND)
```
```hcl
resource "google_bigtable_gc_policy" "policy" {
instance_name = "${google_bigtable_instance.instance.name}"
table = "${google_bigtable_table.table.name}"
instance_name = google_bigtable_instance.instance.name
table = google_bigtable_table.table.name
column_family = "name"
mode = "UNION"
max_age {
days = 7
}
max_version {
number = 10
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Creates a Google Bigtable instance. For more information see

```hcl
resource "google_bigtable_instance" "production-instance" {
name = "tf-instance"
name = "tf-instance"
cluster {
cluster_id = "tf-instance-cluster"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@ Three different resources help you manage IAM policies on bigtable instances. Ea
```hcl
data "google_iam_policy" "admin" {
binding {
role = "roles/editor"
role = "roles/editor"
members = [
"user:[email protected]",
]
}
}
resource "google_bigtable_instance_iam_policy" "editor" {
project = "your-project"
instance = "your-bigtable-instance"
policy_data = "${data.google_iam_policy.admin.policy_data}"
project = "your-project"
instance = "your-bigtable-instance"
policy_data = data.google_iam_policy.admin.policy_data
}
```

## google\_bigtable\_instance\_iam\_binding

```hcl
resource "google_bigtable_instance_iam_binding" "editor" {
instance = "your-bigtable-instance"
role = "roles/editor"
members = [
instance = "your-bigtable-instance"
role = "roles/editor"
members = [
"user:[email protected]",
]
}
Expand All @@ -54,9 +54,9 @@ resource "google_bigtable_instance_iam_binding" "editor" {

```hcl
resource "google_bigtable_instance_iam_member" "editor" {
instance = "your-bigtable-instance"
role = "roles/editor"
member = "user:[email protected]"
instance = "your-bigtable-instance"
role = "roles/editor"
member = "user:[email protected]"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ Creates a Google Cloud Bigtable table inside an instance. For more information s

```hcl
resource "google_bigtable_instance" "instance" {
name = "tf-instance"
cluster_id = "tf-instance-cluster"
zone = "us-central1-b"
num_nodes = 3
storage_type = "HDD"
name = "tf-instance"
cluster {
cluster_id = "tf-instance-cluster"
zone = "us-central1-b"
num_nodes = 3
storage_type = "HDD"
}
}
resource "google_bigtable_table" "table" {
name = "tf-table"
instance_name = "${google_bigtable_instance.instance.name}"
instance_name = google_bigtable_instance.instance.name
split_keys = ["a", "b", "c"]
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ resource "google_storage_bucket" "bucket" {
resource "google_storage_bucket_object" "archive" {
name = "index.zip"
bucket = "${google_storage_bucket.bucket.name}"
bucket = google_storage_bucket.bucket.name
source = "./path/to/zip/file/which/contains/code"
}
resource "google_cloudfunctions_function" "function" {
name = "function-test"
description = "My function"
runtime = "nodejs10"
name = "function-test"
description = "My function"
runtime = "nodejs10"
available_memory_mb = 128
source_archive_bucket = "${google_storage_bucket.bucket.name}"
source_archive_object = "${google_storage_bucket_object.archive.name}"
source_archive_bucket = google_storage_bucket.bucket.name
source_archive_object = google_storage_bucket_object.archive.name
trigger_http = true
entry_point = "helloGET"
}
# IAM entry for all users to invoke the function
resource "google_cloudfunctions_function_iam_member" "invoker" {
project = "${google_cloudfunctions_function.function.project}"
region = "${google_cloudfunctions_function.function.region}"
cloud_function = "${google_cloudfunctions_function.function.name}"
project = google_cloudfunctions_function.function.project
region = google_cloudfunctions_function.function.region
cloud_function = google_cloudfunctions_function.function.name
role = "roles/cloudfunctions.invoker"
role = "roles/cloudfunctions.invoker"
member = "allUsers"
}
```
Expand All @@ -65,18 +65,18 @@ resource "google_storage_bucket" "bucket" {
resource "google_storage_bucket_object" "archive" {
name = "index.zip"
bucket = "${google_storage_bucket.bucket.name}"
bucket = google_storage_bucket.bucket.name
source = "./path/to/zip/file/which/contains/code"
}
resource "google_cloudfunctions_function" "function" {
name = "function-test"
description = "My function"
runtime = "nodejs10"
name = "function-test"
description = "My function"
runtime = "nodejs10"
available_memory_mb = 128
source_archive_bucket = "${google_storage_bucket.bucket.name}"
source_archive_object = "${google_storage_bucket_object.archive.name}"
source_archive_bucket = google_storage_bucket.bucket.name
source_archive_object = google_storage_bucket_object.archive.name
trigger_http = true
timeout = 60
entry_point = "helloGET"
Expand All @@ -91,11 +91,11 @@ resource "google_cloudfunctions_function" "function" {
# IAM entry for a single user to invoke the function
resource "google_cloudfunctions_function_iam_member" "invoker" {
project = "${google_cloudfunctions_function.function.project}"
region = "${google_cloudfunctions_function.function.region}"
cloud_function = "${google_cloudfunctions_function.function.name}"
project = google_cloudfunctions_function.function.project
region = google_cloudfunctions_function.function.region
cloud_function = google_cloudfunctions_function.function.name
role = "roles/cloudfunctions.invoker"
role = "roles/cloudfunctions.invoker"
member = "user:[email protected]"
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "google_cloudiot_registry" "default-registry" {
name = "default-registry"
event_notification_configs {
pubsub_topic_name = "${google_pubsub_topic.default-telemetry.id}"
pubsub_topic_name = google_pubsub_topic.default-telemetry.id
}
state_notification_config = {
pubsub_topic_name = "${google_pubsub_topic.default-devicestatus.id}"
pubsub_topic_name = google_pubsub_topic.default-devicestatus.id
}
http_config = {
Expand All @@ -47,7 +47,7 @@ resource "google_cloudiot_registry" "default-registry" {
credentials {
public_key_certificate = {
format = "X509_CERTIFICATE_PEM"
certificate = "${file("rsa_cert.pem")}"
certificate = file("rsa_cert.pem")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,35 @@ on the IAM policy binding (see `google_project_iam_member` below).

```hcl
resource "google_composer_environment" "test" {
name = "%s"
name = "%s"
region = "us-central1"
config {
node_count = 4
node_config {
zone = "us-central1-a"
zone = "us-central1-a"
machine_type = "n1-standard-1"
network = "${google_compute_network.test.self_link}"
subnetwork = "${google_compute_subnetwork.test.self_link}"
network = google_compute_network.test.self_link
subnetwork = google_compute_subnetwork.test.self_link
service_account = "${google_service_account.test.name}"
service_account = google_service_account.test.name
}
}
depends_on = ["google_project_iam_member.composer-worker"]
depends_on = [google_project_iam_member.composer-worker]
}
resource "google_compute_network" "test" {
name = "composer-test-network"
name = "composer-test-network"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "test" {
name = "composer-test-subnetwork"
ip_cidr_range = "10.2.0.0/16"
region = "us-central1"
network = "${google_compute_network.test.self_link}"
network = google_compute_network.test.self_link
}
resource "google_service_account" "test" {
Expand All @@ -87,15 +87,15 @@ resource "google_service_account" "test" {
}
resource "google_project_iam_member" "composer-worker" {
role = "roles/composer.worker"
member = "serviceAccount:${google_service_account.test.email}"
role = "roles/composer.worker"
member = "serviceAccount:${google_service_account.test.email}"
}
```

### With Software (Airflow) Config
```hcl
resource "google_composer_environment" "test" {
name = "%s"
name = "%s"
region = "us-central1"
config {
Expand All @@ -110,7 +110,7 @@ resource "google_composer_environment" "test" {
}
env_variables = {
FOO = "bar"
FOO = "bar"
}
}
}
Expand Down
Loading

0 comments on commit 92874ec

Please sign in to comment.