How paduartesre/gcp-iam-permissions works
Project type and purpose
• This is an “Infrastructure as Code” (IaC) Terraform solution for Google Cloud Platform.
• Its primary purpose is to manage IAM bindings for user groups on resources like GCS buckets, audit logs, and GCE instances.
• State is stored in a remote Google Cloud Storage (GCS) bucket backend.
File structure
• Top‐level files:
• main.tf – root module invoking submodules (primarily the iam module).
• variables.tf – definitions of inputs for root module.
• outputs.tf – outputs exported by the root module.
• terraform.tfvars – concrete variable values (not shown, but implied).
• main Terraform backend config (likely in main.tf).
• modules/ directory – each subdirectory is a reusable Terraform module for a specific GCP service:
• modules/iam/ – defines IAM role bindings (variables.tf, main.tf, outputs.tf).
• modules/appengine/, bigquery/, cloudbuild/, cloudsql/, etc. – each with its own .tf and variables files ready for future or parallel use.
• The README makes clear the root module currently uses only the iam module to apply different bindings.
README for additional insights
• The README describes three IAM‐binding scenarios implemented by the root module:
1. Read‐only on GCS buckets for a group.
2. Read‐only on audit logs for a group.
3. Full GCE instance management for a group.
• It specifies a remote state backend on GCS with locking for safe concurrent edits.
• Emphasizes Principle of Least Privilege and secure access to the state bucket.
Detail
• Notes on locking, secure backend access, and PoLP.