Closed taylorsilva closed 10 months ago
I looked at the pre-commit
stuff and it looked like a lot to setup. If you really need me to do it to get the PR in then let me know and I'll make the time. Not feeling it right now because I've already spent a bunch of time troubleshooting this and it's late now 😭
its dynamic because its an optional argument, so removing the dynamic block is not correct.
lets start with an issue and a reproduction
@taylorsilva it should be like this private_dns_enabled = true dns_options = { private_dns_only_for_inbound_resolver_endpoint = true }
like @bryantbiggs said, its optional that is why i put dynamic in the original PR it is also mentioned in the examples https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/examples/complete/main.tf#L107
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
While trying to setup an S3 VPC endpoint I found I could not set
dns_options.private_dns_only_for_inbound_resolver_endpoint
even though this was apparently resolved by https://github.com/terraform-aws-modules/terraform-aws-vpc/pull/1029To see what was going on under the hood, I removed the
try
wrappingprivate_dns_only_for_inbound_resolver_endpoint
and got this error:So this whole thing is already off. Idk why
dns_options.value
is a bool, all I know is it has something to do with thedynamic
block being used here.I noticed the
dynamic
block is not needed. You're only allowed onedns_options
block for theaws_vpc_endpoint
resource: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint#dns_optionsSo I removed the
dynamic
block and updated the value lookups toeach.value.dns_options[]
which now works.For an S3 service, with
dns_options.private_dns_only_for_inbound_resolver_endpoint
set tofalse
, this is the plan it generated:For a resource that did not pass in a
dns_options
, like this:I got this plan:
I think the removal of the
dynamic
block simplifies things now. It's easier to see what's going on. There should be no change for anyone that isn't settingdns_options
as shown by my plan output above.Breaking Changes
None. For VPCE's that I had beforehand, nothing changed for them. Existing setup was respected.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request