Skip to content

Commit

Permalink
changes to templates/terraform/examples from upgrade012
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 committed Nov 4, 2019
1 parent 04e30b0 commit 412c7b1
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
resource "google_bigtable_instance" "instance" {
name = "<%= ctx[:vars]['instance_name'] %>"
cluster {
cluster_id = "<%= ctx[:vars]['instance_name'] %>"
zone = "us-central1-b"
num_nodes = 3
storage_type = "HDD"
}
name = "<%= ctx[:vars]['instance_name'] %>"
cluster {
cluster_id = "<%= ctx[:vars]['instance_name'] %>"
zone = "us-central1-b"
num_nodes = 3
storage_type = "HDD"
}
}

resource "google_bigtable_app_profile" "ap" {
instance = google_bigtable_instance.instance.name
app_profile_id = "<%= ctx[:vars]['app_profile_name'] %>"
instance = google_bigtable_instance.instance.name
app_profile_id = "<%= ctx[:vars]['app_profile_name'] %>"

single_cluster_routing {
cluster_id = "<%= ctx[:vars]['instance_name'] %>"
allow_transactional_writes = true
}
single_cluster_routing {
cluster_id = "<%= ctx[:vars]['instance_name'] %>"
allow_transactional_writes = true
}

ignore_warnings = true
ignore_warnings = true
}
13 changes: 7 additions & 6 deletions templates/terraform/examples/dataproc_autoscaling_policy.tf.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
provider "google-beta" {}
provider "google-beta" {
}

resource "google_dataproc_cluster" "basic" {
provider = "google-beta"
name = "<%= ctx[:vars]['name'] %>"
region = "us-central1"
provider = google-beta
name = "<%= ctx[:vars]['name'] %>"
region = "us-central1"

cluster_config {
autoscaling_config {
Expand All @@ -13,9 +14,9 @@ resource "google_dataproc_cluster" "basic" {
}

resource "google_dataproc_autoscaling_policy" "<%= ctx[:primary_resource_id] %>" {
provider = "google-beta"
provider = google-beta
policy_id = "<%= ctx[:vars]['name'] %>"
location = "us-central1"
location = "us-central1"

worker_config {
max_instances = 3
Expand Down
46 changes: 23 additions & 23 deletions templates/terraform/examples/router_nat_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
resource "google_compute_network" "net" {
name = "<%= ctx[:vars]['network_name'] %>"
name = "<%= ctx[:vars]['network_name'] %>"
}

resource "google_compute_subnetwork" "subnet" {
name = "<%= ctx[:vars]['subnet_name'] %>"
network = google_compute_network.net.self_link
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
name = "<%= ctx[:vars]['subnet_name'] %>"
network = google_compute_network.net.self_link
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
}

resource "google_compute_router" "router"{
name = "<%= ctx[:vars]['router_name'] %>"
region = google_compute_subnetwork.subnet.region
network = google_compute_network.net.self_link
resource "google_compute_router" "router" {
name = "<%= ctx[:vars]['router_name'] %>"
region = google_compute_subnetwork.subnet.region
network = google_compute_network.net.self_link

bgp {
asn = 64514
}
bgp {
asn = 64514
}
}

resource "google_compute_router_nat" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['nat_name'] %>"
router = google_compute_router.router.name
region = google_compute_router.router.region
nat_ip_allocate_option = "AUTO_ONLY"
source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"
log_config {
enable = true
filter = "ERRORS_ONLY"
}
}
name = "<%= ctx[:vars]['nat_name'] %>"
router = google_compute_router.router.name
region = google_compute_router.router.region
nat_ip_allocate_option = "AUTO_ONLY"
source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"

log_config {
enable = true
filter = "ERRORS_ONLY"
}
}
27 changes: 13 additions & 14 deletions templates/terraform/examples/scheduled_query.tf.erb
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
data "google_project" "project" {}
data "google_project" "project" {
}

resource "google_project_iam_member" "permissions" {
role = "roles/iam.serviceAccountShortTermTokenMinter"
role = "roles/iam.serviceAccountShortTermTokenMinter"
member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com"
}

resource "google_bigquery_data_transfer_config" "<%= ctx[:primary_resource_id] %>" {

depends_on = [google_project_iam_member.permissions]

display_name = "<%= ctx[:vars]['display_name'] %>"
location = "asia-northeast1"
data_source_id = "scheduled_query"
schedule = "first sunday of quarter 00:00"
destination_dataset_id = "${google_bigquery_dataset.my_dataset.dataset_id}"
display_name = "<%= ctx[:vars]['display_name'] %>"
location = "asia-northeast1"
data_source_id = "scheduled_query"
schedule = "first sunday of quarter 00:00"
destination_dataset_id = google_bigquery_dataset.my_dataset.dataset_id
params = {
destination_table_name_template = "my-table"
write_disposition = "WRITE_APPEND"
query = "SELECT name FROM tabl WHERE x = 'y'"
write_disposition = "WRITE_APPEND"
query = "SELECT name FROM tabl WHERE x = 'y'"
}
}

resource "google_bigquery_dataset" "my_dataset" {

depends_on = [google_project_iam_member.permissions]

dataset_id = "<%= ctx[:vars]['dataset_id'].delete("-") %>"
dataset_id = "<%= ctx[:vars]['dataset_id'].delete("-") %>"
friendly_name = "foo"
description = "bar"
location = "asia-northeast1"
description = "bar"
location = "asia-northeast1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ resource "google_storage_bucket_access_control" "<%= ctx[:primary_resource_id] %
}

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

0 comments on commit 412c7b1

Please sign in to comment.