📋
SaveYourTime
  • SaveYourTime - Coding Notes
  • Front-End
    • Next.js - Set up with TypeScript
  • Backend
    • Install MySQL on Ubuntu
    • Setup Certbot with route53 on Ubuntu 20.04
    • Configure a Nginx HTTPS Reverse Proxy
    • TypeORM - How to seed data with typeorm-seeding 🔥
  • React Native
    • React Native - Facebook Login
    • React Native - Adding a new Swift file and a Bridge header
  • Tools
    • ESLint
    • Prettier
  • Amazon Web Services
    • AWS - Deploy Next.js Application to AWS S3
    • AWS - Deploy Nest.js Server to Elastic Beanstalk
    • AWS - Setup AWS CloudFront
    • AWS - Configure HTTPS for CloudFront with GoDaddy Domain
    • AWS - Configure HTTPS for Elastic Beanstalk Environments with GoDaddy Domain
    • AWS - Fix Next.js static site hosted on S3 CloudFront routing fails on page reload
    • AWS - Running Puppeteer on AWS EC2
    • AWS - Running Metabase on AWS Elastic Beanstalk
  • GitHub Actions
    • Github - Deploying a React Next.js App to AWS S3 with Github Actions
    • Github - Deploying a Nest.js App to AWS Elastic Beanstalk (Docker Platform) with Github Actions
    • Github - Deploying a Nest.js App to AWS Elastic Beanstalk (Node.js Platform) with Github Actions
  • Others
    • Using Fastlane to automate beta deployments and releases for your iOS and Android apps
    • NodeBB
Powered by GitBook
On this page

Was this helpful?

  1. Backend

Setup Certbot with route53 on Ubuntu 20.04

PreviousInstall MySQL on UbuntuNextConfigure a Nginx HTTPS Reverse Proxy

Last updated 4 years ago

Was this helpful?

Ensure that you have the latest version of snapd

sudo snap install core; sudo snap refresh core

Remove certbot-auto and any Certbot OS packages

sudo apt-get remove certbot

Install Certbot

sudo snap install --classic certbot

Prepare the Certbot command

sudo ln -s /snap/bin/certbot /usr/bin/certbot

Confirm plugin containment level

sudo snap set certbot trust-plugin-with-root=ok

Install correct DNS plugin

sudo snap install certbot-dns-route53

Find your DNS plugin:

Set up credentials

CertbotDnsRoute53Policy
{
    "Version": "2012-10-17",
    "Id": "certbot-dns-route53 sample policy",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "route53:ListHostedZones",
                "route53:GetChange"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Effect" : "Allow",
            "Action" : [
                "route53:ChangeResourceRecordSets"
            ],
            "Resource" : [
                "arn:aws:route53:::hostedzone/YOURHOSTEDZONEID"
            ]
        }
    ]
}

Replace YOURHOSTEDZONEID with your hosted-zone-id

Link Policy to IAM Role and Attach Role to your EC2

Get a certificate

certbot certonly \
  --dns-route53 \
  -d codetorich.com \
  -d *.codetorich.com

Your certificate file would be placed to /etc/letsencrypt/live

https://certbot.eff.org/docs/using.html#dns-plugins
| Certboteff
Logo
Welcome to certbot-dns-route53’s documentation! — certbot-dns-route53 0 documentation
Logo