Skip to content

Instantly share code, notes, and snippets.

@keenan-v1
Last active May 2, 2020 17:15
Show Gist options
  • Save keenan-v1/7bada7bd761aa363e03f9c5c9e34fb24 to your computer and use it in GitHub Desktop.
Save keenan-v1/7bada7bd761aa363e03f9c5c9e34fb24 to your computer and use it in GitHub Desktop.
LetsEncrypt AWS Route53 Auth Hook
# From https://gist.github.com/li0nel/6cae382947e2d1f13ad594a1ef04f7cf
#!/usr/bin/env bash
#!/usr/bin/env bash
aws route53 wait resource-record-sets-changed --id \
$(aws route53 change-resource-record-sets --hosted-zone-id \
"$(aws route53 list-hosted-zones-by-name --dns-name $2. \
--query HostedZones[0].Id --output text)" \
--query ChangeInfo.Id \
--output text \
--change-batch "{ \
\"Changes\": [{ \
\"Action\": \"$1\", \
\"ResourceRecordSet\": { \
\"Name\": \"_acme-challenge.${CERTBOT_DOMAIN}.\", \
\"ResourceRecords\": [{\"Value\": \"\\\"${CERTBOT_VALIDATION}\\\"\"}], \
\"Type\": \"TXT\", \
\"TTL\": 30 \
} \
}] \
}" \
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment