Skip to content

Instantly share code, notes, and snippets.

@kont-noor
Forked from chrisjm/README.md
Created March 3, 2021 11:04
Show Gist options
  • Save kont-noor/8303f8cded92a190861c1d86b4c0b7d2 to your computer and use it in GitHub Desktop.
Save kont-noor/8303f8cded92a190861c1d86b4c0b7d2 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