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 when password provide using random_password #71

Open
rajesh6752 opened this issue Oct 19, 2023 · 1 comment
Open
Labels
bug 🐛 An issue with the system

Comments

@rajesh6752
Copy link

Describe the Bug


│ Error: Invalid count argument

│ on .terraform/modules/ac2ui_documentdb_cluster/main.tf line 43, in resource "random_password" "password":
│ 43: count = module.this.enabled && var.master_password != "" ? 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.

Expected Behavior

Terraform plan should be applied without this issue.

Steps to Reproduce

set password to the value of an ssm param, for example:

resource "random_password" "ac2ui_master_password" {
  length  = 8
  special = false
}
master_password  =  random_password.master_password.result

Screenshots

No response

Environment

No response

Additional Context

No response

@rajesh6752 rajesh6752 added the bug 🐛 An issue with the system label Oct 19, 2023
@rajesh6752 rajesh6752 changed the title Invalid count argument when password provide password using random_password Invalid count argument when password provide using random_password Oct 20, 2023
@lays147
Copy link

lays147 commented Nov 16, 2023

I have the same issue.

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

2 participants