generated from remorses/python-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
73 lines (57 loc) · 1.79 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
terraform {
backend "gcs" {
bucket = "example_shit_1"
prefix = "terraform_states/cloudrun-compose"
credentials = "/Users/morse/Documents/GitHub/cloudrun-compose/account.json"
}
}
provider "google-beta" {
credentials = file("/Users/morse/Documents/GitHub/cloudrun-compose/account.json")
project = "molten-enigma-261612"
region = "us-central1"
}
provider "google" {
credentials = file("/Users/morse/Documents/GitHub/cloudrun-compose/account.json")
project = "molten-enigma-261612"
region = "us-central1"
}
data "google_iam_policy" "noauth" {
binding {
role = "roles/run.invoker"
members = [
"allUsers",
]
}
}
resource "google_cloud_run_service" "cloudrun-composeexample-cloudrun-compose" {
provider = google-beta
name = "cloudrun-composeexample-cloudrun-compose"
location = "us-central1"
metadata {
namespace = "molten-enigma-261612"
}
template {
spec {
containers {
image = "gcr.io/cloudrun/hello"
env {
name = "URL_0"
value = "http://mongoke/"
}
env {
name = "URL_1"
value = "http://server"
}
}
}
}
}
output "cloudrun-composeexample-cloudrun-compose_service_url" {
value = "${google_cloud_run_service.cloudrun-composeexample-cloudrun-compose.status[0].url}"
}
resource "google_cloud_run_service_iam_policy" "cloudrun-composeexample-cloudrun-compose_noauth" {
location = google_cloud_run_service.cloudrun-composeexample-cloudrun-compose.location
project = google_cloud_run_service.cloudrun-composeexample-cloudrun-compose.project
service = google_cloud_run_service.cloudrun-composeexample-cloudrun-compose.name
policy_data = data.google_iam_policy.noauth.policy_data
}