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

The 'count' value depends on resource attributes that cannot be determined until apply #2

Open
AleksandrTitov opened this issue May 29, 2023 · 0 comments

Comments

@AleksandrTitov
Copy link
Member

module "iam_user" {
  source  = "cloud-labs-infra/iam-user/huaweicloud"
  version = "1.0.0"

  name        = "tst"
  secret_file = "/none"
}

module "swr" {
  source  = "cloud-labs-infra/swr/huaweicloud"
  version = "1.0.0"

  organization_name = "tst"
  permissions = [
    {
      user_id    = module.iam_user.id
      permission = "Write"
    },
  ]
}
Error: Invalid count argument

  on .terraform/modules/swr/main.tf line 18, in resource "huaweicloud_swr_organization_permissions" "main":
  18:   count = length(var.permissions) == 0 ? 0 : 1

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.
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

No branches or pull requests

1 participant