Skip to content

Conversation

petemounce
Copy link

@petemounce petemounce commented Mar 28, 2025

With TF_PARALLELISM=80 when applying the tech-foundations bootstrap (ref), it's possible to get an error.

This can occur because the data.google_storage_project_service_account does not exist yet (it is provisioned by the google_project_service in the project-factory module - https://github.com/terraform-google-modules/terraform-google-project-factory/blob/main/modules/project_services/main.tf#L31-L37)


│ Error: Error applying IAM policy for KMS CryptoKey "projects/prj-b-seed-7128/locations/us-central1/keyRings/prj-keyring/cryptoKeys/prj-key": Error setting IAM policy for KMS CryptoKey "projects/prj-b-seed-7128/locations/us-central1/keyRings/prj-keyring/cryptoKeys/prj-key": googleapi: Error 400: Service account [email protected] does not exist., badRequest

│   with module.seed_bootstrap.module.kms[0].google_kms_crypto_key_iam_binding.encrypters[0],
│   on .terraform/modules/seed_bootstrap.kms/main.tf line 89, in resource "google_kms_crypto_key_iam_binding" "encrypters":
│   89: resource "google_kms_crypto_key_iam_binding" "encrypters" {

With `TF_PARALLELISM=80` when applying the bootstrap, it's possible to get an error.

This can occur because the `data.google_storage_project_service_account` does not exist yet (it is provisioned by the `google_project_service` in the project-factory module - https://github.com/terraform-google-modules/terraform-google-project-factory/blob/main/modules/project_services/main.tf#L31-L37)

```console
╷
│ Error: Error applying IAM policy for KMS CryptoKey "projects/prj-b-seed-7128/locations/us-central1/keyRings/prj-keyring/cryptoKeys/prj-key": Error setting IAM policy for KMS CryptoKey "projects/prj-b-seed-7128/locations/us-central1/keyRings/prj-keyring/cryptoKeys/prj-key": googleapi: Error 400: Service account [email protected] does not exist., badRequest
│
│   with module.seed_bootstrap.module.kms[0].google_kms_crypto_key_iam_binding.encrypters[0],
│   on .terraform/modules/seed_bootstrap.kms/main.tf line 89, in resource "google_kms_crypto_key_iam_binding" "encrypters":
│   89: resource "google_kms_crypto_key_iam_binding" "encrypters" {
│
╵
```
@petemounce petemounce requested a review from a team as a code owner March 28, 2025 16:40
@petemounce
Copy link
Author

(Re-running terraform apply allows the resource to be created successfully)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant