Description • Pre-requisites • How it works • Tech Stack • Author • License
This project aims to provision a static website using the AWS S3 service and Terraform as a structure-as-code tool. Project characteristics:
- random bucket name creation
- creation of bucket, ACL, website configuration, bucket policy and two objects (index.html and error.html)
Before you begin, you will need to have the following tools installed on your machine: [Terraform] (https://www.terraform.io/) and [Git] (https://git-scm.com). You will need to have a [AWS Account] (https://aws.amazon.com/). In addition, it is good to have an editor to work with the code like [VSCode] (https://code.visualstudio.com/).
1 - Clone this repository.
git clone git@github.com:diogofiaminghi/terraform-static-website.git
2 - You must now configure your AWS Access Keys using the bash terminal.
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3 - Terraform Commands in terraform folder
terraform init
terraform fmt
terraform validate
terraform plan -out=plan.out
terraform apply plan.out
4 - Now, to prove that everything worked, get the 'url' in 'output' and open it in your web browser.
5 - Do not forget to destroy the provisioned structure otherwise you will be able to receive invoices.
terraform destroy
The following tools were used in the construction of the project:
This project is under the license MIT.
Made with love by Diogo Fiaminghi 👋🏽 Get in Touch!