Skip to content

Commit 7a5a5b0

Browse files
authored
feat: bootstrap no dynamodb table (#156)
1 parent f273fbc commit 7a5a5b0

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

modules/aws-bootstrap/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module "terraform_state" {
3737
resource "aws_dynamodb_table" "terraform_state_lock" {
3838
#checkov:skip=CKV_AWS_28: The terraform state lock is meant to be ephemeral and does not need recovery
3939
#checkov:skip=CKV_AWS_119: The terraform state lock does not hold any sensitive data
40+
count = var.create_dynamodb_table ? 1 : 0
4041
name = var.dynamodb_table_name
4142
hash_key = "LockID"
4243
billing_mode = "PAY_PER_REQUEST"

modules/aws-bootstrap/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ output "state_bucket" {
55

66
output "dynamodb_table" {
77
description = "The name of the dynamo db table"
8-
value = aws_dynamodb_table.terraform_state_lock.id
8+
value = var.create_dynamodb_table ? aws_dynamodb_table.terraform_state_lock[0].id : null
99
}

modules/aws-bootstrap/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ variable "dynamodb_point_in_time_recovery" {
4141
default = false
4242
description = "Point-in-time recovery options"
4343
}
44+
45+
variable "create_dynamodb_table" {
46+
type = bool
47+
default = true
48+
description = "Create DynamoDB table for Terraform state locking"
49+
}

0 commit comments

Comments
 (0)