Terraform Basics

 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

7 : Configure AWS CLI

Go to IAM --User -- create an administrative credentials and use it.

C:\Users\sreejith_b>aws configure

AWS Access Key ID [****************FPMZ]: AKIAWVZ2LS7ZIQQ4256N

AWS Secret Access Key [****************bRHl]: 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

Default region name [ap-south-1]: ap-south-2

Default output format [None]:


02-02 -- Terraform Command basics.

# Terraform Settings Block
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      #version = "~> 3.21" # Optional but recommended in production
    }
  }
}

# Provider Block
provider "aws" {
  profile = "default" # AWS Credentials Profile configured on your local desktop terminal  $HOME/.aws/credentials
  region  = "ap-south-1"
}

# Resource Block
resource "aws_instance" "ec2demo" {
  ami           = "ami-074dc0a6f6c764218" # Amazon Linux in us-east-1, update as per your region
  instance_type = "t2.micro"
}



Terraform Basic : 12 Execute Terraform Core Commands


Terraform Configuration : 13 










Comments

Popular posts from this blog

Terraform : AWS : Terraform on AWS with SRE & IaC DevOps | Section 2 : Terraform basics

Terraform : AWS : Terraform on AWS | Section 4: Terraform Input Variables and Datasources

Terraform VPC - on AWS : Three tier architecture design