unity-sds / unity-sps

The Unity SDS Processing Service facilitates large-scale data processing for scientific workflows.
Apache License 2.0
2 stars 2 forks source link

Lock Terraform state on S3 #138

Open LucaCinquini opened 2 days ago

LucaCinquini commented 2 days ago

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.