APIGateway / Client / create_deployment

create_deployment#

APIGateway.Client.create_deployment(**kwargs)#

Creates a Deployment resource, which makes a specified RestApi callable over the internet.

See also: AWS API Documentation

Request Syntax

response = client.create_deployment(
    restApiId='string',
    stageName='string',
    stageDescription='string',
    description='string',
    cacheClusterEnabled=True|False,
    cacheClusterSize='0.5'|'1.6'|'6.1'|'13.5'|'28.4'|'58.2'|'118'|'237',
    variables={
        'string': 'string'
    },
    canarySettings={
        'percentTraffic': 123.0,
        'stageVariableOverrides': {
            'string': 'string'
        },
        'useStageCache': True|False
    },
    tracingEnabled=True|False
)
Parameters:
  • restApiId (string) –

    [REQUIRED]

    The string identifier of the associated RestApi.

  • stageName (string) – The name of the Stage resource for the Deployment resource to create.

  • stageDescription (string) – The description of the Stage resource for the Deployment resource to create.

  • description (string) – The description for the Deployment resource to create.

  • cacheClusterEnabled (boolean) – Enables a cache cluster for the Stage resource specified in the input.

  • cacheClusterSize (string) – The stage’s cache capacity in GB. For more information about choosing a cache size, see Enabling API caching to enhance responsiveness.

  • variables (dict) –

    A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.

    • (string) –

      • (string) –

  • canarySettings (dict) –

    The input configuration for the canary deployment when the deployment is a canary release deployment.

    • percentTraffic (float) –

      The percentage (0.0-100.0) of traffic routed to the canary deployment.

    • stageVariableOverrides (dict) –

      A stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.

      • (string) –

        • (string) –

    • useStageCache (boolean) –

      A Boolean flag to indicate whether the canary release deployment uses the stage cache or not.

  • tracingEnabled (boolean) – Specifies whether active tracing with X-ray is enabled for the Stage.

Return type:

dict

Returns:

Response Syntax

{
    'id': 'string',
    'description': 'string',
    'createdDate': datetime(2015, 1, 1),
    'apiSummary': {
        'string': {
            'string': {
                'authorizationType': 'string',
                'apiKeyRequired': True|False
            }
        }
    }
}

Response Structure

  • (dict) –

    An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.

    • id (string) –

      The identifier for the deployment resource.

    • description (string) –

      The description for the deployment resource.

    • createdDate (datetime) –

      The date and time that the deployment resource was created.

    • apiSummary (dict) –

      A summary of the RestApi at the date and time that the deployment resource was created.

      • (string) –

        • (dict) –

          • (string) –

            • (dict) –

              Represents a summary of a Method resource, given a particular date and time.

              • authorizationType (string) –

                The method’s authorization type. Valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, CUSTOM for using a custom authorizer, or COGNITO_USER_POOLS for using a Cognito user pool.

              • apiKeyRequired (boolean) –

                Specifies whether the method requires a valid ApiKey.

Exceptions

  • APIGateway.Client.exceptions.BadRequestException

  • APIGateway.Client.exceptions.ConflictException

  • APIGateway.Client.exceptions.LimitExceededException

  • APIGateway.Client.exceptions.NotFoundException

  • APIGateway.Client.exceptions.UnauthorizedException

  • APIGateway.Client.exceptions.TooManyRequestsException

  • APIGateway.Client.exceptions.ServiceUnavailableException