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 mq_application_password #43

Open
albertocapella-blink opened this issue Jan 31, 2022 · 2 comments
Open

Invalid count argument mq_application_password #43

albertocapella-blink opened this issue Jan 31, 2022 · 2 comments
Labels
bug 🐛 An issue with the system

Comments

@albertocapella-blink
Copy link

albertocapella-blink commented Jan 31, 2022

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

│ Error: Invalid count argument
│ 
│   on .terraform/modules/main.mq_broker/main.tf line 42, in resource "random_password" "mq_application_password":
│   42:   count   = local.enabled && ! local.mq_application_password_is_set ? 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

im using the following for random password gen:

resource "random_password" "password" {
  length           = 32
  special          = true
  override_special = "-._~"
}

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: OSX, Debian buster
  • Version Terraform v1.0.1
@albertocapella-blink albertocapella-blink added the bug 🐛 An issue with the system label Jan 31, 2022
@asoutherland-tw
Copy link

I'm facing a similar issue with this module.

If you do not supply the module with application credentials, it will go ahead and create them using random_password but you can only access them via Parameter Store.

I've yet to find a way to create credentials that are portable within my TF, and don't cause this count to flip out.

If you apply your random_password resource in state, and THEN try to create the AMQ resource, it works.

@rarecrumb
Copy link

There should be an easier way to fetch the passwords generated by the module. I'm trying to run some rabbitmqadmin commands after the cluster is up, but in order to do that, I need access to the passwords generated by the module.

The module should expose these as sensitive outputs, or allow users to pass in their own randomly generated passwords.

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

3 participants