Skip to content

Commit

Permalink
feat: allow overriding the dynamodb table name (#1016)
Browse files Browse the repository at this point in the history
Signed-off-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: Dan Miller <daniel@cloudposse.com>
  • Loading branch information
nitrocode and milldr committed May 24, 2024
1 parent 138fda9 commit 3fb01a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/dynamodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ No providers.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_dynamodb_table"></a> [dynamodb\_table](#module\_dynamodb\_table) | cloudposse/dynamodb/aws | 0.35.0 |
| <a name="module_dynamodb_table"></a> [dynamodb\_table](#module\_dynamodb\_table) | cloudposse/dynamodb/aws | 0.36.0 |
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../account-map/modules/iam-roles | n/a |
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
Expand Down Expand Up @@ -97,6 +97,7 @@ No resources.
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| <a name="input_stream_view_type"></a> [stream\_view\_type](#input\_stream\_view\_type) | When an item in the table is modified, what information is written to the stream | `string` | `""` | no |
| <a name="input_streams_enabled"></a> [streams\_enabled](#input\_streams\_enabled) | Enable DynamoDB streams | `bool` | `false` | no |
| <a name="input_table_name"></a> [table\_name](#input\_table\_name) | Table name. If provided, the bucket will be created with this name instead of generating the name from the context | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
| <a name="input_ttl_attribute"></a> [ttl\_attribute](#input\_ttl\_attribute) | DynamoDB table TTL attribute | `string` | `""` | no |
Expand Down
3 changes: 2 additions & 1 deletion modules/dynamodb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ locals {

module "dynamodb_table" {
source = "cloudposse/dynamodb/aws"
version = "0.35.0"
version = "0.36.0"

table_name = var.table_name
billing_mode = var.billing_mode
replicas = var.replicas
dynamodb_attributes = var.dynamodb_attributes
Expand Down
6 changes: 6 additions & 0 deletions modules/dynamodb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ variable "autoscaler_tags" {
description = "Additional resource tags for the autoscaler module"
}

variable "table_name" {
type = string
default = null
description = "Table name. If provided, the bucket will be created with this name instead of generating the name from the context"
}

variable "dynamodb_attributes" {
type = list(object({
name = string
Expand Down

0 comments on commit 3fb01a2

Please sign in to comment.