Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'ResourceRecords' when 'AliasTarget' #502

Merged
merged 6 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/502-route53-aliases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- route53 - fixes AWS API error when attempting to create Alias records (https://github.com/ansible-collections/community.aws/issues/434).
14 changes: 13 additions & 1 deletion plugins/modules/route53.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
ttl:
description:
- The TTL, in second, to give the new record.
- Mutually exclusive with I(alias).
default: 3600
type: int
type:
Expand All @@ -55,6 +56,7 @@
alias:
description:
- Indicates if this is an alias record.
- Mutually exclusive with I(ttl).
- Defaults to C(false).
type: bool
alias_hosted_zone_id:
Expand Down Expand Up @@ -99,13 +101,15 @@
have the same combination of DNS name and type, a value that
determines what portion of traffic for the current resource record set
is routed to the associated location.
- Mutually exclusive with I(region) and I(failover).
type: int
region:
description:
- Latency-based resource record sets only Among resource record sets
that have the same combination of DNS name and type, a value that
determines which region this should be associated with for the
latency-based routing
- Mutually exclusive with I(weight) and I(failover).
type: str
health_check:
description:
Expand All @@ -115,6 +119,7 @@
description:
- Failover resource record sets only. Whether this is the primary or
secondary resource record set. Allowed values are PRIMARY and SECONDARY
- Mutually exclusive with I(weight) and I(region).
type: str
choices: ['SECONDARY', 'PRIMARY']
vpc_id:
Expand Down Expand Up @@ -468,7 +473,10 @@ def main():
('state', 'delete', ['value']),
),
# failover, region and weight are mutually exclusive
mutually_exclusive=[('failover', 'region', 'weight')],
mutually_exclusive=[
('failover', 'region', 'weight'),
('alias', 'ttl'),
],
# failover, region and weight require identifier
required_by=dict(
failover=('identifier',),
Expand Down Expand Up @@ -557,6 +565,10 @@ def main():
DNSName=value_in[0],
EvaluateTargetHealth=alias_evaluate_target_health_in
)
if 'ResourceRecords' in resource_record_set:
del resource_record_set['ResourceRecords']
if 'TTL' in resource_record_set:
del resource_record_set['TTL']

# On CAA records order doesn't matter
if type_in == 'CAA':
Expand Down
Loading