Open khilawar4 opened 4 years ago
create a file in git repo : config.hcl
bucket = "my-s3-bucket-name"
key = "my_s3_path/file_name.tfstate"
region = "us-west-2"
Add below to the top of main.tf in all the places where the .tf plan file needs to be saved in S3 backend.
provider "aws" { region = "${var.region}"}
terraform { backend "s3" {}}
Run below command before running terraform plan
terraform init -backend-config=./env/prd/config.hcl
I would like to work on this. Please specify the templates you want to implement this for.
problem statement Currently we are saving terraform state file in local , we want the feature to start uploading to S3 for better managing these state files.
Describe the solution you'd like let's use S3 plugin or other better solution to start managing terraform files in S3 instead of local.