2
votes

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

1 Answers

1
votes

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>