- 최신
- 최다 투표
- 가장 많은 댓글
Hello dnew@,
For Custom Hostname to show up on the Transfer console server dashboard, you'll have to add the the Key/Value pairs aws:transfer:customHostname
and aws:transfer:route53HostedZoneId
within the Tags field of the server property.
I'll share an example CloudFormation template snippet below:
...
Parameters:
HostedZoneID:
Type: String
Description: "Enter your R53 HostedZone-ID"
CustomHostname:
Type: String
Description: "Enter your Custom Hostname"
Resources:
...
SFTPServer:
Type: 'AWS::Transfer::Server'
Properties:
Tags:
- Key: "aws:transfer:customHostname"
Value: !Ref CustomHostname
- Key: "aws:transfer:route53HostedZoneId"
Value: !Join [ '/', [ "/hostedzone", !Ref HostedZoneID] ]
...
The above should help you achieve your use-case. Let me know if you have questions.
References:
[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-transfer-server.html
-- Sagar
The following does add the custom host name but doesn't add the CNAME host record. I have tried all kinds of combination, Not sure what I am missing..
SftpServer:
Type: 'AWS::Transfer::Server'
Properties:
Protocols: ['SFTP']
IdentityProviderType: SERVICE_MANAGED
EndpointType: PUBLIC
Tags:
- Key: transfer:route53HostedZoneId
Value: !Join [ '/', [ "/hostedzone", !Ref HostedZoneIdParam] ]
- Key: transfer:customHostname
Value: !Ref CustomHostname
Eventually I have to add this to Resources to add the custom host name to hosted zone:, If someone is struggling with this scenario
myDNSRecord:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId : !Ref HostedZoneIdParam
Name: !Ref CustomHostname
ResourceRecords:
- !Join
- ''
- - !GetAtt SftpServer.ServerId
- '.server.transfer.'
- !Ref AWS::Region
- '.amazonaws.com'
TTL: 300
Type: CNAME
Thank you for the answer and YES! that was the fix. However, my syntax was a little different. yours looks cleaner than mine, can you explain the !join syntax a bit? like is yours better/more acceptable than my code below? I i found the syntax I used referencing the Fn::Join AWS documentation
Tags: - Key: Ownership Value: it_infrastructure - Key: aws:transfer:route53HostedZoneId Value: !Join - '' - - '/hostedzone/' - !Ref HostedZoneIdParam - Key: aws:transfer:customHostname Value: !Ref SFTPHostnameParam
Hello dnew@,
Glad to hear that your issue is resolved. To your question, both syntax's are correct and I believe its just a matter of preference on which one you are more comfortable with.
-- Sagar
For those that stumble upon this post in the future... the tag names have been updated to remove the restricted "aws:" prefix. The tag is now "transfer:customHostname"
https://docs.aws.amazon.com/transfer/latest/userguide/requirements-dns.html#tag-custom-hostname-cdk