Skip to content

Commit

Permalink
Merge pull request #36 from dod-iac/dynamodb_vars
Browse files Browse the repository at this point in the history
Add new dynamodb vars
  • Loading branch information
eeeady authored Oct 29, 2020
2 parents ebf088e + 4970296 commit 7da6c5a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ module "bootstrap" {
|------|-------------|------|---------|:--------:|
| account\_alias | The desired AWS account alias. | `string` | n/a | yes |
| bucket\_purpose | Name to identify the bucket's purpose | `string` | `"tf-state"` | no |
| dynamodb\_table\_name | Name of the DynamoDB Table for locking Terraform state. | `string` | `"terraform-state-lock"` | no |
| dynamodb\_table\_tags | Tags of the DynamoDB Table for locking Terraform state. | `map(string)` | <pre>{<br> "Automation": "Terraform",<br> "Name": "terraform-state-lock"<br>}</pre> | no |
| log\_name | Log name (for backwards compatibility this can be modified to logs) | `string` | `"log"` | no |
| log\_retention | Log retention of access logs of state bucket. | `number` | `90` | no |
| region | AWS region. | `string` | n/a | yes |
Expand Down
8 changes: 2 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module "terraform_state_bucket_logs" {
#

resource "aws_dynamodb_table" "terraform_state_lock" {
name = "terraform-state-lock"
name = var.dynamodb_table_name
hash_key = "LockID"
read_capacity = 2
write_capacity = 2
Expand All @@ -57,9 +57,5 @@ resource "aws_dynamodb_table" "terraform_state_lock" {
type = "S"
}

tags = {
Name = "terraform-state-lock"
Automation = "Terraform"
}
tags = var.dynamodb_table_tags
}

15 changes: 15 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
variable "dynamodb_table_name" {
description = "Name of the DynamoDB Table for locking Terraform state."
default = "terraform-state-lock"
type = string
}

variable "dynamodb_table_tags" {
description = "Tags of the DynamoDB Table for locking Terraform state."
default = {
Name = "terraform-state-lock"
Automation = "Terraform"
}
type = map(string)
}

variable "region" {
description = "AWS region."
type = string
Expand Down

0 comments on commit 7da6c5a

Please sign in to comment.