Skip to content

Commit 4c90b6e

Browse files
ludookarpok78
authored andcommitted
Fix permadiff in stage 0 vpc-sc service account, add schemas to hierarchical policy YAML files (GoogleCloudPlatform#2817)
* fix permadiff in stage 0 * add missing schema * update test inventories
1 parent ebaea8c commit 4c90b6e

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

fast/stages/0-bootstrap/automation.tf

+8-11
Original file line numberDiff line numberDiff line change
@@ -328,18 +328,15 @@ module "automation-tf-vpcsc-sa" {
328328
name = var.resource_names["sa-vpcsc"]
329329
display_name = "Terraform stage 1 vpcsc service account."
330330
prefix = var.prefix
331-
# allow SA used by CI/CD workflow to impersonate this SA
331+
# allow security group and SA used by CI/CD workflow to impersonate this SA
332332
iam = {
333-
"roles/iam.serviceAccountTokenCreator" = [
334-
for k, v in local.cicd_repositories :
335-
module.automation-tf-cicd-sa[k].iam_email if v.stage == "vpcsc"
336-
]
337-
}
338-
iam_bindings_additive = {
339-
security_admins = {
340-
member = local.principals["gcp-security-admins"]
341-
role = "roles/iam.serviceAccountTokenCreator"
342-
}
333+
"roles/iam.serviceAccountTokenCreator" = concat(
334+
[local.principals["gcp-security-admins"]],
335+
[
336+
for k, v in local.cicd_repositories :
337+
module.automation-tf-cicd-sa[k].iam_email if v.stage == "vpcsc"
338+
]
339+
)
343340
}
344341
iam_storage_roles = {
345342
(module.automation-tf-output-gcs.name) = ["roles/storage.admin"]

fast/stages/2-networking-a-simple/data/hierarchical-ingress-rules.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# skip boilerplate check
22
---
3-
# Terraform will be unable to decode this file if it does not contain valid YAML
4-
# You can retain `---` (start of the document) to indicate an empty document.
3+
# start of document (---) avoids errors if the file only contains comments
4+
5+
# yaml-language-server: $schema=../schemas/firewall-policy-rules.schema.json
56

67
# allow-admins:
78
# description: Access from the admin subnet to all subnets

fast/stages/2-networking-b-nva/data/hierarchical-ingress-rules.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# skip boilerplate check
22
---
3-
# Terraform will be unable to decode this file if it does not contain valid YAML
4-
# You can retain `---` (start of the document) to indicate an empty document.
3+
# start of document (---) avoids errors if the file only contains comments
4+
5+
# yaml-language-server: $schema=../schemas/firewall-policy-rules.schema.json
56

67
# allow-admins:
78
# description: Access from the admin subnet to all subnets

fast/stages/2-networking-c-separate-envs/data/hierarchical-ingress-rules.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# skip boilerplate check
22
---
3-
# Terraform will be unable to decode this file if it does not contain valid YAML
4-
# You can retain `---` (start of the document) to indicate an empty document.
3+
# start of document (---) avoids errors if the file only contains comments
4+
5+
# yaml-language-server: $schema=../schemas/firewall-policy-rules.schema.json
56

67
# allow-admins:
78
# description: Access from the admin subnet to all subnets

tests/fast/stages/s0_bootstrap/cicd.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ counts:
346346
google_project_service_identity: 7
347347
google_service_account: 12
348348
google_service_account_iam_binding: 12
349-
google_service_account_iam_member: 1
350349
google_storage_bucket: 4
351350
google_storage_bucket_iam_binding: 4
352351
google_storage_bucket_iam_member: 12
@@ -356,4 +355,4 @@ counts:
356355
google_tags_tag_value: 2
357356
local_file: 13
358357
modules: 26
359-
resources: 272
358+
resources: 271

tests/fast/stages/s0_bootstrap/simple.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ counts:
3131
google_project_service_identity: 7
3232
google_service_account: 6
3333
google_service_account_iam_binding: 6
34-
google_service_account_iam_member: 1
3534
google_storage_bucket: 4
3635
google_storage_bucket_iam_binding: 4
3736
google_storage_bucket_iam_member: 6
@@ -41,7 +40,7 @@ counts:
4140
google_tags_tag_value: 2
4241
local_file: 8
4342
modules: 20
44-
resources: 235
43+
resources: 234
4544

4645
outputs:
4746
automation: __missing__

0 commit comments

Comments
 (0)