For that you have to enable versioning of s3 bucket . let's understand with an example: suppose you created one ec2 instance then again you have created another ec2 instance so if you have versioning enabled then there will be two different object in s3 bucket of .tfstate. everytime you run terraform apply there will be new .tfstate file created. I hope this concept is clear to you thanks for support and keep learning and don't forget to share with your friends..😍
How to store different .tfstate files in s3?
For that you have to enable versioning of s3 bucket .
let's understand with an example: suppose you created one ec2 instance then again you have created another ec2 instance so if you have versioning enabled then there will be two different object in s3 bucket of .tfstate. everytime you run terraform apply there will be new .tfstate file created. I hope this concept is clear to you thanks for support and keep learning and don't forget to share with your friends..😍