File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ provider "aws" {
44
55locals {
66 name = " ex-${ basename (path. cwd )} "
7- region = " us-east-1"
7+ region1 = " us-east-1"
8+ region2 = " us-east-2"
89 witness_region = " us-west-2"
910
1011 tags = {
@@ -40,14 +41,14 @@ module "dsql_cluster_1" {
4041module "dsql_cluster_2" {
4142 source = " ../../modules/dsql"
4243
43- region = local. witness_region
44+ region = local. region2
4445
4546 name = " ${ local . name } -2"
4647
4748 # For example only
4849 deletion_protection_enabled = false
4950
50- witness_region = local. region
51+ witness_region = local. witness_region
5152 create_cluster_peering = true
5253 clusters = [module . dsql_cluster_1 . arn ]
5354
Original file line number Diff line number Diff line change @@ -584,9 +584,13 @@ resource "aws_rds_shard_group" "this" {
584584 publicly_accessible = var. shard_group . publicly_accessible
585585 tags = merge (var. tags , var. shard_group . tags )
586586
587- timeouts {
588- create = var. shard_group . timeouts . create
589- update = var. shard_group . timeouts . update
590- delete = var. shard_group . timeouts . delete
587+ dynamic "timeouts" {
588+ for_each = var. shard_group != null ? [var . shard_group ] : []
589+
590+ content {
591+ create = each. value . create
592+ update = each. value . update
593+ delete = each. value . delete
594+ }
591595 }
592596}
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ resource "aws_dsql_cluster_peering" "this" {
3737 identifier = aws_dsql_cluster. this [0 ]. identifier
3838 witness_region = var. witness_region
3939
40- timeouts {
41- create = var. timeouts . create
40+ dynamic "timeouts" {
41+ for_each = var. timeouts != null ? [var . timeouts ] : []
42+
43+ content {
44+ create = each. value . create
45+ }
4246 }
4347}
You can’t perform that action at this time.
0 commit comments