Creating an IAM policy for Route 53

An IAM user with a policy scoped to a single Route 53 hosted zone allows external-dns to create, update, and delete records in that zone only.

When you use Route 53, you must create an IAM user with a policy scoped to your specific hosted zone.

  1. Create an IAM policy by using the following structure:
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "route53:GetHostedZone",
            "route53:ListResourceRecordSets",
            "route53:ChangeResourceRecordSets",
            "route53:GetChange"
          ],
          "Resource": [
            "arn:aws:route53:::hostedzone/[***PUBLIC HOSTED ZONE ID***]",
            "arn:aws:route53:::hostedzone/[***PRIVATE HOSTED ZONE ID***]",
            "arn:aws:route53:::change/*"
          ]
        },
        {
          "Effect": "Allow",
          "Action": [
            "route53:ListHostedZones",
            "route53:ListHostedZonesByName"
          ],
          "Resource": "*"
        }
      ]
    }

    Replace the [***PUBLIC HOSTED ZONE ID***] and [***PRIVATE HOSTED ZONE ID***] placeholders with your hosted zone IDs.

  2. Understand the permissions included in the policy:
    • The ChangeResourceRecordSets action covers record creation, upsert, and deletion.
    • The ListHostedZones and ListHostedZonesByName actions require Resource: "*" and enable zone discovery for external-dns.
    • The change/* resource is required to poll the status of record modifications.
  3. Create an IAM user and access key:
    1. Create an IAM user.
    2. Attach the policy created in the previous step.
    3. Create an access key pair and save the access key ID and the secret access key.