title: Is it possible to setup a custom hostname for AWS Transfer SFTP via Terraform
body: <p>I'm trying to set up an SFTP server with a custom hostname using AWS Transfer. I'm managing the resource using Terraform. I've currently got the resource up and running, and I've used Terraform to create a Route53 record to point to the SFTP server, but the custom hostname entry on the SFTP dashboard is reading as blank.
  <img src="https://i.imgur.com/QeBc1rQ.png" alt=""></p>
  
  <p>And of course, when I create the server manually throught the AWS console and associate a route53 record with it, it looks like what I would expect:
  <img src="https://i.imgur.com/W4dEgSp.png" alt=""></p>
  
  <p>I've looked through the <a href="https://www.terraform.io/docs/providers/aws/r/transfer_server.html" rel="noreferrer">terraform resource documentation</a> and I've tried to see how it might be done via aws cli or cloudformation, but I haven't had any luck. </p>
  
  <p>My server resource looks like:</p>
  
  <pre><code>resource "aws_transfer_server" "sftp" {
    identity_provider_type = "SERVICE_MANAGED"
    logging_role           = "${aws_iam_role.logging.arn}"
    force_destroy          = "false"
  
    tags {
      Name = ${local.product}-${terraform.workspace}"
    }
  }
  </code></pre>
  
  <p>and my Route53 record looks like:</p>
  
  <pre><code>resource "aws_route53_record" "dns_record_cname" {
    zone_id = "${data.aws_route53_zone.sftp.zone_id}"
    name    = "${local.product}-${terraform.workspace}"
    type    = "CNAME"
    records = ["${aws_transfer_server.sftp.endpoint}"]
    ttl = "300"
  }
  </code></pre>
  
  <p>Functionally, I can move forward with what I have, I can connect to the server with my DNS, but I'm trying to understand the complete picture.</p>