{
  "typeName" : "AWS::Transfer::Server",
  "description" : "Definition of AWS::Transfer::Server Resource Type",
  "definitions" : {
    "As2Transport" : {
      "type" : "string",
      "enum" : [ "HTTP" ]
    },
    "DirectoryListingOptimization" : {
      "type" : "string",
      "description" : "Indicates whether optimization to directory listing on S3 servers is used. Disabled by default for compatibility.",
      "enum" : [ "ENABLED", "DISABLED" ]
    },
    "Domain" : {
      "type" : "string",
      "enum" : [ "S3", "EFS" ]
    },
    "EndpointDetails" : {
      "type" : "object",
      "properties" : {
        "AddressAllocationIds" : {
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        },
        "SubnetIds" : {
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        },
        "VpcEndpointId" : {
          "type" : "string",
          "maxLength" : 22,
          "minLength" : 22,
          "pattern" : "^vpce-[0-9a-f]{17}$"
        },
        "VpcId" : {
          "type" : "string"
        },
        "SecurityGroupIds" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string",
            "maxLength" : 20,
            "minLength" : 11,
            "pattern" : "^sg-[0-9a-f]{8,17}$"
          }
        }
      },
      "additionalProperties" : false
    },
    "EndpointType" : {
      "type" : "string",
      "enum" : [ "PUBLIC", "VPC", "VPC_ENDPOINT" ]
    },
    "IdentityProviderDetails" : {
      "type" : "object",
      "properties" : {
        "Url" : {
          "type" : "string",
          "maxLength" : 255,
          "minLength" : 0
        },
        "InvocationRole" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 20,
          "pattern" : "^arn:.*role/\\S+$"
        },
        "DirectoryId" : {
          "type" : "string",
          "maxLength" : 12,
          "minLength" : 12,
          "pattern" : "^d-[0-9a-f]{10}$"
        },
        "Function" : {
          "type" : "string",
          "maxLength" : 170,
          "minLength" : 1,
          "pattern" : "^arn:[a-z-]+:lambda:.*$"
        },
        "SftpAuthenticationMethods" : {
          "$ref" : "#/definitions/SftpAuthenticationMethods"
        }
      },
      "additionalProperties" : false
    },
    "IdentityProviderType" : {
      "type" : "string",
      "enum" : [ "SERVICE_MANAGED", "API_GATEWAY", "AWS_DIRECTORY_SERVICE", "AWS_LAMBDA" ]
    },
    "IpAddressType" : {
      "type" : "string",
      "enum" : [ "IPV4", "DUALSTACK" ]
    },
    "Protocol" : {
      "type" : "string",
      "enum" : [ "SFTP", "FTP", "FTPS", "AS2" ]
    },
    "ProtocolDetails" : {
      "type" : "object",
      "properties" : {
        "PassiveIp" : {
          "type" : "string",
          "maxLength" : 15,
          "minLength" : 0
        },
        "TlsSessionResumptionMode" : {
          "$ref" : "#/definitions/TlsSessionResumptionMode"
        },
        "SetStatOption" : {
          "$ref" : "#/definitions/SetStatOption"
        },
        "As2Transports" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/As2Transport"
          },
          "maxItems" : 1,
          "minItems" : 1
        }
      },
      "additionalProperties" : false
    },
    "S3StorageOptions" : {
      "type" : "object",
      "properties" : {
        "DirectoryListingOptimization" : {
          "$ref" : "#/definitions/DirectoryListingOptimization"
        }
      },
      "additionalProperties" : false
    },
    "SetStatOption" : {
      "type" : "string",
      "enum" : [ "DEFAULT", "ENABLE_NO_OP" ]
    },
    "SftpAuthenticationMethods" : {
      "type" : "string",
      "enum" : [ "PASSWORD", "PUBLIC_KEY", "PUBLIC_KEY_OR_PASSWORD", "PUBLIC_KEY_AND_PASSWORD" ]
    },
    "State" : {
      "type" : "string",
      "enum" : [ "OFFLINE", "ONLINE", "STARTING", "STOPPING", "START_FAILED", "STOP_FAILED" ]
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 0
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "TlsSessionResumptionMode" : {
      "type" : "string",
      "enum" : [ "DISABLED", "ENABLED", "ENFORCED" ]
    },
    "WorkflowDetail" : {
      "type" : "object",
      "properties" : {
        "WorkflowId" : {
          "type" : "string",
          "maxLength" : 19,
          "minLength" : 19,
          "pattern" : "^w-([a-z0-9]{17})$"
        },
        "ExecutionRole" : {
          "type" : "string",
          "maxLength" : 2048,
          "minLength" : 20,
          "pattern" : "^arn:.*role/\\S+$"
        }
      },
      "required" : [ "ExecutionRole", "WorkflowId" ],
      "additionalProperties" : false
    },
    "WorkflowDetails" : {
      "type" : "object",
      "properties" : {
        "OnUpload" : {
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "$ref" : "#/definitions/WorkflowDetail"
          },
          "maxItems" : 1,
          "minItems" : 0
        },
        "OnPartialUpload" : {
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "$ref" : "#/definitions/WorkflowDetail"
          },
          "maxItems" : 1,
          "minItems" : 0
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Arn" : {
      "type" : "string",
      "maxLength" : 1600,
      "minLength" : 20,
      "pattern" : "^arn:\\S+$"
    },
    "As2ServiceManagedEgressIpAddresses" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "type" : "string",
        "pattern" : "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$"
      },
      "description" : "The list of egress IP addresses of this server. These IP addresses are only relevant for servers that use the AS2 protocol. They are used for sending asynchronous MDNs. These IP addresses are assigned automatically when you create an AS2 server. Additionally, if you update an existing server and add the AS2 protocol, static IP addresses are assigned as well."
    },
    "Certificate" : {
      "type" : "string",
      "maxLength" : 1600,
      "minLength" : 0
    },
    "Domain" : {
      "$ref" : "#/definitions/Domain"
    },
    "EndpointDetails" : {
      "$ref" : "#/definitions/EndpointDetails"
    },
    "EndpointType" : {
      "$ref" : "#/definitions/EndpointType"
    },
    "IdentityProviderDetails" : {
      "$ref" : "#/definitions/IdentityProviderDetails"
    },
    "IdentityProviderType" : {
      "$ref" : "#/definitions/IdentityProviderType"
    },
    "IpAddressType" : {
      "$ref" : "#/definitions/IpAddressType"
    },
    "LoggingRole" : {
      "type" : "string",
      "maxLength" : 2048,
      "minLength" : 0,
      "pattern" : "^(|arn:.*role/\\S+)$"
    },
    "PostAuthenticationLoginBanner" : {
      "type" : "string",
      "maxLength" : 4096,
      "minLength" : 0,
      "pattern" : "^[\\x09-\\x0D\\x20-\\x7E]*$"
    },
    "PreAuthenticationLoginBanner" : {
      "type" : "string",
      "maxLength" : 4096,
      "minLength" : 0,
      "pattern" : "^[\\x09-\\x0D\\x20-\\x7E]*$"
    },
    "ProtocolDetails" : {
      "$ref" : "#/definitions/ProtocolDetails"
    },
    "Protocols" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Protocol"
      },
      "maxItems" : 4,
      "minItems" : 1
    },
    "S3StorageOptions" : {
      "$ref" : "#/definitions/S3StorageOptions"
    },
    "SecurityPolicyName" : {
      "type" : "string",
      "maxLength" : 100,
      "minLength" : 0,
      "pattern" : "^TransferSecurityPolicy-.+$"
    },
    "ServerId" : {
      "type" : "string",
      "maxLength" : 19,
      "minLength" : 19,
      "pattern" : "^s-([0-9a-f]{17})$"
    },
    "State" : {
      "$ref" : "#/definitions/State"
    },
    "StructuredLogDestinations" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "type" : "string",
        "maxLength" : 1600,
        "minLength" : 20,
        "pattern" : "^arn:\\S+$"
      },
      "maxItems" : 1,
      "minItems" : 0
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 50,
      "minItems" : 1
    },
    "WorkflowDetails" : {
      "$ref" : "#/definitions/WorkflowDetails"
    }
  },
  "readOnlyProperties" : [ "/properties/Arn", "/properties/As2ServiceManagedEgressIpAddresses", "/properties/ServerId", "/properties/State" ],
  "createOnlyProperties" : [ "/properties/Domain" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "additionalIdentifiers" : [ [ "/properties/ServerId" ] ],
  "handlers" : {
    "create" : {
      "permissions" : [ "apigateway:GET", "ds:AuthorizeApplication", "ds:DescribeDirectories", "ec2:AssociateAddress", "ec2:CreateVpcEndpoint", "ec2:DescribeAddresses", "ec2:DescribeNetworkInterfaces", "ec2:DescribeVpcEndpoints", "iam:PassRole", "logs:CreateLogDelivery", "logs:DeleteLogDelivery", "logs:DescribeLogGroups", "logs:DescribeResourcePolicies", "logs:GetLogDelivery", "logs:ListLogDeliveries", "logs:PutResourcePolicy", "logs:UpdateLogDelivery", "transfer:CreateServer", "transfer:DescribeServer", "transfer:StartServer", "transfer:StopServer", "transfer:TagResource", "transfer:UpdateServer" ]
    },
    "read" : {
      "permissions" : [ "ec2:DescribeVpcEndpoints", "transfer:DescribeServer" ]
    },
    "update" : {
      "permissions" : [ "apigateway:GET", "ds:AuthorizeApplication", "ds:DescribeDirectories", "ds:UnauthorizeApplication", "ec2:AssociateAddress", "ec2:CreateVpcEndpoint", "ec2:DeleteVpcEndpoints", "ec2:DescribeAddresses", "ec2:DescribeNetworkInterfaces", "ec2:DescribeVpcEndpoints", "ec2:DisassociateAddress", "ec2:ModifyVpcEndpoint", "iam:PassRole", "logs:CreateLogDelivery", "logs:DeleteLogDelivery", "logs:DescribeLogGroups", "logs:DescribeResourcePolicies", "logs:GetLogDelivery", "logs:ListLogDeliveries", "logs:PutResourcePolicy", "logs:UpdateLogDelivery", "transfer:DescribeServer", "transfer:StartServer", "transfer:StopServer", "transfer:TagResource", "transfer:UnTagResource", "transfer:UpdateServer" ]
    },
    "delete" : {
      "permissions" : [ "ds:DescribeDirectories", "ds:UnauthorizeApplication", "ec2:DeleteVpcEndpoints", "ec2:DescribeAddresses", "ec2:DescribeNetworkInterfaces", "ec2:DescribeVpcEndpoints", "ec2:DisassociateAddress", "logs:DeleteLogDelivery", "logs:GetLogDelivery", "logs:ListLogDeliveries", "transfer:DeleteServer" ]
    },
    "list" : {
      "permissions" : [ "transfer:ListServers" ]
    }
  },
  "tagging" : {
    "cloudFormationSystemTags" : true,
    "permissions" : [ "transfer:TagResource", "transfer:UnTagResource", "transfer:ListTagsForResource" ],
    "tagOnCreate" : true,
    "tagProperty" : "/properties/Tags",
    "tagUpdatable" : true,
    "taggable" : true
  },
  "additionalProperties" : false,
  "conditionalCreateOnlyProperties" : [ "/properties/EndpointDetails", "/properties/EndpointDetails/AddressAllocationIds", "/properties/IpAddressType" ],
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-transfer"
}