Skip to content

Two errors when trying to plan 'Invalid count argument' and 'Incorrect attribute value type' #121

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

goruha
Copy link
Member

@goruha goruha commented Mar 6, 2025

what

  • Fix
│ Error: Invalid count argument
│
│   on .terraform\modules\foo.vpc_flow_logs.s3_log_storage_bucket.aws_s3_bucket\main.tf line 64, in resource "aws_s3_bucket_logging" "default":
│   64:   count  = local.enabled && var.logging != null ? 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.
╵

references

@goruha goruha requested review from a team as code owners March 6, 2025 19:09
@goruha goruha requested review from kevcube and joe-niland March 6, 2025 19:09
@mergify mergify bot added the triage Needs triage label Mar 6, 2025
@goruha
Copy link
Member Author

goruha commented Mar 6, 2025

/terratest

@nitrocode
Copy link
Member

/terratest

@mergify mergify bot removed the triage Needs triage label Mar 21, 2025
@goruha goruha added the major Breaking changes (or first stable release) label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Breaking changes (or first stable release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants