Configuring DNS with Route53
The DNS naming service is one of the core components of infrastructure management, and Amazon provides an excellent service to host and manage DNS zones. In this recipe, we will learn how to manage DNS in AWS using Salt modules.
How to do it...
Create and edit
/opt/ salt-cookbook/production/aws/dns.sls
to have the following entries:cookbookcname: boto_route53.present: - name: cookbook.salt-cookbook.com. - value: cookbookelb-440144868.us-west- 2.elb.amazonaws.com. - zone: salt-cookbook.com. - ttl: 60 - record_type: CNAME - region: us-west-2 - keyid: <access-key> - key: '<secret-key>'
Apply the state to the Salt master by running the following command:
[root@salt-master ~]# salt 'salt-master' state.sls aws.dns saltenv=production salt-master: ---------- ID: cookbookcname Function: boto_route53.present Name: cookbook.salt-cookbook.com. Result: True Comment...