#provider.tf
provider "aws" {
region = "us-east-1"
access_key = "my-access-key"
secret_key = "my-secret-key"
}
main.tf:
resource "aws_instance" "ec2web3" {
ami = "ami-0d191299f2822b1fa"
instance_type = "t2.micro"
}
terraform {
backend "s3" {
access_key = "xxxxxxxxxxxxxxx"
secret_key = "xxxxxxxxxxxxxxxxxxxxxxx"
region = "us-east-1"
bucket = "kishor-tf-state"
key = "terraform.tfstate"
}
}
#command
terraform init -backend-config="access_key=xxxxxxxxxxxxxxxx"
-backend-config="secret_key=xxxxxxxxxxxxxxxxxx"
No comments:
Post a Comment