{
  "typeName" : "AWS::Amplify::Domain",
  "description" : "The AWS::Amplify::Domain resource allows you to connect a custom domain to your app.",
  "additionalProperties" : false,
  "properties" : {
    "AppId" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 20,
      "pattern" : "d[a-z0-9]+"
    },
    "Arn" : {
      "type" : "string",
      "maxLength" : 1000,
      "pattern" : "(?s).*"
    },
    "AutoSubDomainCreationPatterns" : {
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "type" : "string",
        "minLength" : 1,
        "maxLength" : 2048,
        "pattern" : "(?s).+"
      }
    },
    "AutoSubDomainIAMRole" : {
      "type" : "string",
      "pattern" : "^$|^arn:.+:iam::\\d{12}:role.+",
      "maxLength" : 1000
    },
    "CertificateRecord" : {
      "type" : "string",
      "maxLength" : 1000
    },
    "DomainName" : {
      "type" : "string",
      "pattern" : "^(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])(\\.)?$",
      "maxLength" : 255
    },
    "DomainStatus" : {
      "type" : "string"
    },
    "EnableAutoSubDomain" : {
      "type" : "boolean"
    },
    "StatusReason" : {
      "type" : "string",
      "maxLength" : 1000
    },
    "SubDomainSettings" : {
      "type" : "array",
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/SubDomainSetting"
      },
      "maxItems" : 255
    }
  },
  "definitions" : {
    "SubDomainSetting" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Prefix" : {
          "type" : "string",
          "maxLength" : 255,
          "pattern" : "(?s).*"
        },
        "BranchName" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "(?s).+"
        }
      },
      "required" : [ "Prefix", "BranchName" ]
    }
  },
  "required" : [ "AppId", "DomainName", "SubDomainSettings" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/AppId", "/properties/DomainName" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/DomainStatus", "/properties/StatusReason", "/properties/CertificateRecord" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "amplify:CreateDomainAssociation", "route53:ListHostedZones", "route53:ChangeResourceRecordSets", "iam:PassRole", "amplify:TagResource" ]
    },
    "delete" : {
      "permissions" : [ "amplify:DeleteDomainAssociation", "iam:PassRole", "amplify:DeleteDomainAssociation" ]
    },
    "list" : {
      "permissions" : [ "amplify:ListDomainAssociations", "iam:PassRole", "amplify:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "amplify:GetDomainAssociation", "route53:ListHostedZones", "iam:PassRole", "amplify:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "amplify:UpdateDomainAssociation", "route53:ListHostedZones", "route53:ChangeResourceRecordSets", "iam:PassRole", "amplify:ListTagsForResource", "amplify:TagResource", "amplify:UntagResource" ]
    }
  }
}