Skip to content

Commit

Permalink
added dynamodb toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollo-XIV committed Sep 15, 2024
1 parent 178a976 commit 70e7826
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws-s3-backend/dynamo.tf
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 6 additions & 0 deletions aws-s3-backend/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ variable "approved_arns" {
type = list(string)
}

variable "enable_dyanmodb" {
type = bool
default = true
}

variable "force_destroy" {
type = bool
default = false
Expand All @@ -29,3 +34,4 @@ output "lock_tables" {
output "role_arn" {
value = aws_iam_role.iac_role.arn
}

0 comments on commit 70e7826

Please sign in to comment.