From ecd0b53c5e195085cd9bd502a7377dc2b18e6acb Mon Sep 17 00:00:00 2001 From: Conor McNamara Date: Mon, 27 Aug 2018 09:34:14 -0600 Subject: [PATCH] Update README --- .editorconfig | 7 ------- README.md | 32 +++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index 88cb251..d55d780 100644 --- a/.editorconfig +++ b/.editorconfig @@ -21,10 +21,3 @@ indent_style = space [*.md] max_line_length = 0 trim_trailing_whitespace = false - -[Makefile] -tab_width = 2 -indent_style = tab - -[COMMIT_EDITMSG] -max_line_length = 0 diff --git a/README.md b/README.md index fe9bb91..e9a7378 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,19 @@ -# AWS S3 Static Website +# AWS S3 Static Website Terraform Module -Terraform Module for an Amazon S3 Static Website. +Terraform Module for an Amazon S3 Static Website, fronted by a CloundFront Distribution. ## Features -TK +This module allows for [Hosting a Static Website on Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html), provisioning the following: + +- S3 Bucket for static public files +- CloudFront Distribution fronting the S3 Bucket +- Route 53 Record Set aliased to the CloudFront Distribution + +It requires (for now?) that the following have been setup outside this module: + +- SSL Certificate +- Route 53 Hosted Zone ## Usage @@ -26,10 +35,23 @@ module "static_website" { ## Inputs -TK +| Name | Description | Type | Default | Required | +|------|-------------|:----:|:-------:|:--------:| +| cert_arn | The ARN of the SSL Certificate to use for this domain | string | - | yes | +| domain_name | Domain name for the S3 Static Website | string | - | yes | +| redirects | Optional list of domains that should redirect to `domain_name` (i.e. for redirecting naked domain to www-version) | list | `` | no | +| secret | Random alphanumeric string for allowing CloudFront Distribution's traffic to S3 | string | - | yes | +| tags | A mapping of tags to assign to each resource (S3 and CloudFront) | map | `` | no | +| zone_id | The Route 53 Zone ID in which to create the record set | string | - | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| cdn_domain_name | Domain name of the Cloudfront Distribution | ## TODO - [ ] Expose more configuration of resources, esp. Cloudfront dist. - [ ] Better way to pass in SSL cert, Hosted Zone ID, etc. -- [ ] Better way to implement Cloudfront-to-S3 access than secret? +- [ ] Add more outputs.