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

Invalid count argument #141

Open
muneerahmad799 opened this issue Aug 3, 2024 · 0 comments
Open

Invalid count argument #141

muneerahmad799 opened this issue Aug 3, 2024 · 0 comments
Labels
bug 🐛 An issue with the system

Comments

@muneerahmad799
Copy link

Describe the Bug

I am encountering an "Invalid count argument" error when using the Cloud Posse module for codepipeline. The error occurs in the data "aws_iam_policy_document" "codestar" block.

│ Error: Invalid count argument │ │ on .terraform/modules/codepipeline_frontend/main.tf line 185, in data "aws_iam_policy_document" "codestar": │ 185: count = local.codestar_enabled ? 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.

Expected Behavior

Terraform should be able to evaluate the count argument without errors.

Steps to Reproduce

Steps to Reproduce

  1. Use the Cloud Posse module for codepipeline use the codestar connection ARN.
  2. Set up the module with the necessary variables and resources.
  3. Run terraform plan.

Screenshots

No response

Environment

  • WSL 2 on windows 11

Additional Context

code:
module "codepipeline_frontend" { source = "cloudposse/ecs-codepipeline/aws" codestar_connection_arn = aws_codestarconnections_connection.github_connection.arn branch = var.github_branch repo_name = var.frontend_github_repo_name region = var.region ecs_cluster_name = module.ecs_cluster.cluster_name image_repo_name = var.frontend_github_repo_name repo_owner = var.github_username service_name = "frontend" s3_bucket_force_destroy = true depends_on = [module.ecs_cluster,aws_codestarconnections_connection.github_connection] webhook_enabled = false codestar_output_artifact_format = "CODEBUILD_CLONE_REF" cache_type = "NO_CACHE" }

@muneerahmad799 muneerahmad799 added the bug 🐛 An issue with the system label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

1 participant