Skip to content

Instantly share code, notes, and snippets.

@froi
Last active April 17, 2022 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save froi/d8061a786ebabe8f9e714ccfee684da9 to your computer and use it in GitHub Desktop.
Save froi/d8061a786ebabe8f9e714ccfee684da9 to your computer and use it in GitHub Desktop.
Script to help manage and install Let's Encrypt cert to Cloudfront
#!/usr/bin/env sh
# This code is based on https://eang.it/letsencrypt-with-amazon-cloudfront/
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
bucket_name=""
region=""
distribution_id=""
domain=""
certbot --agree-tos -a certbot-s3front:auth \
--certbot-s3front:auth-s3-bucket ${bucket_name} \
--certbot-s3front:auth-s3-region ${region} \
-i certbot-s3front:installer \
--certbot-s3front:installer-cf-distribution-id ${distribution_id} \
-d ${domain}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment