:doc:`AppConfig <../../appconfig>` / Client / create_hosted_configuration_version

***********************************
create_hosted_configuration_version
***********************************



.. py:method:: AppConfig.Client.create_hosted_configuration_version(**kwargs)

  

  Creates a new configuration in the AppConfig hosted configuration store. If you're creating a feature flag, we recommend you familiarize yourself with the JSON schema for feature flag data. For more information, see `Type reference for AWS.AppConfig.FeatureFlags <https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile-feature-flags.html#appconfig-type-reference-feature-flags>`__ in the *AppConfig User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appconfig-2019-10-09/CreateHostedConfigurationVersion>`_  


  **Request Syntax**
  ::

    response = client.create_hosted_configuration_version(
        ApplicationId='string',
        ConfigurationProfileId='string',
        Description='string',
        Content=b'bytes'|file,
        ContentType='string',
        LatestVersionNumber=123,
        VersionLabel='string'
    )
    
  :type ApplicationId: string
  :param ApplicationId: **[REQUIRED]** 

    The application ID.

    

  
  :type ConfigurationProfileId: string
  :param ConfigurationProfileId: **[REQUIRED]** 

    The configuration profile ID.

    

  
  :type Description: string
  :param Description: 

    A description of the configuration.

    

  
  :type Content: bytes or seekable file-like object
  :param Content: **[REQUIRED]** 

    The configuration data, as bytes.

     

    .. note::

      

      AppConfig accepts any type of data, including text formats like JSON or TOML, or binary formats like protocol buffers or compressed data.

      

    

  
  :type ContentType: string
  :param ContentType: **[REQUIRED]** 

    A standard MIME type describing the format of the configuration content. For more information, see `Content-Type <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>`__.

    

  
  :type LatestVersionNumber: integer
  :param LatestVersionNumber: 

    An optional locking token used to prevent race conditions from overwriting configuration updates when creating a new version. To ensure your data is not overwritten when creating multiple hosted configuration versions in rapid succession, specify the version number of the latest hosted configuration version.

    

  
  :type VersionLabel: string
  :param VersionLabel: 

    An optional, user-defined label for the AppConfig hosted configuration version. This value must contain at least one non-numeric character. For example, "v2.2.0".

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ApplicationId': 'string',
          'ConfigurationProfileId': 'string',
          'VersionNumber': 123,
          'Description': 'string',
          'Content': StreamingBody(),
          'ContentType': 'string',
          'VersionLabel': 'string',
          'KmsKeyArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ApplicationId** *(string) --* 

        The application ID.

        
      

      - **ConfigurationProfileId** *(string) --* 

        The configuration profile ID.

        
      

      - **VersionNumber** *(integer) --* 

        The configuration version.

        
      

      - **Description** *(string) --* 

        A description of the configuration.

        
      

      - **Content** (:class:`.StreamingBody`) -- 

        The content of the configuration or the configuration data.

        
      

      - **ContentType** *(string) --* 

        A standard MIME type describing the format of the configuration content. For more information, see `Content-Type <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17>`__.

        
      

      - **VersionLabel** *(string) --* 

        A user-defined label for an AppConfig hosted configuration version.

        
      

      - **KmsKeyArn** *(string) --* 

        The Amazon Resource Name of the Key Management Service key that was used to encrypt this specific version of the configuration data in the AppConfig hosted configuration store.

        
  
  **Exceptions**
  
  *   :py:class:`AppConfig.Client.exceptions.BadRequestException`

  
  *   :py:class:`AppConfig.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`AppConfig.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`AppConfig.Client.exceptions.PayloadTooLargeException`

  
  *   :py:class:`AppConfig.Client.exceptions.InternalServerException`

  

  **Examples**

  The following create-hosted-configuration-version example creates a new configuration in the AWS AppConfig configuration store.
  ::

    response = client.create_hosted_configuration_version(
        ApplicationId='339ohji',
        ConfigurationProfileId='ur8hx2f',
        Content='eyAiTmFtZSI6ICJFeGFtcGxlQXBwbGljYXRpb24iLCAiSWQiOiBFeGFtcGxlSUQsICJSYW5rIjogNyB9',
        ContentType='text',
        LatestVersionNumber=1,
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ApplicationId': '339ohji',
        'ConfigurationProfileId': 'ur8hx2f',
        'ContentType': 'text',
        'VersionNumber': 1,
        'ResponseMetadata': {
            '...': '...',
        },
    }

  