Skip to content

Commit

Permalink
Add terraform module to create dynamodb table
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Withers committed Jun 19, 2020
1 parent ccaeb4e commit 37452f5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions terraform/workspace_cleanup/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "aws_dynamodb_table" "workspace_cleanup_table" {
count = local.enabled
name = "WorkspaceCleanup"
billing_mode = "PAY_PER_REQUEST"
hash_key = "WorkspaceName"

attribute {
name = "WorkspaceName"
type = "S"
}

ttl {
attribute_name = "ExpiresTTL"
enabled = true
}

lifecycle {
prevent_destroy = false
}
}
8 changes: 8 additions & 0 deletions terraform/workspace_cleanup/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
variable "enabled" {
default = false
description = "Enable/Disable the module"
}

locals {
enabled = var.enabled ? 1 : 0
}

0 comments on commit 37452f5

Please sign in to comment.