Giter VIP home page Giter VIP logo

aws-letsencrypt's Introduction

Note:

  • During execution, any new or updated certificates are immediately uploaded to S3 (see below for setup).
  • To ensure idempotent execution, a md5 check is performed against the ELB assigned to the certificste (retrieved via API) and the certificates residing in the s3 bucket. ELBs with a matching value will then not be touched.
  • This uses the DNS-01 validation method.
  • Lastly, this is a somewhat rushed repo :D ...I'm simply uploading this "as-is" for safekeeping and for others to use/build upon.

SETUP

Requirements

Requires AWS credentials with access to Route53, with permissions to list zones, and to create and delete records in zones.

Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, or Create ~/.aws/credentials file with [default] credentials, or Set AWS_PROFILE to name of credentials entry in ~/.aws/credentials

Included in Repo:

  • dehydrated
  • Requires cli53 (Will be installed automatically if not found)
  • jq (binary included in repo...place it in your PATH and give executable permissions.)

Configuration

Feel free to modify the code to your own setup. It is currently setup for my own personal use, so you will need to modify the script to point to your own s3 bucket. The following is an example of what the directory structure looks like for our preprod environment.

s3://bitbrew-ssl-certificates/preprod/dehydrated/certs/marathon-preprod.bitbrew.com/

Inside the s3://bitbrew-ssl-certificates/preprod/dehydrated/certs/ directory, simply create a folder for every certificate you will need for that environment (see the above example...and note that you may need to upload something to the directory (a blank file will do) in order for the aws cli to see the folder if it is new.

Inside the s3://bitbrew-ssl-certificates/preprod/dehydrated/ directory, upload the files:

  • config
  • dehydrated
  • hook.sh

Run

On any linux box (which has permissions to access s3 and Route53) run the update-certificates.sh file.

Follow the prompts to specify the environment you wish to update/renew.

Any certs that are not ready for renewal will be skipped, otherwise updated (or if it sees a blank folder, it creates a new certificate request). The challenge response is handled automatically.

Once it has finished running, it will upload everything back to the s3 bucket.

For ELB's which are assigned the certificate, they will be automatically discovered and reloaded with the now-updated certificate.

  • To prevent downtime, the new cert is first uploaded as yourCertName-tmp. The ELB is immediately assigned this temporary certificate, after which the old certificate is deleted and replaced with the new certificate. The LB then switches back and the temporary certificate deleted.

aws-letsencrypt's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.