{
  "typeName" : "AWS::ApiGateway::Deployment",
  "description" : "Resource Type definition for AWS::ApiGateway::Deployment",
  "additionalProperties" : false,
  "properties" : {
    "DeploymentId" : {
      "type" : "string",
      "description" : "Primary Id for this resource"
    },
    "DeploymentCanarySettings" : {
      "$ref" : "#/definitions/DeploymentCanarySettings",
      "description" : "Specifies settings for the canary deployment."
    },
    "Description" : {
      "type" : "string",
      "description" : "A description of the purpose of the API Gateway deployment."
    },
    "RestApiId" : {
      "type" : "string",
      "description" : "The ID of the RestApi resource to deploy. "
    },
    "StageDescription" : {
      "$ref" : "#/definitions/StageDescription",
      "description" : "Configures the stage that API Gateway creates with this deployment."
    },
    "StageName" : {
      "type" : "string",
      "description" : "A name for the stage that API Gateway creates with this deployment. Use only alphanumeric characters."
    }
  },
  "definitions" : {
    "StageDescription" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AccessLogSetting" : {
          "description" : "Specifies settings for logging access in this stage.",
          "$ref" : "#/definitions/AccessLogSetting"
        },
        "CacheClusterEnabled" : {
          "description" : "Indicates whether cache clustering is enabled for the stage.",
          "type" : "boolean"
        },
        "CacheClusterSize" : {
          "description" : "The size of the stage's cache cluster.",
          "type" : "string"
        },
        "CacheDataEncrypted" : {
          "description" : "The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches responses. ",
          "type" : "boolean"
        },
        "CacheTtlInSeconds" : {
          "description" : "The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches responses. ",
          "type" : "integer"
        },
        "CachingEnabled" : {
          "description" : "Indicates whether responses are cached and returned for requests. You must enable a cache cluster on the stage to cache responses.",
          "type" : "boolean"
        },
        "CanarySetting" : {
          "description" : "Specifies settings for the canary deployment in this stage.",
          "$ref" : "#/definitions/CanarySetting"
        },
        "ClientCertificateId" : {
          "description" : "The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage. ",
          "type" : "string"
        },
        "DataTraceEnabled" : {
          "description" : "Indicates whether data trace logging is enabled for methods in the stage. API Gateway pushes these logs to Amazon CloudWatch Logs. ",
          "type" : "boolean"
        },
        "Description" : {
          "description" : "A description of the purpose of the stage.",
          "type" : "string"
        },
        "DocumentationVersion" : {
          "description" : "The version identifier of the API documentation snapshot.",
          "type" : "string"
        },
        "LoggingLevel" : {
          "description" : "The logging level for this method. For valid values, see the loggingLevel property of the Stage resource in the Amazon API Gateway API Reference. ",
          "type" : "string"
        },
        "MethodSettings" : {
          "description" : "Configures settings for all of the stage's methods.",
          "type" : "array",
          "uniqueItems" : true,
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/MethodSetting"
          }
        },
        "MetricsEnabled" : {
          "description" : "Indicates whether Amazon CloudWatch metrics are enabled for methods in the stage.",
          "type" : "boolean"
        },
        "Tags" : {
          "description" : "An array of arbitrary tags (key-value pairs) to associate with the stage.",
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Tag"
          }
        },
        "ThrottlingBurstLimit" : {
          "description" : "The number of burst requests per second that API Gateway permits across all APIs, stages, and methods in your AWS account.",
          "type" : "integer"
        },
        "ThrottlingRateLimit" : {
          "description" : "The number of steady-state requests per second that API Gateway permits across all APIs, stages, and methods in your AWS account.",
          "type" : "number"
        },
        "TracingEnabled" : {
          "description" : "Specifies whether active tracing with X-ray is enabled for this stage.",
          "type" : "boolean"
        },
        "Variables" : {
          "description" : "A map that defines the stage variables. Variable names must consist of alphanumeric characters, and the values must match the following regular expression: [A-Za-z0-9-._~:/?#&=,]+. ",
          "type" : "object",
          "additionalProperties" : false,
          "patternProperties" : {
            "[a-zA-Z0-9]+" : {
              "type" : "string"
            }
          }
        }
      }
    },
    "DeploymentCanarySettings" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "PercentTraffic" : {
          "description" : "The percentage (0-100) of traffic diverted to a canary deployment.",
          "type" : "number"
        },
        "StageVariableOverrides" : {
          "description" : "Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values. Duplicates are not allowed.",
          "type" : "object",
          "additionalProperties" : false,
          "patternProperties" : {
            "[a-zA-Z0-9]+" : {
              "type" : "string"
            }
          }
        },
        "UseStageCache" : {
          "description" : "Whether the canary deployment uses the stage cache.",
          "type" : "boolean"
        }
      }
    },
    "AccessLogSetting" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "DestinationArn" : {
          "description" : "The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with amazon-apigateway-. ",
          "type" : "string"
        },
        "Format" : {
          "description" : "A single line format of the access logs of data, as specified by selected $context variables. The format must include at least $context.requestId. ",
          "type" : "string"
        }
      }
    },
    "CanarySetting" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "PercentTraffic" : {
          "description" : "The percent (0-100) of traffic diverted to a canary deployment.",
          "type" : "number"
        },
        "StageVariableOverrides" : {
          "description" : "Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values. ",
          "type" : "object",
          "additionalProperties" : false,
          "patternProperties" : {
            "[a-zA-Z0-9]+" : {
              "type" : "string"
            }
          }
        },
        "UseStageCache" : {
          "description" : "Whether the canary deployment uses the stage cache or not.",
          "type" : "boolean"
        }
      }
    },
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "description" : "The key name of the tag",
          "type" : "string"
        },
        "Value" : {
          "description" : "The value for the tag",
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    },
    "MethodSetting" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "CacheDataEncrypted" : {
          "description" : "Indicates whether the cached responses are encrypted",
          "type" : "boolean"
        },
        "CacheTtlInSeconds" : {
          "description" : "The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches responses. ",
          "type" : "integer"
        },
        "CachingEnabled" : {
          "description" : "Indicates whether responses are cached and returned for requests. You must enable a cache cluster on the stage to cache responses.",
          "type" : "boolean"
        },
        "DataTraceEnabled" : {
          "description" : "Indicates whether data trace logging is enabled for methods in the stage. API Gateway pushes these logs to Amazon CloudWatch Logs. ",
          "type" : "boolean"
        },
        "HttpMethod" : {
          "description" : "The HTTP method.",
          "type" : "string"
        },
        "LoggingLevel" : {
          "description" : "The logging level for this method. For valid values, see the loggingLevel property of the Stage resource in the Amazon API Gateway API Reference. ",
          "type" : "string"
        },
        "MetricsEnabled" : {
          "description" : "Indicates whether Amazon CloudWatch metrics are enabled for methods in the stage.",
          "type" : "boolean"
        },
        "ResourcePath" : {
          "description" : "The resource path for this method. Forward slashes (/) are encoded as ~1 and the initial slash must include a forward slash. ",
          "type" : "string"
        },
        "ThrottlingBurstLimit" : {
          "description" : "The number of burst requests per second that API Gateway permits across all APIs, stages, and methods in your AWS account.",
          "type" : "integer"
        },
        "ThrottlingRateLimit" : {
          "description" : "The number of steady-state requests per second that API Gateway permits across all APIs, stages, and methods in your AWS account.",
          "type" : "number"
        }
      }
    }
  },
  "taggable" : true,
  "required" : [ "RestApiId" ],
  "createOnlyProperties" : [ "/properties/DeploymentCanarySettings", "/properties/RestApiId" ],
  "primaryIdentifier" : [ "/properties/DeploymentId", "/properties/RestApiId" ],
  "readOnlyProperties" : [ "/properties/DeploymentId" ],
  "writeOnlyProperties" : [ "/properties/StageName", "/properties/StageDescription", "/properties/DeploymentCanarySettings" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "apigateway:POST" ]
    },
    "read" : {
      "permissions" : [ "apigateway:GET" ]
    },
    "update" : {
      "permissions" : [ "apigateway:PATCH", "apigateway:GET", "apigateway:PUT" ]
    },
    "delete" : {
      "permissions" : [ "apigateway:GET", "apigateway:DELETE" ]
    },
    "list" : {
      "permissions" : [ "apigateway:GET" ]
    }
  }
}