-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
48 lines (42 loc) · 886 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
39
40
41
42
43
44
45
46
47
48
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "3.52.0"
}
}
}
provider "google" {
project = var.project
region = var.region
zone = var.zone
}
resource "google_cloud_run_service" "default" {
name = var.project
location = var.location
template {
spec {
containers {
image = var.image
}
}
}
traffic {
percent = 100
latest_revision = true
}
}
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
}