{
  "typeName" : "AWS::Redshift::EventSubscription",
  "description" : "The `AWS::Redshift::EventSubscription` resource creates an Amazon Redshift Event Subscription.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-redshift",
  "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 -.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "SubscriptionName" : {
      "description" : "The name of the Amazon Redshift event notification subscription",
      "type" : "string",
      "pattern" : "^(?=^[a-z][a-z0-9]*(-[a-z0-9]+)*$).{1,255}$"
    },
    "SnsTopicArn" : {
      "description" : "The Amazon Resource Name (ARN) of the Amazon SNS topic used to transmit the event notifications.",
      "type" : "string"
    },
    "SourceType" : {
      "description" : "The type of source that will be generating the events.",
      "type" : "string",
      "enum" : [ "cluster", "cluster-parameter-group", "cluster-security-group", "cluster-snapshot", "scheduled-action" ]
    },
    "SourceIds" : {
      "description" : "A list of one or more identifiers of Amazon Redshift source objects.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "type" : "string"
      }
    },
    "EventCategories" : {
      "description" : "Specifies the Amazon Redshift event categories to be published by the event notification subscription.",
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "type" : "string",
        "enum" : [ "configuration", "management", "monitoring", "security", "pending" ]
      }
    },
    "Severity" : {
      "description" : "Specifies the Amazon Redshift event severity to be published by the event notification subscription.",
      "type" : "string",
      "enum" : [ "ERROR", "INFO" ]
    },
    "Enabled" : {
      "description" : "A boolean value; set to true to activate the subscription, and set to false to create the subscription but not activate it.",
      "type" : "boolean"
    },
    "Tags" : {
      "description" : "An array of key-value pairs to apply to this resource.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "CustomerAwsId" : {
      "description" : "The AWS account associated with the Amazon Redshift event notification subscription.",
      "type" : "string"
    },
    "CustSubscriptionId" : {
      "description" : "The name of the Amazon Redshift event notification subscription.",
      "type" : "string"
    },
    "Status" : {
      "description" : "The status of the Amazon Redshift event notification subscription.",
      "type" : "string",
      "enum" : [ "active", "no-permission", "topic-not-exist" ]
    },
    "SubscriptionCreationTime" : {
      "description" : "The date and time the Amazon Redshift event notification subscription was created.",
      "type" : "string"
    },
    "SourceIdsList" : {
      "description" : "A list of the sources that publish events to the Amazon Redshift event notification subscription.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "type" : "string"
      }
    },
    "EventCategoriesList" : {
      "description" : "The list of Amazon Redshift event categories specified in the event notification subscription.",
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "type" : "string"
      }
    }
  },
  "tagging" : {
    "taggable" : true
  },
  "additionalProperties" : false,
  "required" : [ "SubscriptionName" ],
  "primaryIdentifier" : [ "/properties/SubscriptionName" ],
  "createOnlyProperties" : [ "/properties/SubscriptionName" ],
  "readOnlyProperties" : [ "/properties/CustomerAwsId", "/properties/CustSubscriptionId", "/properties/Status", "/properties/SubscriptionCreationTime", "/properties/SourceIdsList", "/properties/EventCategoriesList" ],
  "writeOnlyProperties" : [ "/properties/Tags", "/properties/Tags/*/Key", "/properties/Tags/*/Value" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "redshift:CreateEventSubscription", "redshift:CreateTags" ]
    },
    "read" : {
      "permissions" : [ "redshift:DescribeEventSubscriptions", "redshift:DescribeTags" ]
    },
    "update" : {
      "permissions" : [ "redshift:ModifyEventSubscription", "redshift:CreateTags", "redshift:DescribeTags", "redshift:DeleteTags" ]
    },
    "delete" : {
      "permissions" : [ "redshift:DeleteEventSubscription", "redshift:DeleteTags" ]
    },
    "list" : {
      "permissions" : [ "redshift:DescribeEventSubscriptions" ]
    }
  }
}