AWS Transfer Family Server

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


Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.


Terraform Example (aws_transfer_server)

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.


Example Usage (from GitHub)

resource "aws_transfer_server" "default_no_protocols" {
  tags = {
    Name = "No protocols"

resource "aws_transfer_server" "example_public" {
    endpoint_type = "PUBLIC"
    protocols   = ["SFTP"]

# pass
resource "aws_transfer_server" "sftp" {
  identity_provider_type = "SERVICE_MANAGED"
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
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

CloudFormation Example (AWS::Transfer::Server)

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.