Skip to content

Commit 7aa164d

Browse files
authored
Add files via upload
1 parent e662b07 commit 7aa164d

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Terraform-Module snippet for deploying ASG in private subnet behind ALB
2+
3+
Below is the architecture to be implemented:
4+
![Screenshot from 2021-11-20 15-25-50](https://user-images.githubusercontent.com/21075788/142722126-ea486c98-4e94-4492-9cf8-172456154eae.png)
5+
6+
# Prerequisites:
7+
1. AWS account
8+
2. IAM role with necessary permissions
9+
3. Terraform (Version : 0.12) & AWS CLI configured on machine from which the scripts are to be run
10+
11+
12+
# Modules included are:
13+
14+
In script we are use two module use
15+
- First module is network : for more understand please follow this [link](https://github.com/mehulbudasna/Terraform-Module/blob/main/network/README.md)
16+
- Second module is ec2 : for more understand please follow this [link](https://github.com/mehulbudasna/Terraform-Module/blob/main/ec2/README.md)
17+
18+
# Follow Below Steps to RUN Terraform snippet
19+
20+
1. Create folder and Clone this repo.
21+
2. Change required variable value
22+
3. Initialize terraform using
23+
```bash
24+
terraform init
25+
```
26+
4. Show changes required by the current configuration
27+
```bash
28+
terraform plan
29+
```
30+
5. Create or update infrastructure
31+
```bash
32+
terraform apply
33+
```
34+
Your infra is ready to use now.
35+
36+
6. Destroy previously-created infrastructure
37+
```bash
38+
terraform destroy
39+
```

main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
module "ec2" {
2+
source = "./ec2"
13

4+
}
5+
output "AWS_LB" {
6+
value = module.ec2.lb_address
7+
}

provider.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
provider "aws" {
2+
region = "us-east-1"
3+
}

0 commit comments

Comments
 (0)