Skip to content

Instantly share code, notes, and snippets.

@chrisjm
Forked from tache/README-SSL-Certificates.md
Last active December 8, 2023 04:00
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save chrisjm/32a782317e377d52cc95fda8777e8dfe to your computer and use it in GitHub Desktop.
Save chrisjm/32a782317e377d52cc95fda8777e8dfe to your computer and use it in GitHub Desktop.
LetsEncrypt, AWS Certificate Manager, and CloudFront

Using LetsEncrypt SSL certificates with AWS Certificate Manager and CloudFront

This is a document for managing LetsEncrypt certificates on AWS using AWS Certificate Manager and configuring on CloudFront using the AWS CLI.

Setup

Follow the instructions to set up the certbot and aws commands on your local machine:

LetsEncrypt

Obtaining the Certificate via certbot

certbot certonly --manual

Follow the instructions. If all goes well, your certificate will be in /etc/letsencrypt/live/<fqdn>, where <fqdn> is the fully-qualified domain name (eg. www.example.com, example.com, etc.)

Amazon Web Services

CloudFront

Import the certificate into IAM:

aws iam upload-server-certificate --server-certificate-name alphaPWServerCertificate --certificate-body file://etc/letsencrypt/live/<fqdn>/cert.pem --private-key file://etc/letsencrypt/live/<fqdn>/privkey.pem --certificate-chain file://etc/letsencrypt/live/<fqdn>/chain.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment