From adef6b62f08d2e4d85509dcabb6ec5253be76c24 Mon Sep 17 00:00:00 2001 From: Soren Martius Date: Wed, 20 Oct 2021 03:00:43 +0200 Subject: [PATCH 1/3] fix: bump minimum version of aws provider to v3.50.0 to ensure support for enable_token_revocation --- CHANGELOG.md | 6 ++++++ versions.tf | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad61bc4..aafff22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### BREAKING + +- Minimum version of the aws provider has been bumped to `3.50.0` to ensure + support for the `enable_token_revocation` in the `aws_cognito_user_pool_client` + resource. + ## [0.8.0] ### BREAKING diff --git a/versions.tf b/versions.tf index d8be94f..0603bb1 100644 --- a/versions.tf +++ b/versions.tf @@ -6,6 +6,6 @@ terraform { required_version = ">= 0.12.20, < 2.0" required_providers { - aws = ">= 3.32, < 4.0" + aws = ">= 3.50, < 4.0" } } From fb4f6672ae631da9e5706c2e335c6e0e769b14a5 Mon Sep 17 00:00:00 2001 From: Soren Martius Date: Wed, 20 Oct 2021 03:02:39 +0200 Subject: [PATCH 2/3] fix: use correct null check for token_validity_units block --- CHANGELOG.md | 4 ++++ main.tf | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafff22..bd52101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 support for the `enable_token_revocation` in the `aws_cognito_user_pool_client` resource. +### Fixed + +- Fixed implementation of `token_validity_units` block. + ## [0.8.0] ### BREAKING diff --git a/main.tf b/main.tf index 04e5927..4720276 100644 --- a/main.tf +++ b/main.tf @@ -233,16 +233,18 @@ resource "aws_cognito_user_pool_client" "client" { id_token_validity = each.value.id_token_validity dynamic "token_validity_units" { - for_each = length(each.value.token_validity_units) > 0 ? [true] : [] + for_each = each.value.token_validity_units != null ? [each.value.token_validity_units] : [] content { - refresh_token = each.value.token_validity_units.refresh_token - access_token = each.value.token_validity_units.access_token - id_token = each.value.token_validity_units.id_token + refresh_token = try(token_validity_units.value.refresh_token, null) + access_token = try(token_validity_units.value.access_token, null) + id_token = try(token_validity_units.value.id_token, null) } } + enable_token_revocation = each.value.enable_token_revocation } + resource "aws_cognito_user_pool_domain" "domain" { count = var.module_enabled && var.domain != null ? 1 : 0 From 414930405c17f296191af632de16aacbdb4f49ec Mon Sep 17 00:00:00 2001 From: Soren Martius Date: Wed, 20 Oct 2021 03:09:15 +0200 Subject: [PATCH 3/3] chore: prepare v0.9.0 release --- CHANGELOG.md | 7 +++++-- README.md | 2 +- examples/complete/README.md | 2 +- examples/complete/main.tf | 2 +- examples/user-pool-with-default-settings/main.tf | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd52101..17ab17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.0] + ### BREAKING - Minimum version of the aws provider has been bumped to `3.50.0` to ensure @@ -144,11 +146,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 -[unreleased]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.8.0...HEAD -[0.8.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.7.0...v0.8.0 +[unreleased]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.9.0...HEAD +[0.9.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.8.0...v0.9.0 +[0.8.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.7.0...v0.8.0 [0.7.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.6.0...v0.7.0 [0.6.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/mineiros-io/terraform-aws-cognito-user-pool/compare/v0.4.1...v0.5.0 diff --git a/README.md b/README.md index 9cfc9fb..2ae040a 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Most basic usage just setting required arguments: ```hcl module "terraform-aws-cognito-user-pool" { source = "mineiros-io/cognito-user-pool/aws" - version = "~> 0.8.0" + version = "~> 0.9.0" name = "application-userpool" } diff --git a/examples/complete/README.md b/examples/complete/README.md index eed5470..df668d1 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -12,7 +12,7 @@ shows how to deploy a Cognito User Pool with custom settings. ```hcl module "cognito_user_pool" { source = "mineiros-io/cognito-user-pool/aws" - version = "~> 0.8.0" + version = "~> 0.9.0" name = "complete-example-userpool" diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 72c83d6..7ea1d38 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -17,7 +17,7 @@ provider "aws" { module "cognito_user_pool" { source = "mineiros-io/cognito-user-pool/aws" - version = "~> 0.8.0" + version = "~> 0.9.0" name = "complete-example-userpool" diff --git a/examples/user-pool-with-default-settings/main.tf b/examples/user-pool-with-default-settings/main.tf index 0a9c4fd..bfa59ee 100644 --- a/examples/user-pool-with-default-settings/main.tf +++ b/examples/user-pool-with-default-settings/main.tf @@ -18,7 +18,7 @@ provider "aws" { module "cognito_user_pool" { source = "mineiros-io/cognito-user-pool/aws" - version = "~> 0.8.0" + version = "~> 0.9.0" name = "example-userpool" }