{
  "typeName" : "AWS::Connect::EmailAddress",
  "description" : "Resource Type definition for AWS::Connect::EmailAddress",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-connect",
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.",
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "AliasConfiguration" : {
      "description" : "Configuration for an email address alias",
      "type" : "object",
      "properties" : {
        "EmailAddressArn" : {
          "description" : "The identifier of the email address alias",
          "type" : "string",
          "pattern" : "^arn:(aws|aws-us-gov):connect:[a-z]{2}-[a-z]+-[0-9]{1}:[0-9]{1,20}:instance/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/email-address/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
        }
      },
      "required" : [ "EmailAddressArn" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "InstanceArn" : {
      "description" : "The identifier of the Amazon Connect instance.",
      "type" : "string",
      "pattern" : "^arn:(aws|aws-us-gov):connect:[a-z]{2}-[a-z]+-[0-9]{1}:[0-9]{1,20}:instance/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
      "minLength" : 1,
      "maxLength" : 250
    },
    "EmailAddressArn" : {
      "description" : "The identifier of the email address.",
      "type" : "string",
      "pattern" : "^arn:(aws|aws-us-gov):connect:[a-z]{2}-[a-z]+-[0-9]{1}:[0-9]{1,20}:instance/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/email-address/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
    },
    "Description" : {
      "description" : "A description for the email address.",
      "type" : "string",
      "pattern" : "(^[\\S].*[\\S]$)|(^[\\S]$)",
      "minLength" : 1,
      "maxLength" : 250
    },
    "EmailAddress" : {
      "description" : "Email address to be created for this instance",
      "type" : "string",
      "pattern" : "([^\\s@]+@[^\\s@]+\\.[^\\s@]+)",
      "minLength" : 1,
      "maxLength" : 255
    },
    "DisplayName" : {
      "description" : "The display name for the email address.",
      "type" : "string",
      "pattern" : "(^[\\S].*[\\S]$)|(^[\\S]$)",
      "minLength" : 0,
      "maxLength" : 256
    },
    "AliasConfigurations" : {
      "description" : "List of alias configurations for the email address",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/AliasConfiguration"
      },
      "maxItems" : 1,
      "insertionOrder" : false
    },
    "Tags" : {
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "description" : "One or more tags.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "connect:TagResource", "connect:UntagResource" ]
  },
  "additionalProperties" : false,
  "required" : [ "InstanceArn", "EmailAddress" ],
  "readOnlyProperties" : [ "/properties/EmailAddressArn" ],
  "createOnlyProperties" : [ "/properties/EmailAddress" ],
  "primaryIdentifier" : [ "/properties/EmailAddressArn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "connect:CreateEmailAddress", "connect:AssociateEmailAddressAlias", "connect:TagResource", "connect:ListIntegrationAssociations", "ses:GetEmailIdentity", "ses:DescribeReceiptRule", "ses:UpdateReceiptRule", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "connect:DescribeEmailAddress" ]
    },
    "update" : {
      "permissions" : [ "connect:UpdateEmailAddressMetadata", "connect:AssociateEmailAddressAlias", "connect:DisassociateEmailAddressAlias", "connect:TagResource", "connect:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "connect:DeleteEmailAddress", "connect:DisassociateEmailAddressAlias", "connect:UntagResource", "iam:PassRole", "ses:DescribeReceiptRule", "ses:UpdateReceiptRule" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "InstanceArn" : {
            "$ref" : "resource-schema.json#/properties/InstanceArn"
          }
        },
        "required" : [ "InstanceArn" ]
      },
      "permissions" : [ "connect:DescribeEmailAddress", "connect:SearchEmailAddresses" ]
    }
  }
}