Skip to content

Instantly share code, notes, and snippets.

@inge4pres
Last active October 18, 2016 17: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 inge4pres/597bb9350ff3e9cc43ecb476a10e636b to your computer and use it in GitHub Desktop.
Save inge4pres/597bb9350ff3e9cc43ecb476a10e636b to your computer and use it in GitHub Desktop.
#!/bin/bash
# lego-aws-certificate-automation
# param: CREATE | UPDATE
# CREATE
mkdir -p $HOME/lego
lego --email="your@mail.com" --domains="4pr.es inge.4pr.es" --dns="route53" --path $HOME/lego run
aws iam upload-server-certificate --server-certificate-name cf-inge4pres \
--certificate-body file://$HOME/lego/certificates/4pr.es.crt \
--private-key file://$HOME/lego/certificates/4pr.es.key \
--path /cloudfront/inge4pres/
# UPDATE
lego --email="your@mail.com" --domains="4pr.es inge.4pr.es" --dns="route53" --path $HOME/lego renew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment