Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Terraform Module for an Amazon S3 Static Website

License

NotificationsYou must be signed in to change notification settings

conortm/terraform-aws-s3-static-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Module for an Amazon S3 Static Website, fronted by a CloundFront Distribution.

Note: This module "works" but is still in development. SeeTODO section. Also, suggestions welcome!

Features

This module allows forHosting a Static Website on Amazon S3, 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

module"s3-static-website" {source="conortm/s3-static-website/aws"domain_name="www.my-aws-s3-static-website.com"redirects=["my-aws-s3-static-website.com"]secret="SOME_SECRET_MANAGED_OUTSIDE_OF_VERSION_CONTROL"cert_arn="ARN_OF_SSL_CERTIFICATE"zone_id="HOSTED_ZONE_ID"tags={    Foo="Bar"  }}

Inputs

NameDescriptionTypeDefaultRequired
cert_arnARN of the SSL Certificate to use for the Cloudfront Distributionstring-yes
domain_nameDomain name for the website (i.e.www.example.com)string-yes
public_dirDirectory in S3 Bucket from which to serve public files (no leading or trailing slashes)stringpublicno
redirectsA list of domains that should redirect to domain_name (i.e. for redirecting naked domain to www-version)list<list>no
secretA secret string between CloudFront and S3 to control accessstring-yes
tagsA mapping of tags to assign to each resourcemap<map>no
zone_idID of the Route 53 Hosted Zone in which to create an alias record setstring-yes

Outputs

NameDescription
cdn_domain_nameDomain 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.
  • Add more outputs.

[8]ページ先頭

©2009-2025 Movatter.jp