Terraform Local Backend State Locking guide During Concurrent Runs
I'm integrating two systems and I'm working on a project and hit a roadblock... I'm experiencing an scenario with state locking when trying to run multiple Terraform apply commands concurrently using the local backend. I'm using Terraform v1.3.7, and I've defined my configuration files as follows: ```hcl terraform { backend "local" { path = "terraform.tfstate" } } resource "aws_s3_bucket" "my_bucket" { bucket = "my-unique-bucket-name" acl = "private" } ``` While running two `terraform apply` commands in two different terminal sessions, I get the following behavior in the second session: ``` behavior: behavior acquiring the state lock Lock Info: ID: 123abc... Path: terraform.tfstate Operation: OperationTypeApply Who: user@hostname Version: 1.3.7 Created: 2023-10-03 10:00:00.000000000 +0000 UTC Info: Please make sure no other concurrent operations are running. ``` I've tried waiting for a while, but it seems like the lock doesn't release even after the first apply finishes. I also checked the local file permissions and confirmed that no other Terraform processes are running. Is there a way to manage state locking with local backends, or am I working with limitations inherent to this setup? Would switching to a remote backend like S3 solve this question? Any insights or recommendations would be greatly appreciated. Thanks in advance! Any help would be greatly appreciated! Cheers for any assistance!