File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 1- 1.10.1
1+ 1.10.2
Original file line number Diff line number Diff 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
292291resource "aws_kms_key" "encrypt-primary-region" {
You can’t perform that action at this time.
0 commit comments