Skip to content

Commit

Permalink
chore: downgrade roles
Browse files Browse the repository at this point in the history
  • Loading branch information
q2w committed Dec 30, 2024
1 parent 6294316 commit e691bf4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions examples/kms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ resource "google_project_service_identity" "secretmanager_identity" {
service = "secretmanager.googleapis.com"
}

resource "time_sleep" "wait_service_identity_propagation" {
depends_on = [google_project_service_identity.secretmanager_identity]
create_duration = "180s"
}

resource "google_kms_crypto_key_iam_member" "sm_sa_encrypter_decrypter" {
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
member = "serviceAccount:${google_project_service_identity.secretmanager_identity.email}"
crypto_key_id = google_kms_crypto_key.crypto_key.id
depends_on = [time_sleep.wait_service_identity_propagation]
}

module "secret-manager" {
Expand Down
4 changes: 3 additions & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ spec:
roles:
- level: Project
roles:
- roles/owner
- roles/secretmanager.admin
- roles/cloudkms.admin
- roles/pubsub.admin
services:
- cloudresourcemanager.googleapis.com
- storage-api.googleapis.com
Expand Down
4 changes: 3 additions & 1 deletion modules/simple-secret/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ spec:
roles:
- level: Project
roles:
- roles/owner
- roles/secretmanager.admin
- roles/cloudkms.admin
- roles/pubsub.admin
services:
- cloudresourcemanager.googleapis.com
- storage-api.googleapis.com
Expand Down
5 changes: 4 additions & 1 deletion test/setup/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

locals {
int_required_roles = [
"roles/owner"
"roles/secretmanager.admin",
"roles/cloudkms.admin",
"roles/pubsub.admin",
"roles/iam.serviceAccountUser"
]
}

Expand Down

0 comments on commit e691bf4

Please sign in to comment.