:doc:`WellArchitected <../../wellarchitected>` / Client / import_lens

***********
import_lens
***********



.. py:method:: WellArchitected.Client.import_lens(**kwargs)

  

  Import a new custom lens or update an existing custom lens.

   

  To update an existing custom lens, specify its ARN as the ``LensAlias``. If no ARN is specified, a new custom lens is created.

   

  The new or updated lens will have a status of ``DRAFT``. The lens cannot be applied to workloads or shared with other Amazon Web Services accounts until it's published with  CreateLensVersion.

   

  Lenses are defined in JSON. For more information, see `JSON format specification <https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-format-specification.html>`__ in the *Well-Architected Tool User Guide*.

   

  A custom lens cannot exceed 500 KB in size.

   

  .. note::

    

    **Disclaimer**

     

    Do not include or gather personal identifiable information (PII) of end users or other identifiable individuals in or via your custom lenses. If your custom lens or those shared with you and used in your account do include or collect PII you are responsible for: ensuring that the included PII is processed in accordance with applicable law, providing adequate privacy notices, and obtaining necessary consents for processing such data.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/wellarchitected-2020-03-31/ImportLens>`_  


  **Request Syntax**
  ::

    response = client.import_lens(
        LensAlias='string',
        JSONString='string',
        ClientRequestToken='string',
        Tags={
            'string': 'string'
        }
    )
    
  :type LensAlias: string
  :param LensAlias: 

    The alias of the lens.

     

    For Amazon Web Services official lenses, this is either the lens alias, such as ``serverless``, or the lens ARN, such as ``arn:aws:wellarchitected:us-east-1::lens/serverless``. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.

     

    For custom lenses, this is the lens ARN, such as ``arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef``.

     

    Each lens is identified by its  LensSummary$LensAlias.

    

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

    The JSON representation of a lens.

    

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

    A unique case-sensitive string used to ensure that this request is idempotent (executes only once).

     

    You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.

     

    .. warning::

       

      This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.

      

    This field is autopopulated if not provided.

  
  :type Tags: dict
  :param Tags: 

    Tags to associate to a lens.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'LensArn': 'string',
          'Status': 'IN_PROGRESS'|'COMPLETE'|'ERROR'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **LensArn** *(string) --* 

        The ARN for the lens that was created or updated.

        
      

      - **Status** *(string) --* 

        The status of the imported lens.

        
  
  **Exceptions**
  
  *   :py:class:`WellArchitected.Client.exceptions.ValidationException`

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

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

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

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

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

  
  *   :py:class:`WellArchitected.Client.exceptions.ThrottlingException`

  