Terraform & AWS foundation
tf_is_tf with just the programmatic access given to it..png)
AWS Provider & Terraform init:
provider.tf file:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
provider "aws" {
region = "ap-south-1"
shared_credentials_file = "~/.aws/credentials"
profile = "tf_is_tf"
}
Run: $ terraform init
AWS VPC:
main.tf file:
resource "aws_vpc" "tf_vpc" {
cidr_block = "10.123.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "dev"
}
}
Run: $ terraform plan
Run: $ terraform apply
Terraform State:
State | Terraform by HashiCorp
The primary purpose of Terraform state is to store bindings between objects in a remote system and resource instances declared in your configuration.