Content of first.tf
provider "aws" {
}
Command:-
$ terraform init
Content of first.tf
provider "aws" {
access_key = "AKIAIAR3RTLAJ34Z5GVQ"
secret_key = "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"
region = "ap-south-1"
}
Content of first.tf
provider "aws" {
access_key = "AKIAIAR3RTLAJ34Z5GVQ"
secret_key = "RQbCk7CZM73tMjDOOqKUKw4no05VjQTy3hKmsroE"
region = "ap-south-1"
}
resource "aws_instance" "example" {
ami = "ami-5b673c34"
instance_type = "t2.micro"
}
Command:-
$ terraform plan
$ terraform apply
Content of first.tf
provider "aws" {
access_key = "AKIAIAR3RTLAJ34Z5GVQ"
secret_key = "RQbCk7CZM73tMjDOOqKUKw4no05VjQTy3hKmsroE"
region = "ap-south-1"
resource "aws_instance" "example" {
ami = "ami-5b673c34"
instance_type = "t2.micro"
tags {
Name = "HelloWorld"
}
}
}
Command:-
$ terraform plan
$ terraform apply