-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcp-storage.tf
44 lines (42 loc) · 949 Bytes
/
gcp-storage.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
provider "google" {
project = "terraform-354707"
region = "europe-west3"
version = "3.5.0"
}
resource "google_storage_bucket" "state-bucket" {
name = "devopsbucket1"
location = "EU"
versioning {
enabled = true
}
}
terraform {
backend "gcs" {
bucket = "devopsbucket2"
}
}
resource "google_cloud_run_service" "nginx-service" {
name = "nginx-service"
location = "europe-west3"
template {
spec {
containers {
image = "marketplace.gcr.io/google/nginx1"
ports {
container_port = 80
}
}
}
}
traffic {
percent = 100
latest_revision = true
}
}
resource "google_cloud_run_service_iam_member" "member" {
location = google_cloud_run_service.nginx-service.location
project = google_cloud_run_service.nginx-service.project
service = google_cloud_run_service.nginx-service.name
role = "roles/run.invoker"
member = "allUsers"
}