{
  "typeName" : "AWS::Transfer::Connector",
  "description" : "Resource Type definition for AWS::Transfer::Connector",
  "definitions" : {
    "Tag" : {
      "description" : "Creates a key-value pair for a specific resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The name assigned to the tag that you create.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "Contains one or more values that you assigned to the key name you create.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "ServerId" : {
      "description" : "A unique identifier for the server.",
      "type" : "string",
      "pattern" : "^s-([0-9a-f]{17})$",
      "minLength" : 19,
      "maxLength" : 19
    },
    "SftpConnectorTrustedHostKey" : {
      "description" : "The public host key for the external server to which you are connecting.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 2048
    },
    "ConnectorEgressType" : {
      "type" : "string",
      "enum" : [ "SERVICE_MANAGED", "VPC_LATTICE" ]
    },
    "ConnectorVpcLatticeEgressConfig" : {
      "type" : "object",
      "properties" : {
        "ResourceConfigurationArn" : {
          "type" : "string",
          "description" : "ARN of the VPC Lattice resource configuration",
          "minLength" : 1,
          "maxLength" : 2048,
          "pattern" : "^arn:[a-z0-9\\-]+:vpc-lattice:[a-zA-Z0-9\\-]+:\\d{12}:resourceconfiguration/rcfg-[0-9a-z]{17}$"
        },
        "PortNumber" : {
          "type" : "integer",
          "description" : "Port to connect to on the target VPC Lattice resource",
          "minimum" : 1,
          "maximum" : 65535
        }
      },
      "required" : [ "ResourceConfigurationArn" ],
      "additionalProperties" : false
    },
    "ConnectorEgressConfig" : {
      "type" : "object",
      "properties" : {
        "VpcLattice" : {
          "$ref" : "#/definitions/ConnectorVpcLatticeEgressConfig"
        }
      },
      "required" : [ "VpcLattice" ],
      "additionalProperties" : false
    },
    "ConnectorStatus" : {
      "type" : "string",
      "enum" : [ "ACTIVE", "PENDING", "ERRORED" ]
    },
    "ConnectorAsyncMdnConfig" : {
      "type" : "object",
      "properties" : {
        "Url" : {
          "type" : "string",
          "description" : "URL of the server to receive the MDN response on"
        },
        "ServerIds" : {
          "type" : "array",
          "minItems" : 1,
          "maxItems" : 10,
          "uniqueItems" : true,
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/ServerId"
          }
        }
      },
      "required" : [ "Url", "ServerIds" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "AccessRole" : {
      "description" : "Specifies the access role for the connector.",
      "type" : "string",
      "pattern" : "arn:.*role/.*",
      "minLength" : 20,
      "maxLength" : 2048
    },
    "As2Config" : {
      "description" : "Configuration for an AS2 connector.",
      "type" : "object",
      "properties" : {
        "LocalProfileId" : {
          "type" : "string",
          "description" : "A unique identifier for the local profile.",
          "pattern" : "^p-([0-9a-f]{17})$",
          "minLength" : 19,
          "maxLength" : 19
        },
        "PartnerProfileId" : {
          "type" : "string",
          "description" : "A unique identifier for the partner profile.",
          "pattern" : "^p-([0-9a-f]{17})$",
          "minLength" : 19,
          "maxLength" : 19
        },
        "MessageSubject" : {
          "type" : "string",
          "description" : "The message subject for this AS2 connector configuration.",
          "pattern" : "^[\\u0020-\\u007E\\t]+$",
          "minLength" : 1,
          "maxLength" : 1024
        },
        "Compression" : {
          "type" : "string",
          "description" : "Compression setting for this AS2 connector configuration.",
          "enum" : [ "ZLIB", "DISABLED" ]
        },
        "EncryptionAlgorithm" : {
          "type" : "string",
          "description" : "Encryption algorithm for this AS2 connector configuration.",
          "enum" : [ "AES128_CBC", "AES192_CBC", "AES256_CBC", "NONE", "DES_EDE3_CBC" ]
        },
        "SigningAlgorithm" : {
          "type" : "string",
          "description" : "Signing algorithm for this AS2 connector configuration.",
          "enum" : [ "SHA256", "SHA384", "SHA512", "SHA1", "NONE" ]
        },
        "MdnSigningAlgorithm" : {
          "type" : "string",
          "description" : "MDN Signing algorithm for this AS2 connector configuration.",
          "enum" : [ "SHA256", "SHA384", "SHA512", "SHA1", "NONE", "DEFAULT" ]
        },
        "MdnResponse" : {
          "type" : "string",
          "description" : "MDN Response setting for this AS2 connector configuration.",
          "enum" : [ "SYNC", "ASYNC", "NONE" ]
        },
        "BasicAuthSecretId" : {
          "type" : "string",
          "description" : "ARN or name of the secret in AWS Secrets Manager which contains the credentials for Basic authentication. If empty, Basic authentication is disabled for the AS2 connector",
          "minLength" : 0,
          "maxLength" : 2048
        },
        "PreserveContentType" : {
          "description" : "Specifies whether to use the AWS S3 object content-type as the content-type for the AS2 message.",
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "AsyncMdnConfig" : {
          "description" : "Configuration for an AS2 connector with ASYNC MDN Response",
          "$ref" : "#/definitions/ConnectorAsyncMdnConfig"
        }
      },
      "additionalProperties" : false
    },
    "EgressType" : {
      "description" : "Specifies the egress type for the connector.",
      "$ref" : "#/definitions/ConnectorEgressType"
    },
    "EgressConfig" : {
      "description" : "Egress configuration for the connector.",
      "$ref" : "#/definitions/ConnectorEgressConfig"
    },
    "Status" : {
      "$ref" : "#/definitions/ConnectorStatus"
    },
    "SftpConfig" : {
      "description" : "Configuration for an SFTP connector.",
      "type" : "object",
      "properties" : {
        "UserSecretId" : {
          "type" : "string",
          "description" : "ARN or name of the secret in AWS Secrets Manager which contains the SFTP user's private keys or passwords.",
          "minLength" : 1,
          "maxLength" : 2048
        },
        "TrustedHostKeys" : {
          "description" : "List of public host keys, for the external server to which you are connecting.",
          "type" : "array",
          "maxItems" : 10,
          "uniqueItems" : false,
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/SftpConnectorTrustedHostKey"
          }
        },
        "MaxConcurrentConnections" : {
          "description" : "Specifies the number of active connections that your connector can establish with the remote server at the same time.",
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 5,
          "default" : 1
        }
      },
      "additionalProperties" : false
    },
    "Arn" : {
      "description" : "Specifies the unique Amazon Resource Name (ARN) for the connector.",
      "type" : "string",
      "pattern" : "arn:.*",
      "minLength" : 20,
      "maxLength" : 1600
    },
    "ConnectorId" : {
      "description" : "A unique identifier for the connector.",
      "type" : "string",
      "pattern" : "^c-([0-9a-f]{17})$",
      "minLength" : 19,
      "maxLength" : 19
    },
    "LoggingRole" : {
      "description" : "Specifies the logging role for the connector.",
      "type" : "string",
      "pattern" : "arn:.*role/.*",
      "minLength" : 20,
      "maxLength" : 2048
    },
    "ServiceManagedEgressIpAddresses" : {
      "description" : "The list of egress IP addresses of this connector. These IP addresses are assigned automatically when you create the connector.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "type" : "string",
        "pattern" : "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$"
      }
    },
    "Tags" : {
      "description" : "Key-value pairs that can be used to group and search for connectors. Tags are metadata attached to connectors for any purpose.",
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Url" : {
      "description" : "URL for Connector",
      "type" : "string",
      "maxLength" : 255
    },
    "SecurityPolicyName" : {
      "description" : "Security policy for SFTP Connector",
      "type" : "string",
      "pattern" : "TransferSFTPConnectorSecurityPolicy-[A-Za-z0-9-]+",
      "maxLength" : 50
    },
    "ErrorMessage" : {
      "description" : "Detailed error message when Connector in ERRORED status",
      "type" : "string",
      "maxLength" : 2048
    }
  },
  "additionalProperties" : false,
  "required" : [ "AccessRole" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/ConnectorId", "/properties/ServiceManagedEgressIpAddresses", "/properties/Status", "/properties/ErrorMessage" ],
  "primaryIdentifier" : [ "/properties/ConnectorId" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "transfer:ListTagsForResource", "transfer:UnTagResource", "transfer:TagResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "transfer:CreateConnector", "transfer:DescribeConnector", "transfer:TagResource", "iam:PassRole", "vpc-lattice:CreateServiceNetworkResourceAssociation", "vpc-lattice:GetResourceConfiguration", "vpc-lattice:AssociateViaAWSService" ]
    },
    "read" : {
      "permissions" : [ "transfer:DescribeConnector" ]
    },
    "update" : {
      "permissions" : [ "transfer:UpdateConnector", "transfer:DescribeConnector", "transfer:UnTagResource", "transfer:TagResource", "iam:PassRole", "vpc-lattice:CreateServiceNetworkResourceAssociation", "vpc-lattice:GetResourceConfiguration", "vpc-lattice:AssociateViaAWSService" ]
    },
    "delete" : {
      "permissions" : [ "transfer:DeleteConnector" ]
    },
    "list" : {
      "permissions" : [ "transfer:ListConnectors" ]
    }
  }
}