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.
Add service mesh field to Cloud Run v2 Service (GoogleCloudPlatform#1…
…1502) Co-authored-by: Zhenhua Li <[email protected]>
- Loading branch information
Showing
3 changed files
with
172 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
mmv1/templates/terraform/examples/cloudrunv2_service_mesh.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
resource "google_cloud_run_v2_service" "<%= ctx[:primary_resource_id] %>" { | ||
provider = google-beta | ||
name = "<%= ctx[:vars]['cloud_run_service_name'] %>" | ||
depends_on = [time_sleep.wait_for_mesh] | ||
deletion_protection = false | ||
|
||
location = "us-central1" | ||
launch_stage = "BETA" | ||
|
||
template { | ||
containers { | ||
image = "us-docker.pkg.dev/cloudrun/container/hello" | ||
} | ||
service_mesh { | ||
mesh = google_network_services_mesh.mesh.id | ||
} | ||
} | ||
} | ||
|
||
resource "time_sleep" "wait_for_mesh" { | ||
depends_on = [google_network_services_mesh.mesh] | ||
|
||
create_duration = "1m" | ||
} | ||
|
||
resource "google_network_services_mesh" "mesh" { | ||
provider = google-beta | ||
name = "<%= ctx[:vars]['mesh_name'] %>" | ||
} |
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