Skip to content

Commit 5e59c55

Browse files
author
Arun Lal
committed
Update README file for EC2 Terraform provision.
1 parent 7dcf76b commit 5e59c55

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,44 @@ terraform apply -var-file=../../../vars/dev/rds.tfvars
2727

2828
terraform destroy -var-file=../../../vars/dev/rds.tfvars
2929

30+
## Terraform EC2 Instance Deployment
31+
32+
1. Navigate to the `environment/dev` folder:
33+
34+
```bash
35+
cd environment/dev
36+
```
37+
38+
2. Open the `ec2.tfvars` file and modify it with your desired details. This file contains variables used in the Terraform configuration.
39+
40+
## Deployment
41+
42+
1. Initialize Terraform in the working directory:
43+
44+
```bash
45+
terraform init
46+
```
47+
48+
2. Create an execution plan:
49+
50+
```bash
51+
terraform plan -var-file=../../../vars/dev/ec2.tfvars
52+
```
53+
54+
3. Apply the changes to create the EC2 instance:
55+
56+
```bash
57+
terraform apply -var-file=../../../vars/dev/ec2.tfvars
58+
```
59+
60+
4. To destroy the EC2 instance and associated resources:
61+
62+
```bash
63+
terraform destroy -var-file=../../../vars/dev/ec2.tfvars
64+
```
65+
66+
**Note**: Always review the execution plan (`terraform plan`) before applying changes to avoid unintended modifications.
67+
3068
## Command Reference
3169

3270
Update all outputs:
@@ -39,5 +77,3 @@ Show all outputs:
3977

4078

4179

42-
43-

0 commit comments

Comments
 (0)