Skip to content

Commit ad93b49

Browse files
committed
fix iam
1 parent c59fa3c commit ad93b49

File tree

4 files changed

+23
-39
lines changed

4 files changed

+23
-39
lines changed

terraform/dev/main.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ provider "google" {
1919
}
2020

2121
provider "google-beta" {
22-
project = var.project
23-
region = var.region
22+
project = var.project
23+
region = var.region
2424
}
2525

2626
# Get current Google Cloud access token
@@ -36,12 +36,12 @@ provider "docker" {
3636
}
3737

3838
module "gateway" {
39-
source = "./../modules/api-gateway"
40-
project = var.project
41-
environment = var.environment
42-
region = var.region
43-
service_account_email = var.google_service_account_api_gateway
44-
spec_yaml = <<EOF
39+
source = "./../modules/api-gateway"
40+
project = var.project
41+
environment = var.environment
42+
region = var.region
43+
service_account_email = var.google_service_account_api_gateway
44+
spec_yaml = <<EOF
4545
swagger: "2.0"
4646
info:
4747
title: reports_api_config_dev
@@ -148,15 +148,15 @@ module "endpoints" {
148148

149149
moved {
150150
from = google_api_gateway_api.api
151-
to = module.gateway.google_api_gateway_api.api
151+
to = module.gateway.google_api_gateway_api.api
152152
}
153153

154154
moved {
155155
from = google_api_gateway_api_config.api_config
156-
to = module.gateway.google_api_gateway_api_config.api_config
156+
to = module.gateway.google_api_gateway_api_config.api_config
157157
}
158158

159159
moved {
160160
from = google_api_gateway_gateway.gateway
161-
to = module.gateway.google_api_gateway_gateway.gateway
161+
to = module.gateway.google_api_gateway_gateway.gateway
162162
}

terraform/modules/api-gateway/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
variable "environment" {
22
description = "The 'Environment' that is being created/deployed. Applied as a suffix to many resources."
33
type = string
4-
default = "dev"
4+
default = "dev"
55
}
66
variable "project" {
77
description = "The ID of the project in which the resource belongs. If it is not provided, the provider project is used."

terraform/modules/run-service/main.tf

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ resource "google_cloud_run_v2_service" "service" {
5454
}
5555
}
5656

57-
resource "google_cloudfunctions2_function_iam_member" "variable_service_account_function_invoker" {
58-
project = google_cloud_run_v2_service.service.project
59-
location = google_cloud_run_v2_service.service.location
60-
cloud_function = google_cloud_run_v2_service.service.name
61-
role = "roles/cloudfunctions.invoker"
62-
member = "serviceAccount:${var.service_account_email}"
63-
}
64-
6557
resource "google_cloud_run_v2_service_iam_member" "variable_service_account_run_invoker" {
6658
project = var.project
6759
location = var.region
@@ -70,14 +62,6 @@ resource "google_cloud_run_v2_service_iam_member" "variable_service_account_run_
7062
member = "serviceAccount:${var.service_account_email}"
7163
}
7264

73-
resource "google_cloudfunctions2_function_iam_member" "api_gw_variable_service_account_function_invoker" {
74-
project = google_cloud_run_v2_service.service.project
75-
location = google_cloud_run_v2_service.service.location
76-
cloud_function = google_cloud_run_v2_service.service.name
77-
role = "roles/cloudfunctions.invoker"
78-
member = "serviceAccount:${var.service_account_api_gateway}"
79-
}
80-
8165
resource "google_cloud_run_v2_service_iam_member" "api_gw_variable_service_account_run_invoker" {
8266
project = var.project
8367
location = var.region

terraform/prod/main.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ provider "google" {
1818
}
1919

2020
provider "google-beta" {
21-
project = var.project
22-
region = var.region
21+
project = var.project
22+
region = var.region
2323
}
2424

2525

@@ -38,12 +38,12 @@ provider "docker" {
3838

3939

4040
module "gateway" {
41-
source = "./../modules/api-gateway"
42-
project = var.project
43-
environment = var.environment
44-
region = var.region
45-
service_account_email = var.google_service_account_api_gateway
46-
spec_yaml = <<EOF
41+
source = "./../modules/api-gateway"
42+
project = var.project
43+
environment = var.environment
44+
region = var.region
45+
service_account_email = var.google_service_account_api_gateway
46+
spec_yaml = <<EOF
4747
swagger: "2.0"
4848
info:
4949
title: reports_api_config_prod
@@ -144,15 +144,15 @@ module "endpoints" {
144144

145145
moved {
146146
from = google_api_gateway_api.api
147-
to = module.gateway.google_api_gateway_api.api
147+
to = module.gateway.google_api_gateway_api.api
148148
}
149149

150150
moved {
151151
from = google_api_gateway_api_config.api_config
152-
to = module.gateway.google_api_gateway_api_config.api_config
152+
to = module.gateway.google_api_gateway_api_config.api_config
153153
}
154154

155155
moved {
156156
from = google_api_gateway_gateway.gateway
157-
to = module.gateway.google_api_gateway_gateway.gateway
157+
to = module.gateway.google_api_gateway_gateway.gateway
158158
}

0 commit comments

Comments
 (0)