-
-
Save zxkane/e90de06b339f3c9d02ca63edfadbb4c9 to your computer and use it in GitHub Desktop.
request a SSL certificate from Let's Encrpt then upload to AWS IAM for CloudFront usage
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
# install tools | |
pip3 install certbot acme certbot-dns-route53 | |
# | |
export DOMAIN_NAME=clickstream.example.com | |
export CERT_NAME=$DOMAIN_NAME-$(/bin/date +%s) | |
# request fress SSL cert via DNS chanllege | |
certbot certonly --dns-route53 -d $DOMAIN_NAME --email [email protected] --agree-tos --non-interactive --work-dir ./ --logs-dir ./ --config-dir ./ -v | |
# upload cert to IAM | |
aws iam upload-server-certificate --server-certificate-name $CERT_NAME --certificate-body file:/live/$DOMAIN_NAME/cert.pem --private-key file:/live/$DOMAIN_NAME/privkey.pem --certificate-chain file:/live/$DOMAIN_NAME/chain.pem --path /cloudfront/clickstream/ | jq '.ServerCertificateMetadata.ServerCertificateId' --raw-output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment