{
  "typeName" : "AWS::Redshift::ScheduledAction",
  "description" : "The `AWS::Redshift::ScheduledAction` resource creates an Amazon Redshift Scheduled Action.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-redshift",
  "definitions" : {
    "ResizeClusterMessage" : {
      "description" : "Describes a resize cluster operation. For example, a scheduled action to run the `ResizeCluster` API operation.",
      "type" : "object",
      "properties" : {
        "ClusterIdentifier" : {
          "type" : "string"
        },
        "ClusterType" : {
          "type" : "string"
        },
        "NodeType" : {
          "type" : "string"
        },
        "NumberOfNodes" : {
          "type" : "integer"
        },
        "Classic" : {
          "type" : "boolean"
        }
      },
      "required" : [ "ClusterIdentifier" ],
      "additionalProperties" : false
    },
    "PauseClusterMessage" : {
      "description" : "Describes a pause cluster operation. For example, a scheduled action to run the `PauseCluster` API operation.",
      "type" : "object",
      "properties" : {
        "ClusterIdentifier" : {
          "type" : "string"
        }
      },
      "required" : [ "ClusterIdentifier" ],
      "additionalProperties" : false
    },
    "ResumeClusterMessage" : {
      "description" : "Describes a resume cluster operation. For example, a scheduled action to run the `ResumeCluster` API operation.",
      "type" : "object",
      "properties" : {
        "ClusterIdentifier" : {
          "type" : "string"
        }
      },
      "required" : [ "ClusterIdentifier" ],
      "additionalProperties" : false
    },
    "ScheduledActionType" : {
      "type" : "object",
      "oneOf" : [ {
        "properties" : {
          "ResizeCluster" : {
            "$ref" : "#/definitions/ResizeClusterMessage"
          }
        },
        "additionalProperties" : false
      }, {
        "properties" : {
          "PauseCluster" : {
            "$ref" : "#/definitions/PauseClusterMessage"
          }
        },
        "additionalProperties" : false
      }, {
        "properties" : {
          "ResumeCluster" : {
            "$ref" : "#/definitions/ResumeClusterMessage"
          }
        },
        "additionalProperties" : false
      } ]
    },
    "timestamp" : {
      "type" : "string"
    }
  },
  "properties" : {
    "ScheduledActionName" : {
      "description" : "The name of the scheduled action. The name must be unique within an account.",
      "type" : "string",
      "pattern" : "^(?=^[a-z][a-z0-9]*(-[a-z0-9]+)*$).{1,60}$"
    },
    "TargetAction" : {
      "description" : "A JSON format string of the Amazon Redshift API operation with input parameters.",
      "$ref" : "#/definitions/ScheduledActionType"
    },
    "Schedule" : {
      "description" : "The schedule in `at( )` or `cron( )` format.",
      "type" : "string"
    },
    "IamRole" : {
      "description" : "The IAM role to assume to run the target action.",
      "type" : "string"
    },
    "ScheduledActionDescription" : {
      "description" : "The description of the scheduled action.",
      "type" : "string",
      "pattern" : "^(?=^[\\x09\\x0a\\x0d\\x20-\\xff]*$).{1,255}$"
    },
    "StartTime" : {
      "description" : "The start time in UTC of the scheduled action. Before this time, the scheduled action does not trigger.",
      "$ref" : "#/definitions/timestamp"
    },
    "EndTime" : {
      "description" : "The end time in UTC of the scheduled action. After this time, the scheduled action does not trigger.",
      "$ref" : "#/definitions/timestamp"
    },
    "Enable" : {
      "description" : "If true, the schedule is enabled. If false, the scheduled action does not trigger.",
      "type" : "boolean"
    },
    "State" : {
      "description" : "The state of the scheduled action.",
      "type" : "string",
      "enum" : [ "ACTIVE", "DISABLED" ]
    },
    "NextInvocations" : {
      "description" : "List of times when the scheduled action will run.",
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/timestamp"
      }
    }
  },
  "tagging" : {
    "taggable" : false
  },
  "additionalProperties" : false,
  "required" : [ "ScheduledActionName" ],
  "primaryIdentifier" : [ "/properties/ScheduledActionName" ],
  "createOnlyProperties" : [ "/properties/ScheduledActionName" ],
  "readOnlyProperties" : [ "/properties/State", "/properties/NextInvocations" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "redshift:CreateScheduledAction", "redshift:PauseCluster", "redshift:ResumeCluster", "redshift:ResizeCluster", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "redshift:DescribeScheduledActions" ]
    },
    "update" : {
      "permissions" : [ "redshift:ModifyScheduledAction", "redshift:PauseCluster", "redshift:ResumeCluster", "redshift:ResizeCluster", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "redshift:DeleteScheduledAction" ]
    },
    "list" : {
      "permissions" : [ "redshift:DescribeScheduledActions" ]
    }
  }
}