Closed mvermaes closed 3 years ago
Files identified in the description:
plugins/modules/route53.py
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/plugins/modules/route53.py)If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @jillr @jimbydamonk @s-hertel @tremble @wimnat click here for bot help
@pjrm Would you be willing to take a look at this one too?
I think the problem is due to list_resource_record_sets()
not returning TTL
or ResourceRecords
in the response when called here. I guess this is due to TTL/ResourceRecords not being relevant for alias resource record sets. From boto3 docs on list_resource_record_sets():
If you're creating or updating an alias resource record set, omit TTL . Amazon Route 53 uses the value of TTL for the alias target. ... If you're creating an alias resource record set, omit ResourceRecords
As a result, aws_record
does not contain TTL/RR here. Then, when resource_record_set
is created in the next line, it includes the TTL/RR values, which causes the comparison with aws_record
to fail.
Removing the TTL/RR keys in the alias_in
conditional seems to resolve the issue:
if alias_in:
...
resource_record_set.pop('TTL', None)
resource_record_set.pop('ResourceRecords', None)
This was resolved by https://github.com/ansible-collections/community.aws/commit/8a2a138dac1b9552b5db7c2a9f888bd75a6effe9 :+1:
SUMMARY
After updating to
community.aws
v1.4.0, using theroute53
module to check an alias record that points to an S3 bucket results in changes being flagged that weren't previously.ISSUE TYPE
COMPONENT NAME
route53
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
[packages] ansible-base = "" boto3 = "" boto = "*"
<our domain>
in example above) configured with an alias record at apex, pointing to an S3 bucket (per AWS docs), and files as per above, run these commands:EXPECTED RESULTS
ACTUAL RESULTS
Reverting to
community.aws
1.3.0 (leavingamazon.aws
on 1.4.0) gets the expected results again.(Edit 20210302: Add boto to Pipfile - inadvertently removed when trying to create minimal Pipfile. Boto is required to run the listed playbook under version 1.3.0)