Created
January 21, 2016 01:35
-
-
Save jimmycuadra/db3bb1b7c6a0d35008e0 to your computer and use it in GitHub Desktop.
letsencrypt.sh hook script for dns-01 challenge using AWS Route 53
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
YOUR_HOSTED_ZONE_HERE="Route53 zone ID" | |
case "$1" in | |
"clean_challenge") | |
altname="$2" | |
challenge_token="$3" | |
keyauth_hook="$4" | |
aws route53 change-resource-record-sets --hosted-zone-id $YOUR_HOSTED_ZONE_HERE --change-batch "{\"Changes\":[{\"Action\":\"DELETE\",\"ResourceRecordSet\":{\"Name\":\"_acme-challenge.${altname}\",\"Type\":\"TXT\",\"TTL\":60,\"ResourceRecords\":[{\"Value\":\"\\\"${keyauth_hook}\\\"\"}]}}]}" | |
;; | |
"deploy_challenge") | |
altname="$2" | |
challenge_token="$3" | |
keyauth_hook="$4" | |
aws route53 change-resource-record-sets --hosted-zone-id $YOUR_HOSTED_ZONE_HERE --change-batch "{\"Changes\":[{\"Action\":\"UPSERT\",\"ResourceRecordSet\":{\"Name\":\"_acme-challenge.${altname}\",\"Type\":\"TXT\",\"TTL\":60,\"ResourceRecords\":[{\"Value\":\"\\\"${keyauth_hook}\\\"\"}]}}]}" | |
sleep 20 | |
;; | |
"deploy_cert") | |
domain="$2" | |
private_key="$3" | |
cert="$4" | |
chain="$5" | |
# NO-OP | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment