Destination Location: Newly cloned github repository folder in your local desktop terraform-cloud-demo1
Verify locally before commiting to GIT Repository
# Terraform Init
terraform init
# Terraform Validate
terraform validate
# Terraform Plan
terraform plan
Check-In code to Remote Repository
# GIT Status
git status
# Git Local Commit
git add .
git commit -am "TF Files First Commit"# Push to Remote Repository
git push# Verify the same on Remote Repository
https://github.com/<YOUR_GITHUB_ID>/<YOUR_REPO>.git
Step-06: Sign-Up for Terraform Cloud - Free Account & Login
Add Comment: Successfully Provisioned, Verified in AWS
Step-12: Review Terraform State
Go to Workspace -> States
Review the state file
Step-13: Change Number of Instance
Go to Local Desktop -> Local Repo -> c4-ec2-instance.tf -> Change count from 1 to 2
# Change c4-ec2-instance.tf
count = 2
# GIT Status
git status
# Git Local Commit
git add .
git commit -am "Changed EC2 Instances from 1 to 2"# Push to Remote Repository
git push# Verify Terraform Cloud
Go to Workspace -> Runs
Observation:
1) New plan should be queued -> Click on Current Plan and review logs in Full Screen
2) Click on **Confirm and Apply**
3) Add Comment: Approved for new EC2 Instance and Click on **Confirm Plan**
4) Verify Apply Logs in Full Screen
5) Review the update state in Workspace -> States
6) Verify if new EC2 Instance got created
Step-14: Review Workpace Settings
Goto -> Workspace -> Settings
General Settings
Locking
Notifications
Run Triggers
SSH Key
Version Control
Step-15: Destruction and Deletion
Goto -> Workspace -> Settings -> Destruction and Deletion
click on Queue Destroy Plan to delete the resources on cloud