:doc:`ComputeOptimizerAutomation <../../compute-optimizer-automation>` / Client / get_automation_rule

*******************
get_automation_rule
*******************



.. py:method:: ComputeOptimizerAutomation.Client.get_automation_rule(**kwargs)

  

  Retrieves details about a specific automation rule.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/compute-optimizer-automation-2025-09-22/GetAutomationRule>`_  


  **Request Syntax**
  ::

    response = client.get_automation_rule(
        ruleArn='string'
    )
    
  :type ruleArn: string
  :param ruleArn: **[REQUIRED]** 

    The ARN of the rule to retrieve.

    

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

    
    ::

      {
          'ruleArn': 'string',
          'ruleId': 'string',
          'name': 'string',
          'description': 'string',
          'ruleType': 'OrganizationRule'|'AccountRule',
          'ruleRevision': 123,
          'accountId': 'string',
          'organizationConfiguration': {
              'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
              'accountIds': [
                  'string',
              ]
          },
          'priority': 'string',
          'recommendedActionTypes': [
              'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
          ],
          'criteria': {
              'region': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          'string',
                      ]
                  },
              ],
              'resourceArn': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          'string',
                      ]
                  },
              ],
              'ebsVolumeType': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          'string',
                      ]
                  },
              ],
              'ebsVolumeSizeInGib': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          123,
                      ]
                  },
              ],
              'estimatedMonthlySavings': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          123.0,
                      ]
                  },
              ],
              'resourceTag': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'key': 'string',
                      'values': [
                          'string',
                      ]
                  },
              ],
              'lookBackPeriodInDays': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          123,
                      ]
                  },
              ],
              'restartNeeded': [
                  {
                      'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
                      'values': [
                          'string',
                      ]
                  },
              ]
          },
          'schedule': {
              'scheduleExpression': 'string',
              'scheduleExpressionTimezone': 'string',
              'executionWindowInMinutes': 123
          },
          'status': 'Active'|'Inactive',
          'tags': [
              {
                  'key': 'string',
                  'value': 'string'
              },
          ],
          'createdTimestamp': datetime(2015, 1, 1),
          'lastUpdatedTimestamp': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ruleArn** *(string) --* 

        The Amazon Resource Name (ARN) of the automation rule.

        
      

      - **ruleId** *(string) --* 

        The unique identifier of the automation rule.

        
      

      - **name** *(string) --* 

        The name of the automation rule.

        
      

      - **description** *(string) --* 

        A description of the automation rule.

        
      

      - **ruleType** *(string) --* 

        The type of automation rule.

        
      

      - **ruleRevision** *(integer) --* 

        The revision number of the automation rule.

        
      

      - **accountId** *(string) --* 

        The 12-digit Amazon Web Services account ID that owns this automation rule.

        
      

      - **organizationConfiguration** *(dict) --* 

        Configuration settings for organization-wide automation rules.

        
        

        - **ruleApplyOrder** *(string) --* 

          Specifies when organization rules should be applied relative to account rules.

          
        

        - **accountIds** *(list) --* 

          List of specific Amazon Web Services account IDs where the organization rule should be applied.

          
          

          - *(string) --* 
      
    
      

      - **priority** *(string) --* 

        A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule.

        
      

      - **recommendedActionTypes** *(list) --* 

        List of recommended action types that this rule can execute.

        
        

        - *(string) --* 

          Recommended action type enumeration

          
    
      

      - **criteria** *(dict) --* 

        A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.

        
        

        - **region** *(list) --* 

          Filter criteria for Amazon Web Services regions where resources must be located.

          
          

          - *(dict) --* 

            Criteria condition for filtering based on string values, including comparison operators and target values.

            
            

            - **comparison** *(string) --* 

              The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.

              
            

            - **values** *(list) --* 

              List of string values to compare against when applying the criteria condition.

              
              

              - *(string) --* 
          
        
      
        

        - **resourceArn** *(list) --* 

          Filter criteria for specific resource ARNs to include or exclude.

          
          

          - *(dict) --* 

            Criteria condition for filtering based on string values, including comparison operators and target values.

            
            

            - **comparison** *(string) --* 

              The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.

              
            

            - **values** *(list) --* 

              List of string values to compare against when applying the criteria condition.

              
              

              - *(string) --* 
          
        
      
        

        - **ebsVolumeType** *(list) --* 

          Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.

          
          

          - *(dict) --* 

            Criteria condition for filtering based on string values, including comparison operators and target values.

            
            

            - **comparison** *(string) --* 

              The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.

              
            

            - **values** *(list) --* 

              List of string values to compare against when applying the criteria condition.

              
              

              - *(string) --* 
          
        
      
        

        - **ebsVolumeSizeInGib** *(list) --* 

          Filter criteria for EBS volume sizes in gibibytes (GiB).

          
          

          - *(dict) --* 

            Defines a condition for filtering based on integer values with comparison operators.

            
            

            - **comparison** *(string) --* 

              The comparison operator to use, such as equals, greater than, less than, etc.

              
            

            - **values** *(list) --* 

              The list of integer values to compare against using the specified comparison operator.

              
              

              - *(integer) --* 
          
        
      
        

        - **estimatedMonthlySavings** *(list) --* 

          Filter criteria for estimated monthly cost savings from the recommended action.

          
          

          - *(dict) --* 

            Defines a condition for filtering based on double/floating-point numeric values with comparison operators.

            
            

            - **comparison** *(string) --* 

              The comparison operator to use, such as equals, greater than, less than, etc.

              
            

            - **values** *(list) --* 

              The list of double values to compare against using the specified comparison operator.

              
              

              - *(float) --* 
          
        
      
        

        - **resourceTag** *(list) --* 

          Filter criteria for resource tags, allowing filtering by tag key and value combinations.

          
          

          - *(dict) --* 

            Criteria condition for filtering resources based on their tags, including comparison operators and values.

            
            

            - **comparison** *(string) --* 

              The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.

              
            

            - **key** *(string) --* 

              The tag key to use for comparison when filtering resources.

              
            

            - **values** *(list) --* 

              List of tag values to compare against when filtering resources.

              
              

              - *(string) --* 
          
        
      
        

        - **lookBackPeriodInDays** *(list) --* 

          Filter criteria for the lookback period in days used to analyze resource utilization.

          
          

          - *(dict) --* 

            Defines a condition for filtering based on integer values with comparison operators.

            
            

            - **comparison** *(string) --* 

              The comparison operator to use, such as equals, greater than, less than, etc.

              
            

            - **values** *(list) --* 

              The list of integer values to compare against using the specified comparison operator.

              
              

              - *(integer) --* 
          
        
      
        

        - **restartNeeded** *(list) --* 

          Filter criteria indicating whether the recommended action requires a resource restart.

          
          

          - *(dict) --* 

            Criteria condition for filtering based on string values, including comparison operators and target values.

            
            

            - **comparison** *(string) --* 

              The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.

              
            

            - **values** *(list) --* 

              List of string values to compare against when applying the criteria condition.

              
              

              - *(string) --* 
          
        
      
    
      

      - **schedule** *(dict) --* 

        Configuration for scheduling when automation rules should execute, including timing and execution windows.

        
        

        - **scheduleExpression** *(string) --* 

          The expression that defines when the schedule runs. ``cron`` expression is supported. A ``cron`` expression consists of six fields separated by white spaces: ( ``minutes`` ``hours`` ``day_of_month`` ``month`` ``day_of_week`` ``year``)

           

          .. note::

            

            You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: ( ``30 12 * * *``) runs daily at 12:30 PM UTC.

            

          
        

        - **scheduleExpressionTimezone** *(string) --* 

          The timezone to use when interpreting the schedule expression.

          
        

        - **executionWindowInMinutes** *(integer) --* 

          The time window in minutes during which the automation rule can start implementing recommended actions.

          
    
      

      - **status** *(string) --* 

        The current status of the automation rule (Active or Inactive).

        
      

      - **tags** *(list) --* 

        The tags associated with the automation rule.

        
        

        - *(dict) --* 

          A key-value pair used to categorize and organize Amazon Web Services resources and automation rules.

          
          

          - **key** *(string) --* 

            The tag key, which can be up to 128 characters long.

            
          

          - **value** *(string) --* 

            The tag value, which can be up to 256 characters long.

            
      
    
      

      - **createdTimestamp** *(datetime) --* 

        The timestamp when the automation rule was created.

        
      

      - **lastUpdatedTimestamp** *(datetime) --* 

        The timestamp when the automation rule was last updated.

        
  
  **Exceptions**
  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ComputeOptimizerAutomation.Client.exceptions.OptInRequiredException`

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

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

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

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

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

  