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

Wrong aws_transfer_user user_name validation #8065

Closed
Skardian opened this issue Mar 25, 2019 · 6 comments · Fixed by #8304
Closed

Wrong aws_transfer_user user_name validation #8065

Skardian opened this issue Mar 25, 2019 · 6 comments · Fixed by #8304
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/transfer Issues and PRs that pertain to the transfer service.
Milestone

Comments

@Skardian
Copy link

Skardian commented Mar 25, 2019

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 "me too" comments, 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 Version

Terraform v0.11.7
+ provider.aws v2.3.0

Affected Resource(s)

  • aws_transfer_user

Terraform Configuration Files

resource "aws_transfer_user" "user" {
  server_id      = "s-0123456789abcdef0"
  user_name      = "user_name"
  role           = "arn:aws:iam::123456789012:role/transfer"
  home_directory = "/bucket/path"
}

Debug Output

Panic Output

Expected Behavior

Terraform creates the user

 + aws_transfer_user.user
      id:             <computed>
      arn:            <computed>
      home_directory: "/bucket/path"
      role:           "arn:aws:iam::123456789012:role/transfer"
      server_id:      "s-0123456789abcdef0"
      user_name:      "user_name"

Actual Behavior

Terraform fails to create users containing an underscore in the name

Error: aws_transfer_user.user: "user_name" isn't a valid transfer user name (only lowercase alphanumeric characters are allowed): "user_name"

Steps to Reproduce

  1. terraform plan

Important Factoids

References

AWS updated their user_name validation. Users with hypens and underscores are valid now.
2019-03-25_11:10:21

@Skardian Skardian changed the title AWS Transfer user wrong va Wrong aws_transfer_user user_name validation Mar 25, 2019
@nywilken
Copy link
Contributor

Hi @Skardian thanks for reporting this issue. It looks like we just need to update the ValidateFunc for the username attribute. I’m going to mark this as an enhancement request. Please keep an eye on the issue for updates.

https://github.com/terraform-providers/terraform-provider-aws/blob/06544e694b50c3d98060e50ecb009b17146ed289/aws/validators.go#L99

@nywilken nywilken added enhancement Requests to existing resources that expand the functionality or scope. service/transfer Issues and PRs that pertain to the transfer service. labels Mar 25, 2019
@ewbankkit
Copy link
Contributor

AWS SDK v1.19.3:

This release also relaxes the SFTP user name requirements to allow underscores and hyphens.

@bflad bflad added the good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. label Apr 11, 2019
@jukie
Copy link
Contributor

jukie commented Apr 12, 2019

PR opened #8304

@bflad bflad added this to the v2.8.0 milestone Apr 24, 2019
@bflad
Copy link
Contributor

bflad commented Apr 24, 2019

Support for uppercase letter, hyphens, and underscores in aws_transfer_user user names to match the new AWS support has been merged and will release with version 2.8.0 of the Terraform AWS Provider, likely later this week.

@nywilken
Copy link
Contributor

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

@ghost
Copy link

ghost commented Mar 30, 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 Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/transfer Issues and PRs that pertain to the transfer service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants