Storing exisitng local Terraform State to Amazon S3

Viewed 1019

Trying to store an existing local terraform state file to the backend state storage S3. But running the terraform apply command throws error "Resource already exists".

Is there a method to successfully sync an existing .tfstate to AWS s3 ?

1 Answers

After you setup the backend configuration code to an S3 bucket in Terraform run this command to push any local terraform state to AWS S3 using:

terraform state push <path to your local state>

Related