IAM policy for Route53

Use a least-privilege IAM policy that is scoped to your hosted zone and that also allows Cloudera Cloud Factory to validate the Route53 credential.

Where possible, use a least-privilege policy that is scoped to your hosted zone. The following IAM permission set covers what external-dns and cert-manager (Let's Encrypt DNS-01) need at run time, and what Cloudera Cloud Factory calls when it validates the credential. The same permission set applies to every authentication method. Replace <ZONE_ID> with the ID of your hosted zone.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ExternalDnsChangeRecords",
      "Effect": "Allow",
      "Action": [
        "route53:ChangeResourceRecordSets",
        "route53:ListResourceRecordSets"
      ],
      "Resource": "arn:aws:route53:::hostedzone/<ZONE_ID>"
    },
    {
      "Sid": "CcfValidateAndDiscoverZones",
      "Effect": "Allow",
      "Action": [
        "route53:ListHostedZones",
        "route53:ListHostedZonesByName"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ExternalDnsPollChangeStatus",
      "Effect": "Allow",
      "Action": "route53:GetChange",
      "Resource": "arn:aws:route53:::change/*"
    }
  ]
}
  • ChangeResourceRecordSets and ListResourceRecordSets are scoped to the single hosted zone (<ZONE_ID>). This is the important least-privilege boundary.
  • ListHostedZones and ListHostedZonesByName cannot be scoped to a zone, so you must grant them on *. external-dns uses ListHostedZones. ListHostedZonesByName is used when the credential has no Hosted Zone ID. In that case, Cloudera Cloud Factory uses it to find the zone from the domain when it validates the credential, and cert-manager uses it to find the zone for the DNS-01 challenge.
  • GetChange acts on arn:aws:route53:::change/*, not on the hosted zone ARN. cert-manager uses it to wait until the Let's Encrypt DNS-01 challenge record has propagated. If you scope GetChange to the hosted zone ARN, the permission does not match.

If you enter a Hosted Zone ID in the credential, Cloudera Cloud Factory validates it with ListResourceRecordSets, the same call that external-dns makes. If you do not enter a Hosted Zone ID, Cloudera Cloud Factory and cert-manager look up the zone by domain with ListHostedZonesByName, so you must grant that permission. The route53:GetHostedZone permission is not needed.