Skip to content

Commit 63f0c3f

Browse files
author
AWS
committed
Release: 1.10.2
1 parent daaad8e commit 63f0c3f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.10.1
1+
1.10.2

modules/aft-backend/main.tf

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,22 @@ resource "aws_dynamodb_table" "lock-table" {
270270
name = "LockID"
271271
type = "S"
272272
}
273-
lifecycle { ignore_changes = [replica] }
274273

275-
tags = {
276-
"Name" = "aft-backend-${data.aws_caller_identity.current.account_id}"
274+
# If secondary_region is provided, there will be 1 iteration of the dynamic replica block
275+
# If secondary region is omitted, there will be 0 iteration of the dynamic replica block
276+
dynamic "replica" {
277+
for_each = var.secondary_region == "" ? [] : [1]
278+
content {
279+
region_name = var.secondary_region
280+
}
277281
}
278-
}
279-
280-
resource "aws_dynamodb_table_replica" "lock-table-replica" {
281-
count = var.secondary_region == "" ? 0 : 1
282-
provider = aws.secondary_region
283-
global_table_arn = aws_dynamodb_table.lock-table.arn
284282

285283
tags = {
286284
"Name" = "aft-backend-${data.aws_caller_identity.current.account_id}"
287285
}
288286
}
289287

288+
290289
# KMS Resources
291290

292291
resource "aws_kms_key" "encrypt-primary-region" {

0 commit comments

Comments
 (0)