From 63f0c3fa50ff0a1772dc0bcb34d998f8e27a2a29 Mon Sep 17 00:00:00 2001 From: AWS Date: Wed, 26 Apr 2023 06:20:19 +0000 Subject: [PATCH] Release: 1.10.2 --- VERSION | 2 +- modules/aft-backend/main.tf | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 4dae2985..5ad2491c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.10.1 +1.10.2 diff --git a/modules/aft-backend/main.tf b/modules/aft-backend/main.tf index 5ae942d0..5f336749 100644 --- a/modules/aft-backend/main.tf +++ b/modules/aft-backend/main.tf @@ -270,23 +270,22 @@ resource "aws_dynamodb_table" "lock-table" { name = "LockID" type = "S" } - lifecycle { ignore_changes = [replica] } - tags = { - "Name" = "aft-backend-${data.aws_caller_identity.current.account_id}" + # If secondary_region is provided, there will be 1 iteration of the dynamic replica block + # If secondary region is omitted, there will be 0 iteration of the dynamic replica block + dynamic "replica" { + for_each = var.secondary_region == "" ? [] : [1] + content { + region_name = var.secondary_region + } } -} - -resource "aws_dynamodb_table_replica" "lock-table-replica" { - count = var.secondary_region == "" ? 0 : 1 - provider = aws.secondary_region - global_table_arn = aws_dynamodb_table.lock-table.arn tags = { "Name" = "aft-backend-${data.aws_caller_identity.current.account_id}" } } + # KMS Resources resource "aws_kms_key" "encrypt-primary-region" {