hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.72k stars 9.08k forks source link

[Bug]: aws_transfer_user expect user to be provided conflicts with IdP type: AWS_LAMBDA #38435

Closed khvalov closed 1 month ago

khvalov commented 1 month ago

Terraform Core Version

v1.9.2

AWS Provider Version

v4.67.0

Affected Resource(s)

aws_transfer_user

Expected Behavior

SFTP server should be created

Actual Behavior

Missing required argument │  │   on main.tf line 316, in resource "aws_transfer_user" "sftp_user": │  316: resource "aws_transfer_user" "sftp_user" { │  │ The argument "user_name" is required, but no definition was found.

Relevant Error/Panic Output Snippet

Missing required argument │  │   on main.tf line 316, in resource "aws_transfer_user" "sftp_user": │  316: resource "aws_transfer_user" "sftp_user" { │  │ The argument "user_name" is required, but no definition was found.

Terraform Configuration Files

resource "aws_transfer_user" "sftp_user" {
  server_id = aws_transfer_server.sftp_server.id
  role = aws_iam_role.sftp_transfer_role.arn
  #user_name = "fake" //NOT REQURED
  home_directory = "/${var.s3_bucket_name}/home"
}

Steps to Reproduce

resource "aws_transfer_user" "sftp_user" {
  server_id = aws_transfer_server.sftp_server.id
  role = aws_iam_role.sftp_transfer_role.arn
  home_directory = "/${var.s3_bucket_name}/home"
}

Debug Output

No response

Panic Output

No response

Important Factoids

Creating SFTP endpoint with LAMBDA function as User Auth handler

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 1 month ago

Hey @khvalov 👋 Thank you for taking the time to raise this! In reviewing the documentation for aws_transfer_user, I noticed that the user_name argument is indeed marked as required. I went to verify this requirement with the upstream API documentation and noticed the following note (emphasis mine):

Creates a user and associates them with an existing file transfer protocol-enabled server. You can only create and associate users with servers that have the IdentityProviderType set to SERVICE_MANAGED.

With that information (and that the upstream API requires the UserName parameter), this seems to be working as expected, so I'm going to close this issue. If you experience unexpected behavior in the future, please do let us know!

github-actions[bot] commented 1 month ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

github-actions[bot] commented 1 week ago

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.