forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert example templates (part 3) (GoogleCloudPlatform#10391)
- Loading branch information
1 parent
83d80ce
commit 39763f3
Showing
240 changed files
with
9,365 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
mmv1/templates/terraform/examples/go/edgecontainer_cluster.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
resource "google_edgecontainer_cluster" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "edgecontainer_cluster_name"}}" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
|
||
labels = { | ||
my_key = "my_val" | ||
other_key = "other_val" | ||
} | ||
} | ||
|
||
data "google_project" "project" {} |
34 changes: 34 additions & 0 deletions
34
mmv1/templates/terraform/examples/go/edgecontainer_cluster_with_maintenance_window.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
resource "google_edgecontainer_cluster" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "edgecontainer_cluster_name"}}" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
|
||
maintenance_policy { | ||
window { | ||
recurring_window { | ||
window { | ||
start_time = "2023-01-01T08:00:00Z" | ||
end_time = "2023-01-01T17:00:00Z" | ||
} | ||
|
||
recurrence = "FREQ=WEEKLY;BYDAY=SA" | ||
} | ||
} | ||
} | ||
} | ||
|
||
data "google_project" "project" {} |
32 changes: 32 additions & 0 deletions
32
mmv1/templates/terraform/examples/go/edgecontainer_local_control_plane_cluster.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "google_edgecontainer_cluster" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "edgecontainer_cluster_name"}}" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
|
||
external_load_balancer_ipv4_address_pools = ["10.100.0.0-10.100.0.10"] | ||
|
||
control_plane { | ||
local { | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 1 | ||
machine_filter = "machine-name" | ||
shared_deployment_policy = "ALLOWED" | ||
} | ||
} | ||
} | ||
|
||
data "google_project" "project" {} |
32 changes: 32 additions & 0 deletions
32
mmv1/templates/terraform/examples/go/edgecontainer_local_control_plane_cluster.tmpl
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "google_edgecontainer_cluster" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "edgecontainer_cluster_name"}}" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
|
||
external_load_balancer_ipv4_address_pools = ["10.100.0.0-10.100.0.10"] | ||
|
||
control_plane { | ||
local { | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 1 | ||
machine_filter = "machine-name" | ||
shared_deployment_policy = "ALLOWED" | ||
} | ||
} | ||
} | ||
|
||
data "google_project" "project" {} |
40 changes: 40 additions & 0 deletions
40
mmv1/templates/terraform/examples/go/edgecontainer_local_control_plane_node_pool.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
resource "google_edgecontainer_cluster" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "edgecontainer_cluster_name"}}" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
|
||
external_load_balancer_ipv4_address_pools = ["10.100.0.0-10.100.0.10"] | ||
|
||
control_plane { | ||
local { | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 1 | ||
machine_filter = "machine-name" | ||
shared_deployment_policy = "ALLOWED" | ||
} | ||
} | ||
} | ||
|
||
resource "google_edgecontainer_node_pool" "{{$.PrimaryResourceId}}" { | ||
name = "nodepool-1" | ||
cluster = google_edgecontainer_cluster.cluster.name | ||
location = "us-central1" | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 3 | ||
} | ||
|
||
data "google_project" "project" {} |
39 changes: 39 additions & 0 deletions
39
...plates/terraform/examples/go/edgecontainer_local_control_plane_node_pool_internal.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
resource "google_edgecontainer_cluster" "cluster" { | ||
name = "tf-lcp-cluster" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.16.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.17.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
|
||
external_load_balancer_ipv4_address_pools = ["172.17.34.97-172.17.34.99"] | ||
|
||
control_plane { | ||
local { | ||
node_location = "us-central1-edge-den25349" | ||
node_count = 1 | ||
shared_deployment_policy = "ALLOWED" | ||
} | ||
} | ||
} | ||
|
||
resource "google_edgecontainer_node_pool" "{{$.PrimaryResourceId}}" { | ||
name = "nodepool-1" | ||
cluster = google_edgecontainer_cluster.cluster.name | ||
location = "us-central1" | ||
node_location = "us-central1-edge-den25349" | ||
node_count = 1 | ||
} | ||
|
||
data "google_project" "project" {} |
34 changes: 34 additions & 0 deletions
34
mmv1/templates/terraform/examples/go/edgecontainer_node_pool.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
resource "google_edgecontainer_cluster" "cluster" { | ||
name = "default" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
} | ||
|
||
resource "google_edgecontainer_node_pool" "{{$.PrimaryResourceId}}" { | ||
name = "nodepool-1" | ||
cluster = google_edgecontainer_cluster.cluster.name | ||
location = "us-central1" | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 3 | ||
|
||
labels = { | ||
my_key = "my_val" | ||
other_key = "other_val" | ||
} | ||
} | ||
|
||
data "google_project" "project" {} |
51 changes: 51 additions & 0 deletions
51
mmv1/templates/terraform/examples/go/edgecontainer_node_pool_with_cmek.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
resource "google_edgecontainer_cluster" "cluster" { | ||
name = "default" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
} | ||
|
||
resource "google_kms_crypto_key_iam_member" "crypto_key" { | ||
crypto_key_id = google_kms_crypto_key.crypto_key.id | ||
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter" | ||
member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-edgecontainer.iam.gserviceaccount.com" | ||
} | ||
|
||
resource "google_kms_crypto_key" "crypto_key" { | ||
name = "key" | ||
key_ring = google_kms_key_ring.key_ring.id | ||
} | ||
|
||
resource "google_kms_key_ring" "key_ring" { | ||
name = "keyring" | ||
location = "us-central1" | ||
} | ||
|
||
resource "google_edgecontainer_node_pool" "{{$.PrimaryResourceId}}" { | ||
depends_on = [google_kms_crypto_key_iam_member.crypto_key] | ||
|
||
name = "nodepool-1" | ||
cluster = google_edgecontainer_cluster.cluster.name | ||
location = "us-central1" | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 3 | ||
|
||
local_disk_encryption { | ||
kms_key = google_kms_crypto_key.crypto_key.id | ||
} | ||
} | ||
|
||
data "google_project" "project" {} |
47 changes: 47 additions & 0 deletions
47
mmv1/templates/terraform/examples/go/edgecontainer_vpn_connection.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
resource "google_edgecontainer_cluster" "cluster" { | ||
name = "default" | ||
location = "us-central1" | ||
|
||
authorization { | ||
admin_users { | ||
username = "[email protected]" | ||
} | ||
} | ||
|
||
networking { | ||
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"] | ||
services_ipv4_cidr_blocks = ["10.1.0.0/16"] | ||
} | ||
|
||
fleet { | ||
project = "projects/${data.google_project.project.number}" | ||
} | ||
} | ||
|
||
resource "google_edgecontainer_node_pool" "node_pool" { | ||
name = "nodepool-1" | ||
cluster = google_edgecontainer_cluster.cluster.name | ||
location = "us-central1" | ||
node_location = "us-central1-edge-example-edgesite" | ||
node_count = 3 | ||
} | ||
|
||
resource "google_edgecontainer_vpn_connection" "{{$.PrimaryResourceId}}" { | ||
depends_on = [google_edgecontainer_node_pool.node_pool] | ||
name = "vpn-connection-1" | ||
location = "us-central1" | ||
cluster = "projects/${data.google_project.project.number}/locations/us-east1/clusters/${google_edgecontainer_cluster.cluster.name}" | ||
vpc = google_compute_network.vpc.name | ||
enable_high_availability = true | ||
|
||
labels = { | ||
my_key = "my_val" | ||
other_key = "other_val" | ||
} | ||
} | ||
|
||
resource "google_compute_network" "vpc" { | ||
name = "example-vpc" | ||
} | ||
|
||
data "google_project" "project" {} |
12 changes: 12 additions & 0 deletions
12
mmv1/templates/terraform/examples/go/edgenetwork_network.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
resource "google_edgenetwork_network" "{{$.PrimaryResourceId}}" { | ||
network_id = "{{index $.Vars "edgenetwork_network_id"}}" | ||
location = "{{index $.TestEnvVars "location"}}" | ||
zone = "{{index $.TestEnvVars "zone"}}" | ||
description = "Example network." | ||
mtu = 9000 | ||
labels = { | ||
"environment" : "dev" | ||
} | ||
} | ||
|
||
|
20 changes: 20 additions & 0 deletions
20
mmv1/templates/terraform/examples/go/edgenetwork_subnet.tf.tmpl
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
resource "google_edgenetwork_subnet" "{{$.PrimaryResourceId}}" { | ||
subnet_id = "{{index $.Vars "edgenetwork_subnet_id"}}" | ||
location = "{{index $.TestEnvVars "location"}}" | ||
zone = "{{index $.TestEnvVars "zone"}}" | ||
description = "Example subnet." | ||
network = google_edgenetwork_network.example_network.id | ||
ipv4_cidr = ["4.4.4.1/24"] | ||
labels = { | ||
"environment" : "dev" | ||
} | ||
} | ||
|
||
resource "google_edgenetwork_network" "example_network" { | ||
network_id = "{{index $.Vars "edgenetwork_network_id"}}" | ||
location = "{{index $.TestEnvVars "location"}}" | ||
zone = "{{index $.TestEnvVars "zone"}}" | ||
description = "Example network." | ||
mtu = 9000 | ||
} |
Oops, something went wrong.