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

Terraform limits cognito verification email body to 140 characters #4050

Closed
bleggett opened this issue Apr 4, 2018 · 3 comments · Fixed by #4051
Closed

Terraform limits cognito verification email body to 140 characters #4050

bleggett opened this issue Apr 4, 2018 · 3 comments · Fixed by #4051
Labels
bug Addresses a defect in current functionality.
Milestone

Comments

@bleggett
Copy link

bleggett commented Apr 4, 2018

Terraform Version

0.11.5

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_cognito_user_pool

Terraform Configuration Files

resource "aws_cognito_user_pool" "pool"{
  name = "${var.envPrefix}"
  username_attributes = ["email"]
  schema = [
    {
      name = "email"
      attribute_data_type = "String"
      required = true
    },
    {
      name = "reg-code"
      attribute_data_type = "String"
      string_attribute_constraints = {
        min_length = 1
      },
    }
  ]
  tags = {
    Application = "Test"
    AppInstance = "${var.envPrefix}"
  }
  auto_verified_attributes = ["email"]
  verification_message_template = {
    email_subject_by_link = "APP Notification - Account Verification"
    email_message_by_link = "Hello,\n<br><br>\nThanks for signing up!\n<br><br>\nPlease click the link to verify your email address: {##VERIFY EMAIL##}\n<br><br>\nTo know more about APP, please refer to link https://github.com/test/test-core/test\n<br><br>\nBest,<br>\nAPP Team"
    default_email_option = "CONFIRM_WITH_LINK"
  }
  password_policy = {
    minimum_length    = 6
    require_lowercase = true
    require_numbers   = false
    require_symbols   = false
    require_uppercase = false
  }
}

Debug Output

https://gist.github.com/bleggett/d3a79afd6d0d2c2256bb87770b1b965c

Expected Behavior

Terraform should not limit people to a 140-character email body when AWS has no such limitation.

Actual Behavior

Terraform fails if I set verification_message_template.email_message_by_link to a string longer than 140 characters, because that limit is hardcoded in a validators.go function named validateCognitoUserPoolTemplateEmailMessageByLink

AWS has no problem with the email body if I use their API directly, and appears to support up to 20,000 UTF-8 characters

@bflad bflad added bug Addresses a defect in current functionality. service/cognito labels Apr 4, 2018
@bflad bflad added this to the v1.14.0 milestone Apr 4, 2018
@bflad
Copy link
Contributor

bflad commented Apr 4, 2018

The fix for this has been merged into master and will be released with v1.14.0 of the AWS provider, likely by the end of the week.

@bflad
Copy link
Contributor

bflad commented Apr 6, 2018

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

@ghost
Copy link

ghost commented Apr 6, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
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