Skip to content

A YAML file for quickly creating simple static site infrastructure

License

Notifications You must be signed in to change notification settings

Dermah/aws-cdk-static-site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-cdk-static-site

An AWS CDK module for quickly creating simple static site infrastructure

What

At the moment, this is simply a YAML file that will (given some existing infrastructure) create some infrastructure in your existing AWS account to host a static website. You could deploy a static site on this infrastructure.

One day, this module will be a full on AWS CDK Construct.

The YAML file creates

  • an S3 bucket to host your site files
  • a CloudFront distribution to serve the files from the S3 bucket
    • using an existing ACM Certificate to provide HTTPS
  • a Route 53 Record Set to point your domain to the CloudFront distribution

That's all there is to it!

Prerequisites

You will need

Deploy the stack

Assuming you've set up the prerequisites, grab your

  • Certificate ARN of the certificate you created in the us-east-1 region from the ACM Console
  • Domain Name
  • Hosted Zone ID for your domain name from the Route 53 Console

Then click one of these deploy links to deploy the stack in your chosen region:

Deploy the static site

Assuming you've installed and configured the AWS CLI, you can use the following commands to deploy your static site to the new infrstructure. Substitute:

  • <path-to-static-site-code> with the path to the directory that contains your generated static site
  • <domain-name> to your domain name
aws s3 sync --acl public-read <path-to-static-site-code> s3://<domain-name>

About

A YAML file for quickly creating simple static site infrastructure

Resources

License

Stars

Watchers

Forks

Packages

No packages published