Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate 0.11 syntax in docs (magic modules examples) #2579

Merged
merged 9 commits into from
Nov 4, 2019
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "google_access_context_manager_access_level" "<%= ctx[:primary_resource_id] %>" {
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/accessLevels/<%= ctx[:vars]['access_level_name'] %>"
title = "<%= ctx[:vars]['access_level_name'] %>"
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/accessLevels/<%= ctx[:vars]['access_level_name'] %>"
title = "<%= ctx[:vars]['access_level_name'] %>"
basic {
conditions {
device_policy {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
resource "google_access_context_manager_service_perimeter" "<%= ctx[:primary_resource_id] %>" {
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/servicePerimeters/<%= ctx[:vars]['service_perimeter_name'] %>"
title = "<%= ctx[:vars]['service_perimeter_name'] %>"
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/servicePerimeters/<%= ctx[:vars]['service_perimeter_name'] %>"
title = "<%= ctx[:vars]['service_perimeter_name'] %>"
status {
restricted_services = ["storage.googleapis.com"]
}
}

resource "google_access_context_manager_access_level" "access-level" {
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/accessLevels/<%= ctx[:vars]['access_level_name'] %>"
title = "<%= ctx[:vars]['access_level_name'] %>"
parent = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}"
name = "accessPolicies/${google_access_context_manager_access_policy.test-access.name}/accessLevels/<%= ctx[:vars]['access_level_name'] %>"
title = "<%= ctx[:vars]['access_level_name'] %>"
basic {
conditions {
device_policy {
Expand Down
4 changes: 2 additions & 2 deletions templates/terraform/examples/address_with_subnetwork.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ resource "google_compute_subnetwork" "default" {
name = "<%= ctx[:vars]['subnetwork_name'] %>"
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
network = "${google_compute_network.default.self_link}"
network = google_compute_network.default.self_link
}

resource "google_compute_address" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['address_name'] %>"
subnetwork = "${google_compute_subnetwork.default.self_link}"
subnetwork = google_compute_subnetwork.default.self_link
address_type = "INTERNAL"
address = "10.0.42.42"
region = "us-central1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
resource "google_app_engine_application_url_dispatch_rules" "<%= ctx[:primary_resource_id] %>" {
dispatch_rules {
domain = "*"
path = "/*"
domain = "*"
path = "/*"
service = "default"
}

dispatch_rules {
domain = "*"
path = "/admin/*"
service = "${google_app_engine_standard_app_version.admin_v3.service}"
domain = "*"
path = "/admin/*"
service = google_app_engine_standard_app_version.admin_v3.service
}
}

resource "google_app_engine_standard_app_version" "admin_v3" {
version_id = "v3"
service = "admin"
runtime = "nodejs10"
service = "admin"
runtime = "nodejs10"

entrypoint {
shell = "node ./app.js"
Expand All @@ -35,11 +35,11 @@ resource "google_app_engine_standard_app_version" "admin_v3" {
}

resource "google_storage_bucket" "bucket" {
name = "<%= ctx[:vars]['bucket_name'] %>"
name = "<%= ctx[:vars]['bucket_name'] %>"
}

resource "google_storage_bucket_object" "object" {
name = "hello-world.zip"
bucket = "${google_storage_bucket.bucket.name}"
source = "./test-fixtures/appengine/hello-world.zip"
name = "hello-world.zip"
bucket = google_storage_bucket.bucket.name
source = "./test-fixtures/appengine/hello-world.zip"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "google_app_engine_domain_mapping" "<%= ctx[:primary_resource_id] %>" {
domain_name = "<%= ctx[:vars]["domain"] %>.gcp.tfacc.hashicorptest.com"

ssl_settings {
ssl_management_type = "AUTOMATIC"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ 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"
}

resource "google_app_engine_firewall_rule" "rule" {
project = "${google_app_engine_application.app.project}"
priority = 1000
action = "ALLOW"
project = google_app_engine_application.app.project
priority = 1000
action = "ALLOW"
source_range = "*"
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ resource "google_app_engine_standard_app_version" "myapp_v2" {
}

resource "google_storage_bucket" "bucket" {
name = "<%= ctx[:vars]['bucket_name'] %>"
name = "<%= ctx[:vars]['bucket_name'] %>"
}

resource "google_storage_bucket_object" "object" {
name = "hello-world.zip"
bucket = "${google_storage_bucket.bucket.name}"
source = "./test-fixtures/appengine/hello-world.zip"
name = "hello-world.zip"
bucket = google_storage_bucket.bucket.name
source = "./test-fixtures/appengine/hello-world.zip"
}
12 changes: 6 additions & 6 deletions templates/terraform/examples/autoscaler_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "google_compute_autoscaler" "foobar" {
name = "<%= ctx[:vars]['autoscaler_name'] %>"
zone = "us-central1-f"
target = "${google_compute_instance_group_manager.foobar.self_link}"
target = google_compute_instance_group_manager.foobar.self_link

autoscaling_policy {
max_replicas = 5
Expand All @@ -22,7 +22,7 @@ resource "google_compute_instance_template" "foobar" {
tags = ["foo", "bar"]

disk {
source_image = "${data.google_compute_image.debian_9.self_link}"
source_image = data.google_compute_image.debian_9.self_link
}

network_interface {
Expand All @@ -46,13 +46,13 @@ resource "google_compute_instance_group_manager" "foobar" {
name = "<%= ctx[:vars]['igm_name'] %>"
zone = "us-central1-f"

instance_template = "${google_compute_instance_template.foobar.self_link}"
instance_template = google_compute_instance_template.foobar.self_link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing here


target_pools = ["${google_compute_target_pool.foobar.self_link}"]
target_pools = [google_compute_target_pool.foobar.self_link]
base_instance_name = "foobar"
}

data "google_compute_image" "debian_9" {
family = "debian-9"
project = "debian-cloud"
family = "debian-9"
project = "debian-cloud"
}
22 changes: 11 additions & 11 deletions templates/terraform/examples/autoscaler_single_instance.tf.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
resource "google_compute_autoscaler" "<%= ctx[:primary_resource_id] %>" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['autoscaler_name'] %>"
zone = "us-central1-f"
target = "${google_compute_instance_group_manager.default.self_link}"
target = google_compute_instance_group_manager.default.self_link

autoscaling_policy {
max_replicas = 5
Expand All @@ -19,7 +19,7 @@ resource "google_compute_autoscaler" "<%= ctx[:primary_resource_id] %>" {
}

resource "google_compute_instance_template" "default" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['instance_template_name'] %>"
machine_type = "n1-standard-1"
Expand All @@ -28,7 +28,7 @@ resource "google_compute_instance_template" "default" {
tags = ["foo", "bar"]

disk {
source_image = "${data.google_compute_image.debian_9.self_link}"
source_image = data.google_compute_image.debian_9.self_link
}

network_interface {
Expand All @@ -45,34 +45,34 @@ resource "google_compute_instance_template" "default" {
}

resource "google_compute_target_pool" "default" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['target_pool_name'] %>"
}

resource "google_compute_instance_group_manager" "default" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['igm_name'] %>"
zone = "us-central1-f"

version {
instance_template = "${google_compute_instance_template.default.self_link}"
name = "primary"
instance_template = google_compute_instance_template.default.self_link
name = "primary"
}

target_pools = ["${google_compute_target_pool.default.self_link}"]
target_pools = [google_compute_target_pool.default.self_link]
base_instance_name = "autoscaler-sample"
}

data "google_compute_image" "debian_9" {
provider = "google-beta"
provider = google-beta

family = "debian-9"
project = "debian-cloud"
}

provider "google-beta"{
provider "google-beta" {
region = "us-central1"
zone = "us-central1-a"
}
2 changes: 1 addition & 1 deletion templates/terraform/examples/backend_bucket_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "google_compute_backend_bucket" "image_backend" {
name = "<%= ctx[:vars]['backend_bucket_name'] %>"
description = "Contains beautiful images"
bucket_name = "${google_storage_bucket.image_bucket.name}"
bucket_name = google_storage_bucket.image_bucket.name
enable_cdn = true
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
resource "google_compute_backend_bucket_signed_url_key" "backend_key" {
name = "<%= ctx[:vars]['key_name'] %>"
key_value = "pPsVemX8GM46QVeezid6Rw=="
backend_bucket = "${google_compute_backend_bucket.test_backend.name}"
backend_bucket = google_compute_backend_bucket.test_backend.name
}

resource "google_compute_backend_bucket" "test_backend" {
name = "<%= ctx[:vars]['backend_name'] %>"
description = "Contains beautiful images"
bucket_name = "${google_storage_bucket.bucket.name}"
bucket_name = google_storage_bucket.bucket.name
enable_cdn = true
}

Expand Down
2 changes: 1 addition & 1 deletion templates/terraform/examples/backend_service_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['backend_service_name'] %>"
health_checks = ["${google_compute_http_health_check.default.self_link}"]
health_checks = [google_compute_http_health_check.default.self_link]
}

resource "google_compute_http_health_check" "default" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "google_compute_backend_service_signed_url_key" "backend_key" {
name = "<%= ctx[:vars]['key_name'] %>"
key_value = "pPsVemX8GM46QVeezid6Rw=="
backend_service = "${google_compute_backend_service.example_backend.name}"
name = "<%= ctx[:vars]['key_name'] %>"
key_value = "pPsVemX8GM46QVeezid6Rw=="
backend_service = google_compute_backend_service.example_backend.name
}

resource "google_compute_backend_service" "example_backend" {
Expand All @@ -13,15 +13,15 @@ resource "google_compute_backend_service" "example_backend" {
enable_cdn = true

backend {
group = "${google_compute_instance_group_manager.webservers.instance_group}"
group = google_compute_instance_group_manager.webservers.instance_group
}

health_checks = ["${google_compute_http_health_check.default.self_link}"]
health_checks = [google_compute_http_health_check.default.self_link]
}

resource "google_compute_instance_group_manager" "webservers" {
name = "my-webservers"
instance_template = "${google_compute_instance_template.webserver.self_link}"
instance_template = google_compute_instance_template.webserver.self_link
base_instance_name = "webserver"
zone = "us-central1-f"
target_size = 1
Expand All @@ -47,4 +47,4 @@ resource "google_compute_http_health_check" "default" {
request_path = "/"
check_interval_sec = 1
timeout_sec = 1
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['backend_service_name'] %>"
health_checks = ["${google_compute_health_check.health_check.self_link}"]
name = "<%= ctx[:vars]['backend_service_name'] %>"
health_checks = [google_compute_health_check.health_check.self_link]
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
locality_lb_policy = "RING_HASH"
session_affinity = "HTTP_COOKIE"
locality_lb_policy = "RING_HASH"
session_affinity = "HTTP_COOKIE"
circuit_breakers {
max_connections = 10
}
consistent_hash {
http_cookie {
ttl {
seconds = 11
nanos = 1111
nanos = 1111
}
name = "mycookie"
}
Expand All @@ -24,10 +24,9 @@ resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" {
}

resource "google_compute_health_check" "health_check" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['health_check_name'] %>"
name = "<%= ctx[:vars]['health_check_name'] %>"
http_health_check {

}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
resource "google_compute_backend_service" "<%= ctx[:primary_resource_id] %>" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['backend_service_name'] %>"
health_checks = ["${google_compute_health_check.health_check.self_link}"]
name = "<%= ctx[:vars]['backend_service_name'] %>"
health_checks = [google_compute_health_check.health_check.self_link]
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
locality_lb_policy = "ROUND_ROBIN"
locality_lb_policy = "ROUND_ROBIN"
}

resource "google_compute_health_check" "health_check" {
provider = "google-beta"
provider = google-beta

name = "<%= ctx[:vars]['health_check_name'] %>"
name = "<%= ctx[:vars]['health_check_name'] %>"
http_health_check {

}
}
4 changes: 2 additions & 2 deletions templates/terraform/examples/bigquery_dataset_cmek.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ resource "google_bigquery_dataset" "<%= ctx[:primary_resource_id] %>" {
default_table_expiration_ms = 3600000

default_encryption_configuration {
kms_key_name = "${google_kms_crypto_key.crypto_key.self_link}"
kms_key_name = google_kms_crypto_key.crypto_key.self_link
}
}

resource "google_kms_crypto_key" "crypto_key" {
name = "<%= ctx[:vars]['key_name'] %>"
key_ring = "${google_kms_key_ring.key_ring.self_link}"
key_ring = google_kms_key_ring.key_ring.self_link
}

resource "google_kms_key_ring" "key_ring" {
Expand Down
Loading