Skip to content

module.this.id Error #65

@digtl-machine

Description

@digtl-machine

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 broker_name 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:
* [/app/infrastructure-live/dev/ca-central-1/dev/messaging/rabbitmq/.terragrunt-cache/DzpSoeycWeukzz45-SRvPTXf7Qw/aYg6jvKMeoPdWBiN8E8O6YgHPKw] exit status 1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions