Description
An Ansible task that creates or updates a Route 53 record needs a value appropriate to its record type. Without it, the intended DNS change cannot be applied. Distinguish these operations from retrieval tasks that do not need a value.
Potential impact
A deployment interrupted by a missing required value can delay a service transition that depends on the new record or destination.
Remediation
Set value to the intended destination for a creation or update task. A CNAME uses one target domain name. Check the hosted zone, record name and routing settings, then verify the DNS response with dig or nslookup after applying the change.
Examples
This example creates a weighted CNAME record. Replace the domain names and health-check ID with resources you manage.
Before
- name: Use a routing policy to distribute traffic
community.aws.route53:
state: present
zone: foo.com
record: www.foo.com
type: CNAME
value:
ttl: 30
identifier: "host1@www"
weight: 100
health_check: "d994b780-3150-49fd-9205-356abdd42e75"
An empty value: is YAML null, so the value required for creation is missing.
After
value specifies the target name host1.foo.com.
- name: Use a routing policy to distribute traffic
community.aws.route53:
state: present
zone: foo.com
record: www.foo.com
type: CNAME
value: host1.foo.com
ttl: 30
identifier: host1@www
weight: 100
health_check: d994b780-3150-49fd-9205-356abdd42e75