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

[New Resource]: aws_transfer_host_key #30789

Open
sergei-ivanov opened this issue Apr 18, 2023 · 5 comments
Open

[New Resource]: aws_transfer_host_key #30789

sergei-ivanov opened this issue Apr 18, 2023 · 5 comments
Labels
new-resource Introduces a new resource. service/transfer Issues and PRs that pertain to the transfer service.

Comments

@sergei-ivanov
Copy link
Contributor

Description

We need a mechanism to import multiple host keys into transfer server, possibly superseding the aws_transfer_server.host_key functionality. This is essential for key rotation requirements, and also to be able to provide keys of multiple types (e.g. both RSA and ED25519).

Requested Resource(s) and/or Data Source(s)

  • aws_transfer_host_key

Potential Terraform Configuration

resource "aws_transfer_host_key" "rsa" {
  server_id   = aws_transfer_server.this.id
  private_key = "...."
  description = "RSA 4096, Created 2023-03-15"
  tags = {
    Type = "RSA"
  }
}

References

Linked issues:

API:

Would you like to implement a fix?

None

@sergei-ivanov sergei-ivanov added the needs-triage Waiting for first response or review from a maintainer. label Apr 18, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/transfer Issues and PRs that pertain to the transfer service. label Apr 18, 2023
@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 19, 2023
@dirk39
Copy link
Contributor

dirk39 commented Apr 19, 2023

hi @sergei-ivanov, will the aws_transfer_server.host_key conflict with the new resource? Or do we have to maintain both ways to import the key?

@sergei-ivanov
Copy link
Contributor Author

hi @sergei-ivanov, will the aws_transfer_server.host_key conflict with the new resource? Or do we have to maintain both ways to import the key?

I guess that we'll have to use ignore_changes for host_key when the keys are attached using the new aws_transfer_host_key resource. We may still want to use host_key for seeding the initial key, because if we leave it unspecified, AWS Transfer will still create its own key pair.

@chadmyers
Copy link

Also please make it so that it can hook into an AWS Secrets Manager Secret somehow. I can't believe people are OK with having their private host keys as plaintext strings in their terraform files!

@pspot2
Copy link

pspot2 commented Jul 11, 2023

Also please make it so that it can hook into an AWS Secrets Manager Secret somehow. I can't believe people are OK with having their private host keys as plaintext strings in their terraform files!

You can use the data "aws_ssm_parameter" resource to fetch the parameter you need and then feed it to the respective input argument of the Transfer server.

As to how you would put secrets / host keys into SSM (in order not to have them in TF files) in the first place - that is a completely different story. If you use Terraform for this (resource "aws_ssm_parameter"), then be aware that at the moment Terraform stores SecureString values in its state in plain text (see #3475).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-resource Introduces a new resource. service/transfer Issues and PRs that pertain to the transfer service.
Projects
None yet
Development

No branches or pull requests

5 participants