cloudposse / terraform-aws-mq-broker

Terraform module for provisioning an AmazonMQ broker
https://cloudposse.com/accelerate
Apache License 2.0
37 stars 60 forks source link

module.this.id Error #65

Open digtl-machine opened 1 year ago

digtl-machine commented 1 year ago

Describe the Bug

I'm calling terraform-aws-mq-broker v3.1.0 from terragrunt and get the following error on a plan. It looks like the module.this.id has no value and fails the two tests. I read that these modules should be compatible with the terragrunt.

The main.tf line 91 seems to be the issue. broker_name = module.this.id

I'm not sure why the error is being thrown and assume it's related to the fact that the id is only available after the module is applied? What's the fix or what am I doing wrong in trying to use cp modules with terragrunt?

│ Error: expected length of broker_name to be in the range (1 - 50), got │ │ with module.mq_broker.aws_mq_broker.default[0], │ on .terraform/modules/mq_broker/main.tf line 91, in resource "aws_mq_broker" "default": │ 91: broker_name = module.this.id │ ╵ ╷ │ Error: expected value of brokername to match regular expression "^[0-9A-Za-z-]+$", got │ │ with module.mq_broker.aws_mq_broker.default[0], │ on .terraform/modules/mq_broker/main.tf line 91, in resource "aws_mq_broker" "default": │ 91: broker_name = module.this.id │ ╵ Releasing state lock. This may take a few moments... ERRO[0055] Terraform invocation failed in /app/infrastructure-live/dev/ca-central-1/dev/messaging/rabbitmq/.terragrunt-cache/DzpSoeycWeukzz45-SRvPTXf7Qw/aYg6jvKMeoPdWBiN8E8O6YgHPKw prefix=[dev/ca-central-1/dev/messaging/rabbitmq] ERRO[0055] 1 error occurred:

Expected Behavior

Module applies without error

Steps to Reproduce

Use the module with terragrunt version v0.48.3 based on the examples/complete.

Screenshots

No response

Environment

terragrunt version v0.48.3 Terraform v1.5.4 on linux_amd64

Additional Context

No response

serban-nicusor-toptal commented 7 months ago

^--- this is still an issue with Terragrunt.