Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checklist attribution bucket #2000

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion fast/stages/0-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ The `fast_features` variable consists of 4 toggles:
|---|---|---|---|
| [automation.tf](./automation.tf) | Automation project and resources. | <code>gcs</code> · <code>iam-service-account</code> · <code>project</code> | |
| [billing.tf](./billing.tf) | Billing export project and dataset. | <code>bigquery-dataset</code> · <code>project</code> | <code>google_billing_account_iam_member</code> |
| [checklist.tf](./checklist.tf) | None | | |
| [checklist.tf](./checklist.tf) | None | <code>gcs</code> | <code>google_storage_bucket_object</code> |
| [cicd.tf](./cicd.tf) | Workload Identity Federation configurations for CI/CD. | <code>iam-service-account</code> · <code>source-repository</code> | |
| [identity-providers.tf](./identity-providers.tf) | Workload Identity Federation provider definitions. | | <code>google_iam_workload_identity_pool</code> · <code>google_iam_workload_identity_pool_provider</code> |
| [log-export.tf](./log-export.tf) | Audit log project and sink. | <code>bigquery-dataset</code> · <code>gcs</code> · <code>logging-bucket</code> · <code>project</code> · <code>pubsub</code> | |
Expand Down
33 changes: 33 additions & 0 deletions fast/stages/0-bootstrap/checklist.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ locals {
]))
location = try(local._cl_data.logging.sinks[0].destination.location, null)
}
uses_checklist = (
var.factories_config.checklist_data != null
||
var.factories_config.checklist_org_iam != null
)
}

check "checklist" {
Expand Down Expand Up @@ -120,3 +125,31 @@ check "checklist" {
error_message = "Checklist org IAM organization id mismatch, file ignored."
}
}

# checklist files bucket

module "automation-tf-checklist-gcs" {
source = "../../../modules/gcs"
count = local.uses_checklist ? 1 : 0
project_id = module.automation-project.project_id
name = "iac-core-checklist-0"
prefix = local.prefix
location = local.locations.gcs
storage_class = local.gcs_storage_class
versioning = true
depends_on = [module.organization]
}

resource "google_storage_bucket_object" "checklist_data" {
count = var.factories_config.checklist_data != null ? 1 : 0
bucket = module.automation-tf-checklist-gcs.0.name
name = "checklist/data.tfvars.json"
source = var.factories_config.checklist_data
}

resource "google_storage_bucket_object" "checklist_org_iam" {
count = var.factories_config.checklist_org_iam != null ? 1 : 0
bucket = module.automation-tf-checklist-gcs.0.name
name = "checklist/org-iam.tfvars.json"
source = var.factories_config.checklist_org_iam
}
12 changes: 6 additions & 6 deletions tests/fast/stages/s0_bootstrap/checklist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ values:
member: group:gcp-security-admins@fast.example.com
org_id: '123456789012'
role: roles/logging.privateLogViewer
? module.organization.google_organization_iam_member.bindings["roles/monitoring.admin-group:gcp-monitoring-admins@fast-onboarding-0.joonix.net"]
? module.organization.google_organization_iam_member.bindings["roles/monitoring.admin-group:gcp-monitoring-admins@fast.example.com"]
: condition: []
member: group:gcp-monitoring-admins@fast-onboarding-0.joonix.net
member: group:gcp-monitoring-admins@fast.example.com
org_id: '123456789012'
role: roles/monitoring.admin
? module.organization.google_organization_iam_member.bindings["roles/orgpolicy.policyAdmin-group:gcp-organization-admins@fast.example.com"]
Expand Down Expand Up @@ -372,12 +372,12 @@ counts:
google_project_service_identity: 3
google_service_account: 4
google_service_account_iam_binding: 2
google_storage_bucket: 3
google_storage_bucket: 4
google_storage_bucket_iam_binding: 2
google_storage_bucket_iam_member: 4
google_storage_bucket_object: 7
google_storage_bucket_object: 9
google_storage_project_service_account: 3
google_tags_tag_key: 1
google_tags_tag_value: 1
modules: 15
resources: 174
modules: 16
resources: 177
58 changes: 29 additions & 29 deletions tests/fast/stages/s0_bootstrap/data/checklist-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
},
"access_control": [
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -414,7 +414,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -426,7 +426,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -438,7 +438,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -450,7 +450,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -462,7 +462,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -474,7 +474,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -486,7 +486,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -498,7 +498,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -510,7 +510,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -522,7 +522,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -534,7 +534,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -546,7 +546,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -558,7 +558,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -570,7 +570,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -582,7 +582,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -594,7 +594,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -606,7 +606,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -618,7 +618,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -630,7 +630,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -642,7 +642,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -654,7 +654,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -666,7 +666,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -678,7 +678,7 @@
}
},
{
"principal": "group:gcp-developers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-developers@fast.example.com",
"group_id": "DEVELOPERS",
"role": [
"roles/compute.instanceAdmin.v1",
Expand All @@ -690,7 +690,7 @@
}
},
{
"principal": "group:gcp-logging-viewers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-logging-viewers@fast.example.com",
"group_id": "LOGGING_VIEWERS",
"role": [
"roles/logging.viewer",
Expand All @@ -700,11 +700,11 @@
],
"resource": {
"type": "ORGANIZATION",
"id": "656131167402"
"id": "123456789012"
}
},
{
"principal": "group:gcp-logging-viewers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-logging-viewers@fast.example.com",
"group_id": "LOGGING_VIEWERS",
"role": [
"roles/logging.viewer",
Expand All @@ -718,7 +718,7 @@
}
},
{
"principal": "group:gcp-logging-viewers@fast-onboarding-0.joonix.net",
"principal": "group:gcp-logging-viewers@fast.example.com",
"group_id": "LOGGING_VIEWERS",
"role": [
"roles/logging.viewer",
Expand All @@ -731,7 +731,7 @@
}
},
{
"principal": "group:gcp-security-admins@fast-onboarding-0.joonix.net",
"principal": "group:gcp-security-admins@fast.example.com",
"group_id": "SECURITY_ADMINS",
"role": [
"roles/bigquery.dataViewer"
Expand Down