https://github.com/martishin/aws-e2e-terraform-example
Example of using Terraform to provision AWS infrastructure for a website: Route 53, ELB, EC2, S3
https://github.com/martishin/aws-e2e-terraform-example
aws docker ec2 elb networking python route53 s3 terraform
Last synced: 3 months ago
JSON representation
Example of using Terraform to provision AWS infrastructure for a website: Route 53, ELB, EC2, S3
- Host: GitHub
- URL: https://github.com/martishin/aws-e2e-terraform-example
- Owner: martishin
- Created: 2024-07-16T18:36:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T13:38:23.000Z (almost 2 years ago)
- Last Synced: 2025-02-21T15:50:01.810Z (over 1 year ago)
- Topics: aws, docker, ec2, elb, networking, python, route53, s3, terraform
- Language: HCL
- Homepage: https://www.martishin.com/posts/project-aws-terraform-example
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS + Terraform End-to-End Project
Example of using Terraform to provision AWS infrastructure for a simple website:
* Network configuration
* Route 53 DNS configuration
* Elastic Load Balancer
* Multiple EC2 instances
* S3 storage
## Configuration Files
All Terraform configuration files are located in the `infrastructure` folder:
* main.tf: Contains the provider configuration
* variables.tf: Defines the input variables
* outputs.tf: Defines the output variables
* network.tf: Contains network-related resources like VPC, subnets, and route tables
* instances.tf: Contains the EC2 instance configurations
* load_balancer.tf: Configures the Elastic Load Balancer and target groups
* s3.tf: Configures the S3 bucket and policies
* dns.tf: Configures Route 53 DNS settings
## Setup
* Navigate to the `infrastructure` directory
```
cd infrastructure
```
* Create a `terraform.tfvars` file to provide your AWS credentials:
```
echo 'aws_access_key = "{YOUR_ACCESS_KEY}"' >> terraform.tfvars
echo 'aws_secret_key = "{YOUR_SECRET_KEY}"' >> terraform.tfvars
```
Replace {YOUR_ACCESS_KEY} and {YOUR_SECRET_KEY} with your actual AWS access key and secret key
## Usage
* Initialize Terraform:
```
terraform init
```
* Apply the Terraform configuration to provision the infrastructure:
```
terraform apply
```
* Once the process is finished, the address of the load balancer will be shown in the output under `load_balancer_dns`.
* After you are done, de-provision the infrastructure:
```
terraform destroy
```