Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Cognito User Pool Client Refresh Token Validity resets to default validity unit when seconds is specified #18090

Closed
AlexWang-16 opened this issue Mar 15, 2021 · 2 comments · Fixed by #19702
Labels
bug Addresses a defect in current functionality.
Milestone

Comments

@AlexWang-16
Copy link

AlexWang-16 commented Mar 15, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform CLI: 0.14.8
AWS Provider v3.32.0

Affected Resource(s)

  • aws_cognito_user_pool_client

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "~> 3.32.0"
    }
  }
}

provider "aws" {
  region  = "ca-central-1"
}

resource "aws_cognito_user_pool" "pool" {
  name = "test_user_pool"
}

resource "aws_cognito_identity_pool" "id_pool" {
  identity_pool_name = "Test identity pool"
  allow_unauthenticated_identities = true
}

resource "aws_cognito_user_pool_client" "client" {
  name = "my_web_client"
  user_pool_id = aws_cognito_user_pool.pool.id

  access_token_validity = 3600
  id_token_validity = 60
  refresh_token_validity = 86400

  token_validity_units {
    access_token = "seconds"
    id_token = "minutes"
    refresh_token = "seconds"
  }
}```

### Expected Behavior
Terraform should allow refresh_token_validity value to go beyond 3650 when the refresh token validity unit is set to "seconds"; For example, 86400 seconds is 24 hours which is 1 day. 

The error message indicating the limit of 0 - 3650 is for the default validity unit of "days".

### Actual Behavior
Terraform CLI produces the following error: Error: expected refresh_token_validity to be in the range (0 - 3650), got 86400

### Steps to Reproduce
1. `terraform apply`

### References
* #14919
@ghost ghost added the service/cognito label Mar 15, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 15, 2021
@AlexWang-16 AlexWang-16 changed the title AWS Cognito User Pool Client Refresh Token Validity does not respond to validity unit change AWS Cognito User Pool Client Refresh Token Validity resets to default validity unit when seconds is specified Mar 15, 2021
@bill-rich bill-rich added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 19, 2021
@github-actions github-actions bot added this to the v3.45.0 milestone Jun 9, 2021
@github-actions
Copy link

This functionality has been released in v3.45.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants