When storing the Terraform state on S3, it is recommended that the state file is locked via a DynamoDB table, to prevent concurrent updates. This involves creating a DynamoDB table via Terraform and updating the S3 backend snippet for EKS, Karpenter and SPS. See instructions: https://developer.hashicorp.com/terraform/language/settings/backends/s3
In particular:
Stores the state as a given key in a given bucket on Amazon S3. This backend also supports state locking and consistency checking via Dynamo DB, which can be enabled by setting the dynamodb_table field to an existing DynamoDB table name. A single DynamoDB table can be used to lock multiple remote state files. Terraform generates key names that include the values of the bucket and key variables.
When storing the Terraform state on S3, it is recommended that the state file is locked via a DynamoDB table, to prevent concurrent updates. This involves creating a DynamoDB table via Terraform and updating the S3 backend snippet for EKS, Karpenter and SPS. See instructions: https://developer.hashicorp.com/terraform/language/settings/backends/s3
In particular:
Stores the state as a given key in a given bucket on Amazon S3. This backend also supports state locking and consistency checking via Dynamo DB, which can be enabled by setting the dynamodb_table field to an existing DynamoDB table name. A single DynamoDB table can be used to lock multiple remote state files. Terraform generates key names that include the values of the bucket and key variables.