:doc:`AccessAnalyzer <../../accessanalyzer>` / Client / create_archive_rule

*******************
create_archive_rule
*******************



.. py:method:: AccessAnalyzer.Client.create_archive_rule(**kwargs)

  

  Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.

   

  To learn about filter keys that you can use to create an archive rule, see `IAM Access Analyzer filter keys <https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html>`__ in the **IAM User Guide**.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CreateArchiveRule>`_  


  **Request Syntax**
  ::

    response = client.create_archive_rule(
        analyzerName='string',
        ruleName='string',
        filter={
            'string': {
                'eq': [
                    'string',
                ],
                'neq': [
                    'string',
                ],
                'contains': [
                    'string',
                ],
                'exists': True|False
            }
        },
        clientToken='string'
    )
    
  :type analyzerName: string
  :param analyzerName: **[REQUIRED]** 

    The name of the created analyzer.

    

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

    The name of the rule to create.

    

  
  :type filter: dict
  :param filter: **[REQUIRED]** 

    The criteria for the rule.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        The criteria to use in the filter that defines the archive rule. For more information on available filter keys, see `IAM Access Analyzer filter keys <https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html>`__.

        

      
        - **eq** *(list) --* 

          An "equals" operator to match for the filter used to create the rule.

          

        
          - *(string) --* 

          
      
        - **neq** *(list) --* 

          A "not equals" operator to match for the filter used to create the rule.

          

        
          - *(string) --* 

          
      
        - **contains** *(list) --* 

          A "contains" operator to match for the filter used to create the rule.

          

        
          - *(string) --* 

          
      
        - **exists** *(boolean) --* 

          An "exists" operator to match for the filter used to create the rule.

          

        
      


  :type clientToken: string
  :param clientToken: 

    A client token.

    This field is autopopulated if not provided.

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`AccessAnalyzer.Client.exceptions.ConflictException`

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

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

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

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

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

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

  