Terraform v0.11.7
+ provider.aws v2.3.0
resource "aws_transfer_user" "user" {
server_id = "s-0123456789abcdef0"
user_name = "user_name"
role = "arn:aws:iam::123456789012:role/transfer"
home_directory = "/bucket/path"
}
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"
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"
terraform planAWS updated their user_name validation. Users with hypens and underscores are valid now.

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.
This release also relaxes the SFTP user name requirements to allow underscores and hyphens.
PR opened #8304
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.
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.
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!