Skip to content

Commit bc4f070

Browse files
authored
feat: Added outputs for Table replicas attributes (#114)
1 parent bc9cfd5 commit bc4f070

File tree

12 files changed

+135
-37
lines changed

12 files changed

+135
-37
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.103.0
3+
rev: v1.104.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,12 @@ No modules.
147147
|------|-------------|
148148
| <a name="output_dynamodb_table_arn"></a> [dynamodb\_table\_arn](#output\_dynamodb\_table\_arn) | ARN of the DynamoDB table |
149149
| <a name="output_dynamodb_table_id"></a> [dynamodb\_table\_id](#output\_dynamodb\_table\_id) | ID of the DynamoDB table |
150-
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream. Only available when var.stream\_enabled is true |
151-
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream\_enabled is true |
150+
| <a name="output_dynamodb_table_replica_arns"></a> [dynamodb\_table\_replica\_arns](#output\_dynamodb\_table\_replica\_arns) | Map of the Table replicas ARNs |
151+
| <a name="output_dynamodb_table_replica_stream_arns"></a> [dynamodb\_table\_replica\_stream\_arns](#output\_dynamodb\_table\_replica\_stream\_arns) | Map of the Table replicas stream ARNs |
152+
| <a name="output_dynamodb_table_replica_stream_labels"></a> [dynamodb\_table\_replica\_stream\_labels](#output\_dynamodb\_table\_replica\_stream\_labels) | Map of the timestamps of the Table replicas stream |
153+
| <a name="output_dynamodb_table_replicas"></a> [dynamodb\_table\_replicas](#output\_dynamodb\_table\_replicas) | Map of Table replicas by region |
154+
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream |
155+
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream |
152156
<!-- END_TF_DOCS -->
153157

154158
## Authors

examples/autoscaling/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ No inputs.
5252
|------|-------------|
5353
| <a name="output_dynamodb_table_arn"></a> [dynamodb\_table\_arn](#output\_dynamodb\_table\_arn) | ARN of the DynamoDB table |
5454
| <a name="output_dynamodb_table_id"></a> [dynamodb\_table\_id](#output\_dynamodb\_table\_id) | ID of the DynamoDB table |
55-
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream. Only available when var.stream\_enabled is true |
56-
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream\_enabled is true |
55+
| <a name="output_dynamodb_table_replica_arns"></a> [dynamodb\_table\_replica\_arns](#output\_dynamodb\_table\_replica\_arns) | Map of the Table replicas ARNs |
56+
| <a name="output_dynamodb_table_replica_stream_arns"></a> [dynamodb\_table\_replica\_stream\_arns](#output\_dynamodb\_table\_replica\_stream\_arns) | Map of the Table replicas stream ARNs |
57+
| <a name="output_dynamodb_table_replica_stream_labels"></a> [dynamodb\_table\_replica\_stream\_labels](#output\_dynamodb\_table\_replica\_stream\_labels) | Map of the timestamps of the Table replicas stream |
58+
| <a name="output_dynamodb_table_replicas"></a> [dynamodb\_table\_replicas](#output\_dynamodb\_table\_replicas) | Map of Table replicas by region |
59+
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream |
60+
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream |
5761
<!-- END_TF_DOCS -->

examples/autoscaling/outputs.tf

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,31 @@ output "dynamodb_table_id" {
99
}
1010

1111
output "dynamodb_table_stream_arn" {
12-
description = "The ARN of the Table Stream. Only available when var.stream_enabled is true"
12+
description = "The ARN of the Table Stream"
1313
value = module.dynamodb_table.dynamodb_table_stream_arn
1414
}
1515

1616
output "dynamodb_table_stream_label" {
17-
description = "A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream_enabled is true"
17+
description = "A timestamp, in ISO 8601 format of the Table Stream"
1818
value = module.dynamodb_table.dynamodb_table_stream_label
1919
}
20+
21+
output "dynamodb_table_replicas" {
22+
description = "Map of Table replicas by region"
23+
value = module.dynamodb_table.dynamodb_table_replicas
24+
}
25+
26+
output "dynamodb_table_replica_arns" {
27+
description = "Map of the Table replicas ARNs"
28+
value = module.dynamodb_table.dynamodb_table_replica_arns
29+
}
30+
31+
output "dynamodb_table_replica_stream_arns" {
32+
description = "Map of the Table replicas stream ARNs"
33+
value = module.dynamodb_table.dynamodb_table_replica_stream_arns
34+
}
35+
36+
output "dynamodb_table_replica_stream_labels" {
37+
description = "Map of the timestamps of the Table replicas stream"
38+
value = module.dynamodb_table.dynamodb_table_replica_stream_labels
39+
}

examples/basic/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ No inputs.
5252
|------|-------------|
5353
| <a name="output_dynamodb_table_arn"></a> [dynamodb\_table\_arn](#output\_dynamodb\_table\_arn) | ARN of the DynamoDB table |
5454
| <a name="output_dynamodb_table_id"></a> [dynamodb\_table\_id](#output\_dynamodb\_table\_id) | ID of the DynamoDB table |
55-
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream. Only available when var.stream\_enabled is true |
56-
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream\_enabled is true |
55+
| <a name="output_dynamodb_table_replica_arns"></a> [dynamodb\_table\_replica\_arns](#output\_dynamodb\_table\_replica\_arns) | Map of the Table replicas ARNs |
56+
| <a name="output_dynamodb_table_replica_stream_arns"></a> [dynamodb\_table\_replica\_stream\_arns](#output\_dynamodb\_table\_replica\_stream\_arns) | Map of the Table replicas stream ARNs |
57+
| <a name="output_dynamodb_table_replica_stream_labels"></a> [dynamodb\_table\_replica\_stream\_labels](#output\_dynamodb\_table\_replica\_stream\_labels) | Map of the timestamps of the Table replicas stream |
58+
| <a name="output_dynamodb_table_replicas"></a> [dynamodb\_table\_replicas](#output\_dynamodb\_table\_replicas) | Map of Table replicas by region |
59+
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream |
60+
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream |
5761
<!-- END_TF_DOCS -->

examples/basic/outputs.tf

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,31 @@ output "dynamodb_table_id" {
99
}
1010

1111
output "dynamodb_table_stream_arn" {
12-
description = "The ARN of the Table Stream. Only available when var.stream_enabled is true"
12+
description = "The ARN of the Table Stream"
1313
value = module.dynamodb_table.dynamodb_table_stream_arn
1414
}
1515

1616
output "dynamodb_table_stream_label" {
17-
description = "A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream_enabled is true"
17+
description = "A timestamp, in ISO 8601 format of the Table Stream"
1818
value = module.dynamodb_table.dynamodb_table_stream_label
1919
}
20+
21+
output "dynamodb_table_replicas" {
22+
description = "Map of Table replicas by region"
23+
value = module.dynamodb_table.dynamodb_table_replicas
24+
}
25+
26+
output "dynamodb_table_replica_arns" {
27+
description = "Map of the Table replicas ARNs"
28+
value = module.dynamodb_table.dynamodb_table_replica_arns
29+
}
30+
31+
output "dynamodb_table_replica_stream_arns" {
32+
description = "Map of the Table replicas stream ARNs"
33+
value = module.dynamodb_table.dynamodb_table_replica_stream_arns
34+
}
35+
36+
output "dynamodb_table_replica_stream_labels" {
37+
description = "Map of the timestamps of the Table replicas stream"
38+
value = module.dynamodb_table.dynamodb_table_replica_stream_labels
39+
}

examples/global-tables/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2828
| Name | Version |
2929
|------|---------|
3030
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.22 |
31-
| <a name="provider_aws.euwest2"></a> [aws.euwest2](#provider\_aws.euwest2) | >= 6.22 |
3231
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3332

3433
## Modules
@@ -55,6 +54,10 @@ No inputs.
5554
|------|-------------|
5655
| <a name="output_dynamodb_table_arn"></a> [dynamodb\_table\_arn](#output\_dynamodb\_table\_arn) | ARN of the DynamoDB table |
5756
| <a name="output_dynamodb_table_id"></a> [dynamodb\_table\_id](#output\_dynamodb\_table\_id) | ID of the DynamoDB table |
58-
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream. Only available when var.stream\_enabled is true |
59-
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream\_enabled is true |
57+
| <a name="output_dynamodb_table_replica_arns"></a> [dynamodb\_table\_replica\_arns](#output\_dynamodb\_table\_replica\_arns) | Map of the Table replicas ARNs |
58+
| <a name="output_dynamodb_table_replica_stream_arns"></a> [dynamodb\_table\_replica\_stream\_arns](#output\_dynamodb\_table\_replica\_stream\_arns) | Map of the Table replicas stream ARNs |
59+
| <a name="output_dynamodb_table_replica_stream_labels"></a> [dynamodb\_table\_replica\_stream\_labels](#output\_dynamodb\_table\_replica\_stream\_labels) | Map of the timestamps of the Table replicas stream |
60+
| <a name="output_dynamodb_table_replicas"></a> [dynamodb\_table\_replicas](#output\_dynamodb\_table\_replicas) | Map of Table replicas by region |
61+
| <a name="output_dynamodb_table_stream_arn"></a> [dynamodb\_table\_stream\_arn](#output\_dynamodb\_table\_stream\_arn) | The ARN of the Table Stream |
62+
| <a name="output_dynamodb_table_stream_label"></a> [dynamodb\_table\_stream\_label](#output\_dynamodb\_table\_stream\_label) | A timestamp, in ISO 8601 format of the Table Stream |
6063
<!-- END_TF_DOCS -->

examples/global-tables/main.tf

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ provider "aws" {
22
region = "eu-west-1"
33
}
44

5-
provider "aws" {
6-
alias = "euwest2"
7-
region = "eu-west-2"
8-
}
9-
105
locals {
116
tags = {
127
Terraform = "true"
@@ -23,12 +18,14 @@ resource "random_pet" "this" {
2318
}
2419

2520
resource "aws_kms_key" "primary" {
21+
region = "eu-west-1"
22+
2623
description = "CMK for primary region"
2724
tags = local.tags
2825
}
2926

3027
resource "aws_kms_key" "secondary" {
31-
provider = aws.euwest2
28+
region = "us-east-1"
3229

3330
description = "CMK for secondary region"
3431
tags = local.tags
@@ -76,11 +73,10 @@ module "dynamodb_table" {
7673
]
7774

7875
replica_regions = [{
79-
region_name = "eu-west-2"
80-
kms_key_arn = aws_kms_key.secondary.arn
81-
propagate_tags = true
82-
point_in_time_recovery = true
83-
deletion_protection_enabled = false
76+
region_name = "us-east-1"
77+
kms_key_arn = aws_kms_key.secondary.arn
78+
propagate_tags = true
79+
point_in_time_recovery = true
8480
}]
8581

8682
tags = local.tags

examples/global-tables/outputs.tf

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,31 @@ output "dynamodb_table_id" {
99
}
1010

1111
output "dynamodb_table_stream_arn" {
12-
description = "The ARN of the Table Stream. Only available when var.stream_enabled is true"
12+
description = "The ARN of the Table Stream"
1313
value = module.dynamodb_table.dynamodb_table_stream_arn
1414
}
1515

1616
output "dynamodb_table_stream_label" {
17-
description = "A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream_enabled is true"
17+
description = "A timestamp, in ISO 8601 format of the Table Stream"
1818
value = module.dynamodb_table.dynamodb_table_stream_label
1919
}
20+
21+
output "dynamodb_table_replicas" {
22+
description = "Map of Table replicas by region"
23+
value = module.dynamodb_table.dynamodb_table_replicas
24+
}
25+
26+
output "dynamodb_table_replica_arns" {
27+
description = "Map of the Table replicas ARNs"
28+
value = module.dynamodb_table.dynamodb_table_replica_arns
29+
}
30+
31+
output "dynamodb_table_replica_stream_arns" {
32+
description = "Map of the Table replicas stream ARNs"
33+
value = module.dynamodb_table.dynamodb_table_replica_stream_arns
34+
}
35+
36+
output "dynamodb_table_replica_stream_labels" {
37+
description = "Map of the timestamps of the Table replicas stream"
38+
value = module.dynamodb_table.dynamodb_table_replica_stream_labels
39+
}

examples/s3-import/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Note that this example may create resources which can cost money (AWS Elastic IP
3535
|------|--------|---------|
3636
| <a name="module_import_csv_table"></a> [import\_csv\_table](#module\_import\_csv\_table) | ../../ | n/a |
3737
| <a name="module_import_json_table"></a> [import\_json\_table](#module\_import\_json\_table) | ../../ | n/a |
38-
| <a name="module_s3_bucket"></a> [s3\_bucket](#module\_s3\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 3.15 |
39-
| <a name="module_s3_import_object_csv"></a> [s3\_import\_object\_csv](#module\_s3\_import\_object\_csv) | terraform-aws-modules/s3-bucket/aws//modules/object | ~> 3.15 |
40-
| <a name="module_s3_import_object_json"></a> [s3\_import\_object\_json](#module\_s3\_import\_object\_json) | terraform-aws-modules/s3-bucket/aws//modules/object | ~> 3.15 |
38+
| <a name="module_s3_bucket"></a> [s3\_bucket](#module\_s3\_bucket) | terraform-aws-modules/s3-bucket/aws | >= 3.15 |
39+
| <a name="module_s3_import_object_csv"></a> [s3\_import\_object\_csv](#module\_s3\_import\_object\_csv) | terraform-aws-modules/s3-bucket/aws//modules/object | >= 3.15 |
40+
| <a name="module_s3_import_object_json"></a> [s3\_import\_object\_json](#module\_s3\_import\_object\_json) | terraform-aws-modules/s3-bucket/aws//modules/object | >= 3.15 |
4141

4242
## Resources
4343

0 commit comments

Comments
 (0)