Skip to content

0.3.0

Compare
Choose a tag to compare
@joshmyers joshmyers released this 22 Jan 18:33
3b1912e
Remove output splat syntax on nested map attributes (#4)

* Remove output splat syntax on nested map attributes

When initially building this module, it was done piece meal adding the
outputs once the initial apply had been done. apply/plan etc all looked
good after the initial apply. However, there is a bug whereby the splat
output fails when dealing with nested map attributes[1]. This issue was
raised by @igor when an initial plan/apply fails as the below example:

```
module.amq.output.primary_console_url: Resource 'aws_mq_broker.default' does not have attribute 'instances.0.console_url' for variable 'aws_mq_broker.default.*.instances.0.console_url'
```

Removing the splat style syntax resolved this issue, but the splat was
necessary due to the `count` (read: enabled flag) on the `aws_mq_broker`
resource. This “fix” works when `enabled = “true”` but fails when 
`enabled = “false”` as this ends up with a 0 count. It seems that trying
to use the splat syntax and asking for nested attributes (conditionally)
is not possible in current terraform. I think we likely have this issue
in other Terraform modules but don’t hit it as do not often set 
`enabled = “false”`

[1] https://github.com/hashicorp/terraform/issues/17048

* Remove enabled flag for the moment

As we do not have a safe way to disable the module. See 3b36149