-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
38 lines (32 loc) · 759 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
provider "google" {
version = "3.5.0"
}
resource "google_cloud_run_service" "default" {
name = var.name
location = var.region
project = var.project
metadata {
annotations = {
"run.googleapis.com/client-name" = "terraform"
}
}
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" {
service = google_cloud_run_service.default.name
location = google_cloud_run_service.default.location
project = google_cloud_run_service.default.project
policy_data = data.google_iam_policy.noauth.policy_data
}