Search code examples
sftpaws-cdkaws-transfer-family

Is it possible to set a custom hostname while creating SFTP server through AWS CDK?


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!


Solution

  • I solved the issue by having a fixed url and pointing the dynamic sftp url using fixed url using alias. I used CLI to update the association.