TERRAFORM INITIALIZATION:
In this blog post, we learn about how to connect with AWS API through terraform and test on EC2 instances using HCL.
Note the initial stage of AWS CLOUD.
Get the security credentials for Terraform login file configuration.
This is the path where I store my main project “main.tf” file.
#Configuration needs to use for connectivity with AWS API.
provider "aws" {
region = "us-east-1"
access_key = "AKIAYLT72WWPRMQI6ZFJ"
secret_key = "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"
}
#Configuration for EC2 instance creation.
resource "aws_instance" "EC2-1" {
ami = "ami-03f65b8614a860c29
instance_type = "t2.micro"
tags = {
Name = "EC2-1"
}
}
#This is how the way code looks like.
#terraform plugin installation.
#terraform plan command provide us with the possible successful execution of resources on AWS.
#Verification of terraform apply.
—
No comments:
Post a Comment