Skip to content

Commit

Permalink
Merge pull request #53 from mineiros-io/soerenmartius/fixes
Browse files Browse the repository at this point in the history
Fix minimum provider requirement and token_validity_units block
  • Loading branch information
soerenmartius authored Oct 20, 2021
2 parents c1ef4c9 + 4149304 commit 60d596f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ 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
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
Expand Down Expand Up @@ -134,11 +146,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

[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

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

[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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion examples/user-pool-with-default-settings/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
10 changes: 6 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ terraform {
required_version = ">= 0.12.20, < 2.0"

required_providers {
aws = ">= 3.32, < 4.0"
aws = ">= 3.50, < 4.0"
}
}

0 comments on commit 60d596f

Please sign in to comment.