Skip to content

Commit 03f6e43

Browse files
committed
update timeout block and add example
1 parent ac9194d commit 03f6e43

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

examples/serverless-cache/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ module "cache_user_group" {
6363
authentication_mode = {
6464
type = "no-password-required"
6565
}
66+
timeouts = {
67+
create = "20m"
68+
}
6669
}
6770
}
6871

modules/user-group/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ resource "aws_elasticache_user_group_association" "this" {
7575
user_group_id = var.create && var.create_group ? aws_elasticache_user_group.this[0].user_group_id : each.value.user_group_id
7676
user_id = aws_elasticache_user.this[each.key].user_id
7777

78-
timeouts {
79-
create = try(each.value.timeouts.create, null)
80-
delete = try(each.value.timeouts.delete, null)
78+
dynamic "timeouts" {
79+
for_each = try([each.value.timeouts], [])
80+
content {
81+
create = try(timeouts.value.create, null)
82+
delete = try(timeouts.value.delete, null)
83+
}
8184
}
8285
}

0 commit comments

Comments
 (0)