Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A module for creating static websites hosted in S3 and distributed through cloudfront, perfect for use with site generation tools such as Jekyll. The site will be given an SSL certificate generated with ACM and a DNS record in Route53.


module "static_site" {
  source = "git::"

  providers {
    aws.useast1 = "aws.useast1"

  name           = ""
  hosted_zone_id = "${var.hosted_zone_id}"

  tags = {
	  environment = "development"

You need to include the providers block as ACM certificates for cloudfront distributions must be in the US-East-1 region and so needs a different provider that is able to access this region independent of the region chosen for the other resources. More info on using multiple providers for modules can be found in the terraform documentation.


  • name
    The fqdn to be used for the site. Must be available within the given hosted zone. (required)
  • hosted_zone_id
    The id of the route 53 hosted zone to use for DNS records. (required)
  • region
    The S3 region to create the bucket in.
  • tags
    Tags to add to any resources that support them.
  • default_root_object
    The default root object to serve through the cloudfront distibution. e.g. index.html
  • error_404_object
    The object to serve when there is a 404 not found. e.g. /404.html. Note this requires a '/' prefix.


  • bucket_id
    The name of the created S3 bucket. Put your files here.
  • distribution_id
    The ID of the created distibution. Run invalidations on this when updating your website.
You can’t perform that action at this time.