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...

  1. 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>'
  2. Apply the state to the Salt master by running the following command:
    [root@salt-master ~]# salt 'salt-master' state.sls aws.dns saltenv=production ...

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.