Giter Club home page Giter Club logo

s3-static-site-terraform's Introduction

AWS Static Website Terraform Deployment

A Terraform definition to deploy your static website on AWS.

Prerequisites

  1. AWS CLI connected to an AWS account.
  2. Terraform CLI.
  3. A hosted zone in AWS Route53 with the domain name you want to use.

Usage

Create a folder inside the live directory and create a new main.tf file with the following:

module "###YOUR_MODULE_NAME###" {
source = "../../modules/s3-website"

domain_name = "###YOUR_DOMAIN_NAME###"
route53_zone_name = "###YOUR_ROUTE53_ZONE_NAME###"
secret = "###YOUR_SECRET_KEY###"
}

output "website_endpoint" {
value = module.###YOUR_MODULE_NAME###.website_endpoint
}

output "website_domain_name" {
value = module.###YOUR_MODULE_NAME###.website_domain_name
}

Requirements

No requirements.

Resources

Name Type
aws_acm_certificate.cert resource
aws_acm_certificate_validation.cert resource
aws_cloudfront_distribution.cdn resource
aws_iam_access_key.deploy resource
aws_iam_user.deploy resource
aws_iam_user_policy.deploy resource
aws_route53_record.static_site resource
aws_route53_record.validation resource
aws_s3_bucket.redirect resource
aws_s3_bucket.static_site resource
aws_s3_bucket_policy.static_site_policy resource
aws_s3_bucket_website_configuration.redirect resource
aws_s3_bucket_website_configuration.static_site resource

Inputs

Name Description Type Default Required
domain_name DNS name of the website. any n/a yes
route53_zone_name Route53 zone name to use. any n/a yes
secret Secret key any n/a yes

Outputs

Name Description
website_domain_name The public url of this website.
website_endpoint The public url of this website in AWS s3.

NOTE: Manual changes to the README will be overwritten when the documentation is updated. To update the documentation, run terraform-docs -c ./.config/terraform-docs.yml ./modules/s3-website/ && mv ./modules/s3-website/README.md .

s3-static-site-terraform's People

Contributors

ahmedtilal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.