:doc:`APIGateway <../../apigateway>` / Client / create_deployment

*****************
create_deployment
*****************



.. py:method:: APIGateway.Client.create_deployment(**kwargs)

  

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

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/apigateway-2015-07-09/CreateDeployment>`_  


  **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
    )
    
  :type restApiId: string
  :param restApiId: **[REQUIRED]** 

    The string identifier of the associated RestApi.

    

  
  :type stageName: string
  :param stageName: 

    The name of the Stage resource for the Deployment resource to create.

    

  
  :type stageDescription: string
  :param stageDescription: 

    The description of the Stage resource for the Deployment resource to create.

    

  
  :type description: string
  :param description: 

    The description for the Deployment resource to create.

    

  
  :type cacheClusterEnabled: boolean
  :param cacheClusterEnabled: 

    Enables a cache cluster for the Stage resource specified in the input.

    

  
  :type cacheClusterSize: string
  :param cacheClusterSize: 

    The stage's cache capacity in GB. For more information about choosing a cache size, see `Enabling API caching to enhance responsiveness <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html>`__.

    

  
  :type variables: dict
  :param variables: 

    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) --* 

      


  :type canarySettings: dict
  :param canarySettings: 

    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.

      

    
  
  :type tracingEnabled: boolean
  :param tracingEnabled: 

    Specifies whether active tracing with X-ray is enabled for the Stage.

    

  
  
  :rtype: 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**
  
  *   :py:class:`APIGateway.Client.exceptions.BadRequestException`

  
  *   :py:class:`APIGateway.Client.exceptions.ConflictException`

  
  *   :py:class:`APIGateway.Client.exceptions.LimitExceededException`

  
  *   :py:class:`APIGateway.Client.exceptions.NotFoundException`

  
  *   :py:class:`APIGateway.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`APIGateway.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`APIGateway.Client.exceptions.ServiceUnavailableException`

  