Remote BackEnd with AWS-S3
File name : main.tf
resource "local_file" "demo" {
filename = "/root/demo.txt"
content ="This is demo text file"
}
File name : terraform.tf
terraform {
backend "s3" {
bucket = "ssa-bucket20210405-tfstate"
key = "demo/itdept/terraform.tfstate"
region = "us-west-1"
dynamodb_table = "state-locking"
}
}
$ terraform init
$ terraform plan
$ terraform apply
Comments
Post a Comment