:doc:`PrometheusService <../../amp>` / Client / create_workspace

****************
create_workspace
****************



.. py:method:: PrometheusService.Client.create_workspace(**kwargs)

  

  Creates a Prometheus workspace. A workspace is a logical space dedicated to the storage and querying of Prometheus metrics. You can have one or more workspaces in each Region in your account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/CreateWorkspace>`_  


  **Request Syntax**
  ::

    response = client.create_workspace(
        alias='string',
        clientToken='string',
        tags={
            'string': 'string'
        },
        kmsKeyArn='string'
    )
    
  :type alias: string
  :param alias: 

    An alias that you assign to this workspace to help you identify it. It does not need to be unique.

     

    Blank spaces at the beginning or end of the alias that you specify will be trimmed from the value used.

    

  
  :type clientToken: string
  :param clientToken: 

    A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.

    This field is autopopulated if not provided.

  
  :type tags: dict
  :param tags: 

    The list of tag keys and values to associate with the workspace.

    

  
    - *(string) --* 

      The key of the tag. Must not begin with ``aws:``.

      

    
      - *(string) --* 

        The value of the tag.

        

      


  :type kmsKeyArn: string
  :param kmsKeyArn: 

    (optional) The ARN for a customer managed KMS key to use for encrypting data within your workspace. For more information about using your own key in your workspace, see `Encryption at rest <https://docs.aws.amazon.com/prometheus/latest/userguide/encryption-at-rest-Amazon-Service-Prometheus.html>`__ in the *Amazon Managed Service for Prometheus User Guide*.

    

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

    
    ::

      {
          'workspaceId': 'string',
          'arn': 'string',
          'status': {
              'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'
          },
          'tags': {
              'string': 'string'
          },
          'kmsKeyArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the output of a ``CreateWorkspace`` operation.

      
      

      - **workspaceId** *(string) --* 

        The unique ID for the new workspace.

        
      

      - **arn** *(string) --* 

        The ARN for the new workspace.

        
      

      - **status** *(dict) --* 

        The current status of the new workspace. Immediately after you create the workspace, the status is usually ``CREATING``.

        
        

        - **statusCode** *(string) --* 

          The current status of the workspace.

          
    
      

      - **tags** *(dict) --* 

        The list of tag keys and values that are associated with the workspace.

        
        

        - *(string) --* 

          The key of the tag. Must not begin with ``aws:``.

          
          

          - *(string) --* 

            The value of the tag.

            
    
  
      

      - **kmsKeyArn** *(string) --* 

        (optional) If the workspace was created with a customer managed KMS key, the ARN for the key used.

        
  
  **Exceptions**
  
  *   :py:class:`PrometheusService.Client.exceptions.ThrottlingException`

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

  
  *   :py:class:`PrometheusService.Client.exceptions.ValidationException`

  
  *   :py:class:`PrometheusService.Client.exceptions.AccessDeniedException`

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

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

  