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

fix: use local to precompute the condition #602

Closed
wants to merge 1 commit into from

Conversation

hectorj2f
Copy link
Member

When using the new logic serivce_account_email in https://github.com/chainguard-dev/mono/actions/runs/11401132104/job/31886045677?pr=20472#step:15:131, I got the following error 😢:


Error: Invalid count argument

  on .terraform/modules/package-update-check.package-update-check/modules/github-bots/main.tf line 2, in resource "google_service_account" "sa":
   2:   count        = var.service_account_email == "" ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.

@hectorj2f hectorj2f self-assigned this Oct 22, 2024
@hectorj2f
Copy link
Member Author

I'm hoping someone can help me with this issue 🙏🏻 .

@hectorj2f
Copy link
Member Author

It seems I am getting the same error regardless of these changes.


Error: Invalid count argument

  on ../../../../terraform/modules/chainguard/github-bots/main.tf line 6, in resource "google_service_account" "sa":
   6:   count        = local.create_service_account ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.

I am closing this PR.

@hectorj2f hectorj2f closed this Oct 22, 2024
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