Git Product home page Git Product logo

nulllogic / terraform-aws-website-static-cloudfront-s3 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 8.62 MB

๐Ÿš€ By using this Terraform module, you can save time and effort in setting up your AWS static website. Its comprehensive Terraform code and thoughtful configuration options allow you to create a reliable, scalable, and performant static website on AWS without any problems.

License: MIT License

HCL 100.00%

terraform-aws-website-static-cloudfront-s3's Introduction

Terraform AWS static website module

Logo

contributors last update forks stars open issues license

The main objective of this module is to leverage the power of AWS services, specifically CloudFront and S3, to host and deliver your static website efficiently and securely. By utilizing Terraform's infrastructure as code capabilities, this project streamlines the deployment process, making it easy for you to set up and manage your AWS static website.

NullLogic

โ”Œ Table of Contents โ”

๐Ÿ—ฏ๏ธ Mandatory

  1. ๐Ÿณ Docker ( download )
  2. ๐Ÿค– AWS account + security keys ( instruction )
    1. aws_access_key_id
    2. aws_secret_access_key

๐Ÿ’ญ๏ธ Optional

  1. Domain, located in Amazon AWS Route53

โš™๏ธ Zero-config, one-minute setup with a single CLI command

๐Ÿ” AWS providers for smooth deployment and certificate generation

โšก Out-of-the-box support for static website

๐Ÿ’ช Future-proof, robust architecture

๐Ÿณ Docker commands under the hood

โœ… Full test coverage

๐Ÿ”’ Additional security headers

By using this project, you can save time and effort in setting up your AWS static website. Its comprehensive Terraform code and thoughtful configuration options allow you to create a reliable, scalable, and performant static website on AWS without any problems.

Feel free to explore the project on GitHub. Happy coding!

1st step:

Download two files main.tf and provider.tf from one of examples directories.

2nd step:

Run one of the following commands inside directory with those two files.
( it will use docker image with HashiCorp with TerraForm application inside)

If you have used AWS CLI already, you can attach keys by running this command:

docker container run -it --rm -v $PWD:/tf -v ~/.aws:/root/.aws --workdir /tf hashicorp/terraform:latest init

If you haven't used AWS CLI, you can pass those keys directly, by running this command: ( don't forget to replace XXXX with your AWS keys )

docker container run -it --rm -e TF_VAR_aws_access_key_id=XXXXXXXX -e TF_VAR_aws_secret_access_key=XXXXXXX -v $PWD:/tf --workdir /tf hashicorp/terraform:latest init

3rd step:

Run the command, that you used previously, but instead of init at the end of the command, write apply

It should look like this :

docker container run -it --rm -v $PWD:/tf -v ~/.aws:/root/.aws --workdir /tf hashicorp/terraform:latest apply

4th step:

Run the command, that you used previously, but instead of apply at the end of the command, write deploy

It should look like this :

docker container run -it --rm -v $PWD:/tf -v ~/.aws:/root/.aws --workdir /tf hashicorp/terraform:latest deploy

5th step:

Profit ! ๐Ÿ’ช


Example 1 -> CloudFront + S3

module "website-static-cloudfront-s3" {
 source  = "nulllogic/website-static-cloudfront-s3/aws"

 tags = {
    Environment = "dev"
    Terraform   = "true"
 }
} 


Example 1
Example 2 -> CloudFront + S3 + Domain

module "website-static-cloudfront-s3" {
  source  = "nulllogic/website-static-cloudfront-s3/aws"

  route53 = {
    domain = "example.com"
  }

  tags = {
     Environment = "dev"
     Terraform   = "true"
  }
} 


Example 2

โ”Œ Contributing โ”

See Contributing

โ”Œ Changelog โ”

See Changelog

โ”Œ License โ”

Licensed under the MIT License

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.