{
  "typeName" : "AWS::Cognito::UserPoolDomain",
  "description" : "Resource Type definition for AWS::Cognito::UserPoolDomain",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "tagging" : {
    "taggable" : false,
    "tagOnCreate" : false,
    "tagUpdatable" : false,
    "cloudFormationSystemTags" : false
  },
  "definitions" : {
    "CustomDomainConfigType" : {
      "type" : "object",
      "properties" : {
        "CertificateArn" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "FailoverType" : {
      "type" : "object",
      "properties" : {
        "SecondaryRegion" : {
          "type" : "string"
        },
        "PrimaryRoute53HealthCheckId" : {
          "type" : "string"
        }
      },
      "required" : [ "SecondaryRegion", "PrimaryRoute53HealthCheckId" ],
      "additionalProperties" : false
    },
    "RoutingType" : {
      "type" : "object",
      "properties" : {
        "Failover" : {
          "$ref" : "#/definitions/FailoverType"
        }
      },
      "additionalProperties" : false
    }
  },
  "properties" : {
    "UserPoolId" : {
      "type" : "string"
    },
    "Domain" : {
      "type" : "string"
    },
    "CustomDomainConfig" : {
      "$ref" : "#/definitions/CustomDomainConfigType"
    },
    "CloudFrontDistribution" : {
      "type" : "string"
    },
    "ManagedLoginVersion" : {
      "type" : "integer"
    },
    "Routing" : {
      "$ref" : "#/definitions/RoutingType"
    }
  },
  "additionalProperties" : false,
  "required" : [ "UserPoolId", "Domain" ],
  "readOnlyProperties" : [ "/properties/CloudFrontDistribution" ],
  "primaryIdentifier" : [ "/properties/UserPoolId", "/properties/Domain" ],
  "createOnlyProperties" : [ "/properties/UserPoolId", "/properties/Domain" ],
  "writeOnlyProperties" : [ "/properties/ManagedLoginVersion" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "cognito-idp:CreateUserPoolDomain", "cognito-idp:DescribeUserPoolDomain", "cloudfront:updateDistribution", "kms:CreateGrant", "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:GenerateDataKeyWithoutPlaintext", "kms:ReEncryptFrom", "kms:ReEncryptTo" ],
      "timeoutInMinutes" : 20
    },
    "read" : {
      "permissions" : [ "cognito-idp:DescribeUserPoolDomain", "kms:CreateGrant", "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:GenerateDataKeyWithoutPlaintext", "kms:ReEncryptFrom", "kms:ReEncryptTo" ]
    },
    "update" : {
      "permissions" : [ "cognito-idp:UpdateUserPoolDomain", "cognito-idp:DescribeUserPoolDomain", "cloudfront:updateDistribution", "kms:CreateGrant", "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:GenerateDataKeyWithoutPlaintext", "kms:ReEncryptFrom", "kms:ReEncryptTo" ],
      "timeoutInMinutes" : 20
    },
    "delete" : {
      "permissions" : [ "cognito-idp:DeleteUserPoolDomain", "cognito-idp:DescribeUserPoolDomain", "kms:CreateGrant", "kms:Decrypt", "kms:DescribeKey", "kms:Encrypt", "kms:GenerateDataKeyWithoutPlaintext", "kms:ReEncryptFrom", "kms:ReEncryptTo" ],
      "timeoutInMinutes" : 25
    }
  }
}