0

I would like to setup a simple SFTP server using AWS Transfer Family. I use AWS CDK (typescript) to set it up. I would like to use Custom Hostname (Route53 sub-domain) while creating SFTP server.

I tried following options...

  1. Adding tags from CDK does not work, aws:transfer:route53HostedZoneId and aws:transfer:customHostname. I don't know how to get the SFTP endpoint url inside CDK. Was anyone able to fetch it?

  2. Adding tags from CLI works but I don't want to write a followup script for this. And there is also a challenge to find the SFTP server that is created as part of CDK execution. This solution does not fit in my use case.

Has anyone faced this issue?

So, I want to setup AWS Transfer SFTP server, use it to transfer files and tear it down. However, I would like to keep the SFTP url same (Route53 url).

Thanks in advance!

Yogesh Manware
  • 1,843
  • 1
  • 22
  • 25

1 Answers1

0

Yes, it is possible. This is done through tags from the CDK

SFTPServer: Type: 'AWS::Transfer::Server' Properties: Tags: - Key: "aws:transfer:customHostname" Value: !Ref CustomHostname - Key: "aws:transfer:route53HostedZoneId" Value: !Join [ '/', [ "/hostedzone", !Ref HostedZoneID] ]

It will be something like this:

    Tags.of(cfnServer).add("transfer:route53HostedZoneId", hostedZoneId);

    Tags.of(cfnServer).add("transfer:customHostname", sftpDomainName);
rogur
  • 23
  • 3
  • Those tags are outdated, please follow the original post: https://docs.aws.amazon.com/transfer/latest/userguide/requirements-dns.html#tag-custom-hostname-cdk Also, it seems to be only working for internet facing scenario. At least for my case with "VPC hosted" option, the tags do not do anything. – Dmitry Mar 08 '23 at 17:34