Skip to content

Instantly share code, notes, and snippets.

@alexras
Created November 22, 2017 22:13
Show Gist options
  • Save alexras/eb082a350d8bd72533f7432ce9ead5f7 to your computer and use it in GitHub Desktop.
Save alexras/eb082a350d8bd72533f7432ce9ead5f7 to your computer and use it in GitHub Desktop.
Update LetsEncrypt certs on S3
#!/bin/bash
# Assumes you're running in a virtualenv with
# https://github.com/dlapiduz/certbot-s3front installed
function update_cert
{
BUCKET_NAME=$1
DOMAIN_NAME=$2
DISTRIBUTION_ID=$3
REGION=us-west-1
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_NAME} -d www.${DOMAIN_NAME} \
--config-dir=conf --logs-dir=logs --work-dir=work
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment