Skip to content

Commit de60a3f

Browse files
feat: Support warm throughput (#106)
Co-authored-by: Anton Babenko <393243+antonbabenko@users.noreply.github.com>
1 parent 04742fb commit de60a3f

File tree

14 files changed

+58
-14
lines changed

14 files changed

+58
-14
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ Users of Terragrunt can achieve similar results by using modules provided in the
6868
| Name | Version |
6969
|------|---------|
7070
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
71-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
71+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.13 |
7272

7373
## Providers
7474

7575
| Name | Version |
7676
|------|---------|
77-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.9 |
77+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.13 |
7878

7979
## Modules
8080

@@ -137,6 +137,7 @@ No modules.
137137
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts | `map(string)` | <pre>{<br/> "create": "10m",<br/> "delete": "10m",<br/> "update": "60m"<br/>}</pre> | no |
138138
| <a name="input_ttl_attribute_name"></a> [ttl\_attribute\_name](#input\_ttl\_attribute\_name) | The name of the table attribute to store the TTL timestamp in | `string` | `""` | no |
139139
| <a name="input_ttl_enabled"></a> [ttl\_enabled](#input\_ttl\_enabled) | Indicates whether ttl is enabled | `bool` | `false` | no |
140+
| <a name="input_warm_throughput"></a> [warm\_throughput](#input\_warm\_throughput) | Sets the number of warm read and write units for the specified table | `any` | `{}` | no |
140141
| <a name="input_write_capacity"></a> [write\_capacity](#input\_write\_capacity) | The number of write units for this table. If the billing\_mode is PROVISIONED, this field should be greater than 0 | `number` | `null` | no |
141142

142143
## Outputs

examples/autoscaling/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.13 |
2424
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2525

2626
## Providers

examples/autoscaling/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.9"
7+
version = ">= 6.13"
88
}
99
random = {
1010
source = "hashicorp/random"

examples/basic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.13 |
2424
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2525

2626
## Providers

examples/basic/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.9"
7+
version = ">= 6.13"
88
}
99
random = {
1010
source = "hashicorp/random"

examples/global-tables/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.13 |
2424
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2525

2626
## Providers
2727

2828
| Name | Version |
2929
|------|---------|
30-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.9 |
31-
| <a name="provider_aws.euwest2"></a> [aws.euwest2](#provider\_aws.euwest2) | >= 6.9 |
30+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.13 |
31+
| <a name="provider_aws.euwest2"></a> [aws.euwest2](#provider\_aws.euwest2) | >= 6.13 |
3232
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3333

3434
## Modules

examples/global-tables/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.9"
7+
version = ">= 6.13"
88
}
99
random = {
1010
source = "hashicorp/random"

examples/s3-import/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.13 |
2424
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2525

2626
## Providers

examples/s3-import/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.9"
7+
version = ">= 6.13"
88
}
99
random = {
1010
source = "hashicorp/random"

main.tf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ resource "aws_dynamodb_table" "this" {
7171
max_write_request_units = try(on_demand_throughput.value.max_write_request_units, null)
7272
}
7373
}
74+
75+
dynamic "warm_throughput" {
76+
for_each = try([global_secondary_index.value.warm_throughput], [])
77+
78+
content {
79+
read_units_per_second = try(warm_throughput.value.read_units_per_second, null)
80+
write_units_per_second = try(warm_throughput.value.write_units_per_second, null)
81+
}
82+
}
7483
}
7584
}
7685

@@ -132,6 +141,15 @@ resource "aws_dynamodb_table" "this" {
132141
}
133142
}
134143

144+
dynamic "warm_throughput" {
145+
for_each = length(var.warm_throughput) > 0 ? [var.warm_throughput] : []
146+
147+
content {
148+
read_units_per_second = try(warm_throughput.value.read_units_per_second, null)
149+
write_units_per_second = try(warm_throughput.value.write_units_per_second, null)
150+
}
151+
}
152+
135153
tags = merge(
136154
var.tags,
137155
{
@@ -215,6 +233,15 @@ resource "aws_dynamodb_table" "autoscaled" {
215233
max_write_request_units = try(on_demand_throughput.value.max_write_request_units, null)
216234
}
217235
}
236+
237+
dynamic "warm_throughput" {
238+
for_each = try([global_secondary_index.value.warm_throughput], [])
239+
240+
content {
241+
read_units_per_second = try(warm_throughput.value.read_units_per_second, null)
242+
write_units_per_second = try(warm_throughput.value.write_units_per_second, null)
243+
}
244+
}
218245
}
219246
}
220247

@@ -275,6 +302,15 @@ resource "aws_dynamodb_table" "autoscaled" {
275302
}
276303
}
277304

305+
dynamic "warm_throughput" {
306+
for_each = length(var.warm_throughput) > 0 ? [var.warm_throughput] : []
307+
308+
content {
309+
read_units_per_second = try(warm_throughput.value.read_units_per_second, null)
310+
write_units_per_second = try(warm_throughput.value.write_units_per_second, null)
311+
}
312+
}
313+
278314
tags = merge(
279315
var.tags,
280316
{

0 commit comments

Comments
 (0)