Skip to content

Commit 60d596f

Browse files
Merge pull request #53 from mineiros-io/soerenmartius/fixes
Fix minimum provider requirement and token_validity_units block
2 parents c1ef4c9 + 4149304 commit 60d596f

File tree

7 files changed

+26
-11
lines changed

7 files changed

+26
-11
lines changed

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.9.0]
11+
12+
### BREAKING
13+
14+
- Minimum version of the aws provider has been bumped to `3.50.0` to ensure
15+
support for the `enable_token_revocation` in the `aws_cognito_user_pool_client`
16+
resource.
17+
18+
### Fixed
19+
20+
- Fixed implementation of `token_validity_units` block.
21+
1022
## [0.8.0]
1123

1224
### BREAKING
@@ -134,11 +146,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
134146

135147
<!-- markdown-link-check-disable -->
136148

137-
[unreleased]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.8.0...HEAD
138-
[0.8.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.7.0...v0.8.0
149+
[unreleased]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.9.0...HEAD
150+
[0.9.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.8.0...v0.9.0
139151

140152
<!-- markdown-link-check-enable -->
141153

154+
[0.8.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.7.0...v0.8.0
142155
[0.7.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.6.0...v0.7.0
143156
[0.6.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.5.0...v0.6.0
144157
[0.5.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.4.1...v0.5.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Most basic usage just setting required arguments:
6767
```hcl
6868
module "terraform-aws-cognito-user-pool" {
6969
source = "mineiros-io/cognito-user-pool/aws"
70-
version = "~> 0.8.0"
70+
version = "~> 0.9.0"
7171
7272
name = "application-userpool"
7373
}

examples/complete/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ shows how to deploy a Cognito User Pool with custom settings.
1212
```hcl
1313
module "cognito_user_pool" {
1414
source = "mineiros-io/cognito-user-pool/aws"
15-
version = "~> 0.8.0"
15+
version = "~> 0.9.0"
1616
1717
name = "complete-example-userpool"
1818

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ provider "aws" {
1717

1818
module "cognito_user_pool" {
1919
source = "mineiros-io/cognito-user-pool/aws"
20-
version = "~> 0.8.0"
20+
version = "~> 0.9.0"
2121

2222
name = "complete-example-userpool"
2323

examples/user-pool-with-default-settings/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ provider "aws" {
1818

1919
module "cognito_user_pool" {
2020
source = "mineiros-io/cognito-user-pool/aws"
21-
version = "~> 0.8.0"
21+
version = "~> 0.9.0"
2222

2323
name = "example-userpool"
2424
}

main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,18 @@ resource "aws_cognito_user_pool_client" "client" {
233233
id_token_validity = each.value.id_token_validity
234234

235235
dynamic "token_validity_units" {
236-
for_each = length(each.value.token_validity_units) > 0 ? [true] : []
236+
for_each = each.value.token_validity_units != null ? [each.value.token_validity_units] : []
237237

238238
content {
239-
refresh_token = each.value.token_validity_units.refresh_token
240-
access_token = each.value.token_validity_units.access_token
241-
id_token = each.value.token_validity_units.id_token
239+
refresh_token = try(token_validity_units.value.refresh_token, null)
240+
access_token = try(token_validity_units.value.access_token, null)
241+
id_token = try(token_validity_units.value.id_token, null)
242242
}
243243
}
244+
244245
enable_token_revocation = each.value.enable_token_revocation
245246
}
247+
246248
resource "aws_cognito_user_pool_domain" "domain" {
247249
count = var.module_enabled && var.domain != null ? 1 : 0
248250

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ terraform {
66
required_version = ">= 0.12.20, < 2.0"
77

88
required_providers {
9-
aws = ">= 3.32, < 4.0"
9+
aws = ">= 3.50, < 4.0"
1010
}
1111
}

0 commit comments

Comments
 (0)