-
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.
Move cloudrun sql test to examples (#2790)
Merged PR #2790.
- Loading branch information
1 parent
6b437f4
commit c6509ff
Showing
6 changed files
with
85 additions
and
84 deletions.
There are no files selected for viewing
Submodule terraform
updated
from b848d2 to d6d021
Submodule terraform-beta
updated
from edffb2 to 7611ad
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
33 changes: 33 additions & 0 deletions
33
templates/terraform/examples/cloud_run_service_noauth.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,33 @@ | ||
resource "google_cloud_run_service" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['cloud_run_service_name'] %>" | ||
location = "us-central1" | ||
|
||
metadata { | ||
namespace = "<%= ctx[:test_env_vars]['project'] %>" | ||
} | ||
|
||
template { | ||
spec { | ||
containers { | ||
image = "gcr.io/cloudrun/hello" | ||
} | ||
} | ||
} | ||
} | ||
|
||
data "google_iam_policy" "noauth" { | ||
binding { | ||
role = "roles/run.invoker" | ||
members = [ | ||
"allUsers", | ||
] | ||
} | ||
} | ||
|
||
resource "google_cloud_run_service_iam_policy" "noauth" { | ||
location = google_cloud_run_service.default.location | ||
project = google_cloud_run_service.default.project | ||
service = google_cloud_run_service.default.name | ||
|
||
policy_data = data.google_iam_policy.noauth.policy_data | ||
} |
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_cloud_run_service" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['cloud_run_service_name'] %>" | ||
location = "us-central1" | ||
|
||
metadata { | ||
namespace = "<%= ctx[:test_env_vars]['project'] %>" | ||
} | ||
|
||
template { | ||
spec { | ||
containers { | ||
image = "gcr.io/cloudrun/hello" | ||
} | ||
} | ||
|
||
metadata { | ||
annotations = { | ||
"autoscaling.knative.dev/maxScale" = "1000" | ||
"run.googleapis.com/cloudsql-instances" = "<%= ctx[:test_env_vars]['project'] %>:us-central1:${google_sql_database_instance.instance.name}" | ||
"run.googleapis.com/client-name" = "cloud-console" | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "google_sql_database_instance" "instance" { | ||
name = "<%= ctx[:vars]['cloud_run_sql_name'] %>" | ||
region = "us-east1" | ||
settings { | ||
tier = "D0" | ||
} | ||
} |
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