Last active
November 18, 2019 06:06
-
-
Save li0nel/4563f8d909e808169c91a5521569ff10 to your computer and use it in GitHub Desktop.
Creating our Let's Encrypt hook script
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
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
This script works fine -- in my case, errors came down to user error and not reading carefully enough. I think some of the confusion is that it's written for certbot to invoke, not manually and without arguments (hence the invalid XML operation error), and it requires modification to use your domain (as mentioned in article at Hackernoon, hence the mydomain.com related errors). Additionally, you must have Route 53 set up (as mentioned in the article).