-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
44 lines (33 loc) · 918 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
#export GOOGLE_APPLICATION_CREDENTIALS="/Users/sgordon/credentials/project1-366201-179592c1146e.json"
# terraform {
# required_version = ">= 1.3"
# required_providers {
# google = ">= 3.3"
# }
# }
provider "google" {
region = "us-central1"
zone = "us-central1-a"
project = "project1-366201"
}
resource "google_cloud_run_v2_service" "default" {
name = "my-tomcat-2023"
location = "us-central1"
template {
containers {
image = "us-central1-docker.pkg.dev/project1-366201/my-tomcat-2023/my-tomcat-image-2023:latest"
}
}
}
resource "google_cloud_run_service_iam_binding" "default" {
location = google_cloud_run_v2_service.default.location
service = google_cloud_run_v2_service.default.name
role = "roles/run.invoker"
members = [
"allUsers"
]
}
output "URL" {
description = "Google Cloud Run Url"
value = google_cloud_run_v2_service.default.uri
}