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

aws_transfer_server: allow security group #19872

Closed
ecerulm opened this issue Jun 17, 2021 · 2 comments
Closed

aws_transfer_server: allow security group #19872

ecerulm opened this issue Jun 17, 2021 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/transfer Issues and PRs that pertain to the transfer service.

Comments

@ecerulm
Copy link

ecerulm commented Jun 17, 2021

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 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The AWS console when you create a AWS Transfer Server and select:

  • SFTP
  • Endpoint type: VPC Hosted (access controlled using security groups)
  • Access: internal
  • VPC:xxx
  • AZ subnet

You are presented with a box to the security groups
2021-06-17_16-39-08

But that is is not possible with resource "aws_transfer_server https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/transfer_server#endpoint_details
as far as I know. When you use endpoint_type = "VPC" there is no way to specify the security group

So that is very unfortunate because there is not good way to add the security group afterwards to the actual vpc endpoint that is created (under the hood) via the aws_transfer_server resource.

The current alternative / workaround is to:

  • Create the aws_transfer_server
  • Look up in the AWS console / aws cli / api the vpc endpoint that was created / associated with the aws transfer server
  • Add security group to that vpc endpoint
  • manually via aws console / aws cli/ etc
  • create / import a aws_vpc_endpoint resource and add the security group there.

Also in a related note, the aws_transfer_server will NOT expose the aws_vpc_endpoint's id or service name as an attribute either (having it expose at least would it make it easier to get the reference to the vpc endpoint in a terraform output)

New or Affected Resource(s)

  • aws_transfer_server

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

resource "aws_transfer_server" "example" {
  tags = {
    Name = "example"
  }
  security_policy_name = "TransferSecurityPolicy-2020-06"
  endpoint_details {
    subnet_ids = data.terraform_remote_state.networking.outputs.shared_services_private_subnets
    vpc_id = data.terraform_remote_state.networking.outputs.shared_services_vpc_id
    security_groups=[xxxx,yyy] ## This DOES NOT EXIST YET 
  }

  protocols = ["SFTP"]
  domain = "S3"
  endpoint_type = "VPC"
  identity_provider_type = "SERVICE_MANAGED"
  logging_role = module.iam-role-cw-logging.iam_role_arn
}

References

@ecerulm ecerulm added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 17, 2021
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/transfer Issues and PRs that pertain to the transfer service. labels Jun 17, 2021
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jun 17, 2021
@ewbankkit
Copy link
Contributor

@ecerulm Thanks for raising this issue.
It has already been noticed in #15788. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2021
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. service/transfer Issues and PRs that pertain to the transfer service.
Projects
None yet
Development

No branches or pull requests

2 participants