Last active
May 2, 2020 17:15
-
-
Save keenan-v1/7bada7bd761aa363e03f9c5c9e34fb24 to your computer and use it in GitHub Desktop.
LetsEncrypt AWS Route53 Auth Hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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