I am looking for the best practice to create and store my state file in S3 bucket.
- Should I include the creation of S3 bucket along with the infrastructure or
- Create a separate state file for its S3 bucket and a different for the resources.
if it is a different file I also need to store the state file of the s3 bucket created, then in this case I should be creating two s3 buckets one for infrastructure state and other for s3 bucket state file.
Secondly, if remote configuration is set and performing 'terraform destroy' is throwing me an error failed to upload state file: no such bucket found, as the bucket has been destroyed. should i first disable terraform remote config -disable and then run terraform destroy? What's the best practice I should be following?