-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to templates/terraform/examples from upgrade012
- Loading branch information
Showing
5 changed files
with
59 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
resource "google_logging_metric" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]["logging_metric_name"] %>" | ||
name = "<%= ctx[:vars]["logging_metric_name"] %>" | ||
filter = "resource.type=gae_app AND severity>=ERROR" | ||
metric_descriptor { | ||
metric_kind = "DELTA" | ||
value_type = "DISTRIBUTION" | ||
unit = "1" | ||
value_type = "DISTRIBUTION" | ||
unit = "1" | ||
labels { | ||
key = "mass" | ||
value_type = "STRING" | ||
description = "amount of matter" | ||
key = "mass" | ||
value_type = "STRING" | ||
description = "amount of matter" | ||
} | ||
} | ||
value_extractor = "EXTRACT(jsonPayload.request)" | ||
label_extractors = { "mass": "EXTRACT(jsonPayload.request)" } | ||
label_extractors = { | ||
"mass" = "EXTRACT(jsonPayload.request)" | ||
} | ||
bucket_options { | ||
linear_buckets { | ||
num_finite_buckets = 3 | ||
width = 1 | ||
offset = 1 | ||
width = 1 | ||
offset = 1 | ||
} | ||
} | ||
} |
14 changes: 8 additions & 6 deletions
14
templates/terraform/examples/logging_metric_counter_labels.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
resource "google_logging_metric" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]["logging_metric_name"] %>" | ||
name = "<%= ctx[:vars]["logging_metric_name"] %>" | ||
filter = "resource.type=gae_app AND severity>=ERROR" | ||
metric_descriptor { | ||
metric_kind = "DELTA" | ||
value_type = "INT64" | ||
value_type = "INT64" | ||
labels { | ||
key = "mass" | ||
value_type = "STRING" | ||
description = "amount of matter" | ||
key = "mass" | ||
value_type = "STRING" | ||
description = "amount of matter" | ||
} | ||
} | ||
label_extractors = { "mass": "EXTRACT(jsonPayload.request)" } | ||
label_extractors = { | ||
"mass" = "EXTRACT(jsonPayload.request)" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
<%#- | ||
WARNING: cidr_block must not overlap with other existing TPU blocks | ||
Make sure if you change this value that it does not overlap with the | ||
autogenerated examples. | ||
WARNING: cidr_block must not overlap with other existing TPU blocks | ||
Make sure if you change this value that it does not overlap with the | ||
autogenerated examples. | ||
-%> | ||
data "google_tpu_tensorflow_versions" "available" { } | ||
|
||
data "google_tpu_tensorflow_versions" "available" { | ||
} | ||
|
||
resource "google_tpu_node" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]["node_name"] %>" | ||
zone = "us-central1-b" | ||
name = "<%= ctx[:vars]["node_name"] %>" | ||
zone = "us-central1-b" | ||
|
||
accelerator_type = "v3-8" | ||
tensorflow_version = "${data.google_tpu_tensorflow_versions.available.versions[0]}" | ||
cidr_block = "10.2.0.0/29" | ||
accelerator_type = "v3-8" | ||
tensorflow_version = data.google_tpu_tensorflow_versions.available.versions[0] | ||
cidr_block = "10.2.0.0/29" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
data "google_tpu_tensorflow_versions" "available" { } | ||
data "google_tpu_tensorflow_versions" "available" { | ||
} | ||
|
||
<%#- | ||
WARNING: cidr_block must not overlap with other existing TPU blocks | ||
Make sure if you change this value that it does not overlap with the | ||
autogenerated examples. | ||
WARNING: cidr_block must not overlap with other existing TPU blocks | ||
Make sure if you change this value that it does not overlap with the | ||
autogenerated examples. | ||
-%> | ||
|
||
resource "google_tpu_node" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]["node_name"] %>" | ||
zone = "us-central1-b" | ||
name = "<%= ctx[:vars]["node_name"] %>" | ||
zone = "us-central1-b" | ||
|
||
accelerator_type = "v3-8" | ||
accelerator_type = "v3-8" | ||
|
||
cidr_block = "10.3.0.0/29" | ||
tensorflow_version = "${data.google_tpu_tensorflow_versions.available.versions[0]}" | ||
cidr_block = "10.3.0.0/29" | ||
tensorflow_version = data.google_tpu_tensorflow_versions.available.versions[0] | ||
|
||
description = "Terraform Google Provider test TPU" | ||
description = "Terraform Google Provider test TPU" | ||
<%#- | ||
We previously used a separate network resource here, but TPUs only allow using 50 | ||
different network names, ever. This caused our tests to start failing, so just | ||
use the default network in order to still demonstrate using as many fields as | ||
possible on the resource. | ||
We previously used a separate network resource here, but TPUs only allow using 50 | ||
different network names, ever. This caused our tests to start failing, so just | ||
use the default network in order to still demonstrate using as many fields as | ||
possible on the resource. | ||
-%> | ||
network = "default" | ||
network = "default" | ||
|
||
labels = { | ||
foo = "bar" | ||
} | ||
labels = { | ||
foo = "bar" | ||
} | ||
|
||
scheduling_config { | ||
preemptible = true | ||
} | ||
scheduling_config { | ||
preemptible = true | ||
} | ||
} |