Lab Setup
- Cloud Accounts
- AWS
- Azure
- Windows:
- Chocolatey
- Git Bash: Launch Powershell
choco install git -y
- Mac:
- Visual Studio Code:
- Directly: Refer Here
- Packer:
- Windows:
choco install packer -y
- MAC:
brew install packer
- Windows:
- Terraform
- Windows:
choco install terraform -y
- MAC:
brew install terraform
- Windows:
Concepts to understand in Terraform
- Provider:
- Provider in Terraform will provide underlying interactions and exposes resources and Datasources to Terraform.
- To put it in simple representation Provider is where you want infra to be created
- Resource:
- Infrastructure element which you are creating
- Configuration Language:
-
To create infrastructure in Terraform, we need to learn configuration language
-
Sample Terraform
provider "aws" { access_key = "AKIAIH524E5KGVKCZSIQ" secret_key = "SpQyL9UEbSa5YOyXSk5oGSfAsvi7JLJOJxIdFEYC" region = "us-west-2" } resource "aws_instance" "apache" { ami = "ami-0ec2b1175747b5db9" instance_type = "t2.micro" }
-
Scenario : Hello-World To Infra Provisioning (AWS) to understand what has to be done in terraform.
-
Create a VPC in AWS in mumbai region.
- Manual Steps are:
- IN Terraform:
- Configure Terraform aws provider Refer Here
- Find resource in aws provider to create vpc Refer Here
- Manual Steps are:
-
Create a VNET in Azure in Central US
-
Manual Steps are
- Create a Resource group
- Create a VNET
-
In Terraform, Find a azure provider Refer Here and then find a resource group resource Refer Here and then virtual network resource Refer Here
-