AWS Transfer Family Server

This page shows how to write Terraform and CloudFormation for AWS Transfer Family Server and write them securely.

aws_transfer_server (Terraform)

The Server in AWS Transfer Family can be configured in Terraform with the resource name aws_transfer_server. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

transfer_server_test.tf#L12
resource "aws_transfer_server" "default_no_protocols" {
  tags = {
    Name = "No protocols"
  }
}

main.tf#L2
resource "aws_transfer_server" "example_public" {
    endpoint_type = "PUBLIC"
    protocols   = ["SFTP"]
}

# pass
main.tf#L6
resource "aws_transfer_server" "sftp" {
  identity_provider_type = "SERVICE_MANAGED"
}
main.tf#L67
resource "aws_transfer_server" "transfer_server" {
  count = var.enable_sftp && var.endpoint_type == "PUBLIC" ? 1 : 0

  identity_provider_type = var.identity_provider_type
  logging_role           = join("", aws_iam_role.transfer_server_role.*.arn)
  force_destroy          = false
sftp.tf#L1
resource "aws_transfer_server" "server" {
  identity_provider_type  = "API_GATEWAY"
  endpoint_type           = "PUBLIC"
  invocation_role         = aws_iam_role.transfer_IdP_role.arn
  url                     = aws_api_gateway_stage.stage.invoke_url
  logging_role            = aws_iam_role.SFTPLogsRole.arn

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a AWS Transfer Server resource.

NOTE on AWS IAM permissions: If the endpoint_type is set to VPC, the ec2:DescribeVpcEndpoints and ec2:ModifyVpcEndpoint actions are used.

AWS::Transfer::Server (CloudFormation)

The Server in Transfer can be configured in CloudFormation with the resource name AWS::Transfer::Server. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

sftp.yml#L88
    Type: AWS::Transfer::Server
    Properties:
      Tags:
        -
          Key: Name
          Value: ${self:provider.environment.namePrefix}sftp
cf-transfer-sftp.yml#L59
    Type: "AWS::Transfer::Server"
    DeletionPolicy: "Delete"
    DependsOn: "LoggingRole"
    Properties:
      # EndpointDetails:
      #   VpcEndpointId: String
sftp_transfer.yml#L42
    Type: AWS::Transfer::Server
    DependsOn:
      - AccessSftpTransfer
      - VpcEndpointSftp
    Properties:
      EndpointDetails:
product.template-ap-south-1.yaml#L5
    Type: AWS::Transfer::Server
    Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-transfer-server.html
Outputs:
  ServerId:
    Value:
      GetAtt:
product.template-eu-west-3.yaml#L5
    Type: AWS::Transfer::Server
    Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-transfer-server.html
Outputs:
  ServerId:
    Value:
      GetAtt:
transfer-sftp-template.json#L46
      "Type": "AWS::Transfer::Server",
      "Properties": {
        "EndpointDetails": {
          "AddressAllocationIds": [ { "Ref": "SFTPElasticIP" } ],
          "SecurityGroupIds" : { "Fn::Split" : [ ",", { "Ref": "SecurityGroupIds" } ] },
          "SubnetIds":  { "Ref": "SubnetIds" },
serverless-state.json#L432
            "Type": "AWS::Transfer::Server",
            "Properties": {
              "Tags": [
                {
                  "Key": "Name",
                  "Value": "fl-dev-sftp"
cloudformation-template-update-stack.json#L385
      "Type": "AWS::Transfer::Server",
      "Properties": {
        "Tags": [
          {
            "Key": "Name",
            "Value": "fl-dev-sftp"
TransferServerSpecification.json#L3
    "AWS::Transfer::Server.Protocol": {
      "PrimitiveType": "String"
    },
    "Tag": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html",
      "Properties": {
cloudFormationSftp.json#L218
    "Type": "AWS::Transfer::Server",
    "Properties": {
      "EndpointDetails": {
        "AddressAllocationIds": [
          {
            "Fn::GetAtt": [

Parameters

Explanation in CloudFormation Registry

The AWS::Transfer::Server resource instantiates an autoscaling virtual server based on a file transfer protocol in AWS. When you make updates to your server or when you work with users, use the service-generated ServerId property that is assigned to the newly created server.

Frequently asked questions

What is AWS Transfer Family Server?

AWS Transfer Family Server is a resource for Transfer Family of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Transfer Family Server?

For Terraform, the infracost/infracost, bridgecrewio/checkov and heldersepu/hs-scripts source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the kartik-rao/lib-forms-api, goodbyegangster/cloudformation and Fellipe26/templates-cloudformation source code examples are useful. See the CloudFormation Example section for further details.