diff --git a/aws-s3-backend/dynamo.tf b/aws-s3-backend/dynamo.tf index a00bcf8..ab926fc 100644 --- a/aws-s3-backend/dynamo.tf +++ b/aws-s3-backend/dynamo.tf @@ -1,6 +1,6 @@ # a new AWS DynamoDB table resource resource "aws_dynamodb_table" "locking" { - for_each = toset(var.environments) + for_each = var.enable_dynamodb ? toset(var.environments) : {} name = "${var.prefix}-${each.key}-locktable" hash_key = "LockID" diff --git a/aws-s3-backend/vars.tf b/aws-s3-backend/vars.tf index dd6a0cd..5796ee3 100644 --- a/aws-s3-backend/vars.tf +++ b/aws-s3-backend/vars.tf @@ -13,6 +13,11 @@ variable "approved_arns" { type = list(string) } +variable "enable_dyanmodb" { + type = bool + default = true +} + variable "force_destroy" { type = bool default = false @@ -29,3 +34,4 @@ output "lock_tables" { output "role_arn" { value = aws_iam_role.iac_role.arn } +