Skip to content

Commit 40559b7

Browse files
committed
Added dynamic block
1 parent 9a81e8a commit 40559b7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

main.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,16 @@ resource "aws_cognito_user_pool_client" "client" {
231231
write_attributes = each.value.write_attributes
232232
access_token_validity = each.value.access_token_validity
233233
id_token_validity = each.value.id_token_validity
234-
token_validity_units = each.value.token_validity_units
235-
enable_token_revocation = each.value.enable_token_revocation
234+
235+
dynamic "token_validity_units" {
236+
for_each = length(each.value.token_validity_units) > 0 ? [true] : []
237+
content {
238+
refresh_token = lookup(token_validity_units.value, "refresh_token", null)
239+
access_token = lookup(token_validity_units.value, "access_token", null)
240+
id_token = lookup(token_validity_units.value, "id_token", null)
241+
}
242+
}
243+
enable_token_revocation = each.value.enable_token_revocation
236244
}
237245

238246
resource "aws_cognito_user_pool_domain" "domain" {

0 commit comments

Comments
 (0)