-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add Transfer SSH Public Key Resource Support #6932
Add Transfer SSH Public Key Resource Support #6932
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @kterada0509! 🚀 I'll make the very minor documentation updates on merge so this can get released tomorrow.
--- PASS: TestAccAWSTransferSshKey_basic (8.04s)
|
||
if body == "" { | ||
log.Printf("[WARN] No such ssh public key found for User (%s) in Server (%s)", userName, serverID) | ||
d.SetId("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Its safe in this case to be omitted, but generally we should immediately call return nil
after d.SetId("")
👍
|
||
var body string | ||
for _, s := range resp.User.SshPublicKeys { | ||
if sshKeyID == *s.SshPublicKeyId { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: To prevent potential panics, we prefer to dereference API response values using the AWS Go SDK functions, e.g. if sshKeyID == aws.StringValue(s.SshPublicKeyId)
|
||
# aws_transfer_ssh_key | ||
|
||
Provides a AWS Transfer User resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should mention SSH Key here 😄
resource "aws_transfer_ssh_key" "foo" { | ||
server_id = "${aws_transfer_server.foo.id}" | ||
user_name = "${aws_transfer_user.foo.user_name}" | ||
body = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While its admittedly present in the acceptance testing files, I'm going to at least change the email address here in the public facing documentation to a fake email.
This has been released in version 1.53.0 of the 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! |
Fixes #6584
Changes proposed in this pull request:
Output from acceptance testing: