Static Website on S3 Bucket with Route 53 for DNS – CLI

Static Website on S3 Bucket with Route 53 for DNS – CLI

Last week I posted a generic tutorial on how to create S3 buckets and setup Route 53 so that you can access your static website via the domain. This week lets automate this so we don’t have to go through this mess again and we can simply run a script that is as simple as:

./creates3bucketandroute53.sh domainname.com region
./creates3bucketandroute53.sh legit.fyi eu-central-1

In short here is the execution order of this script

  1. Collects information from the user
  2. Validates the region is correct, and sets the hosted zone ID for the region
  3. Creates the S3 Bucket for the domain
  4. Configures the S3 Bucket
  5. Creates the Hosted Zones in Route53
  6. Creates the resource record sets

The script is available on Github.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.