Compute Optimizer Automation

2026/11/20 - Compute Optimizer Automation - 4 new 12 updated api methods

Changes  Adds organization enrollment configurations, which enable Automation and set the organization rule mode for the organization root, organizational units (OUs), and accounts. Organization rules can include and exclude OUs, and recommended actions and automation events can be filtered by OU.

PutOrganizationEnrollmentConfiguration (new) Link ¶

Creates or updates an organization enrollment configuration. The organization enrollment configuration sets the organization rule mode on the specified account, organizational unit (OU), or organization root and enables Automation for affected member accounts that have opted in to Compute Optimizer, including accounts that join later. Changes on an OU or the organization root can take up to 5 minutes. Organization enrollment configurations take precedence over settings made by AssociateAccounts and DisassociateAccounts. You must specify at least one configuration in the request.

See also: AWS API Documentation

Request Syntax

client.put_organization_enrollment_configuration(
    target={
        'accountId': 'string',
        'organizationalUnitId': 'string'
    },
    organizationRuleMode='AnyAllowed'|'NoneAllowed',
    clientToken='string'
)
type target:

dict

param target:

[REQUIRED]

The account, organizational unit (OU), or organization root on which to create or update the organization enrollment configuration. You can't specify the management account.

  • accountId (string) --

    The ID of the member account to target. You can't specify the management account.

  • organizationalUnitId (string) --

    The ID of the organizational unit (OU) or organization root to target.

type organizationRuleMode:

string

param organizationRuleMode:

The organization rule mode to set on the target. An organization enrollment configuration with either AnyAllowed or NoneAllowed enables Automation for affected member accounts. AnyAllowed permits organization rules to apply to those accounts, while NoneAllowed doesn't.

type clientToken:

string

param clientToken:

A unique identifier to ensure idempotency of the request.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListOrganizationalUnits (new) Link ¶

Lists the organization root and organizational units (OUs), including whether an applicable organization enrollment configuration enables Automation for member accounts and the effective organization rule mode for each root or OU.

See also: AWS API Documentation

Request Syntax

client.list_organizational_units(
    organizationalUnitIds=[
        'string',
    ],
    maxResults=123,
    nextToken='string'
)
type organizationalUnitIds:

list

param organizationalUnitIds:

The organizational unit (OU) or organization root IDs to return. If you don't specify this parameter, the operation returns the organization root and every OU.

  • (string) --

type maxResults:

integer

param maxResults:

The maximum number of organizational units to return in a single response. If you don't specify a value, the default is 1,000.

type nextToken:

string

param nextToken:

The token to use to retrieve the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'organizationalUnits': [
        {
            'organizationalUnitId': 'string',
            'autoEnrollMemberAccounts': 'All'|'None',
            'organizationRuleMode': 'AnyAllowed'|'NoneAllowed',
            'organizationRuleModeSource': {
                'sourceType': 'Applied'|'Inherited'|'Direct'|'Default',
                'sourceTargetId': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • organizationalUnits (list) --

      The organizational units and organization root returned in this page of results, including the organization rule mode that applies to each.

      • (dict) --

        Information about an organizational unit (OU) or the organization root, including whether an applicable organization enrollment configuration enables Automation for member accounts and the effective organization rule mode.

        • organizationalUnitId (string) --

          The ID of the organizational unit (OU) or organization root.

        • autoEnrollMemberAccounts (string) --

          Whether an applicable organization enrollment configuration enables Automation for eligible member accounts beneath the organizational unit (OU) or organization root.

          • All - An organization enrollment configuration applies and enables Automation for affected member accounts, including accounts that join later. This value applies to configurations with either AnyAllowed or NoneAllowed.

          • None - No organization enrollment configuration applies, so Automation isn't enabled by an organization enrollment configuration.

        • organizationRuleMode (string) --

          The effective organization rule mode for the organizational unit or organization root.

        • organizationRuleModeSource (dict) --

          Information about the source of the effective organization rule mode.

          • sourceType (string) --

            How the effective organization rule mode is supplied.

            • Applied - An organization enrollment configuration is on this organizational unit or account.

            • Inherited - The organization enrollment configuration is on the parent organizational unit or root.

            • Direct - The organization rule mode is set on the account itself, with no organization enrollment configuration applied.

            • Default - No organization enrollment configuration applies, so the organization rule mode is None allowed.

          • sourceTargetId (string) --

            The ID of the account, organizational unit (OU), or organization root that has the organization enrollment configuration. This field is omitted when sourceType is Direct or Default.

    • nextToken (string) --

      The token to use to retrieve the next page of results.

DeleteOrganizationEnrollmentConfiguration (new) Link ¶

Deletes the specified configuration types from an organization enrollment configuration. After deletion, Automation stays enabled for affected accounts and earlier account associations aren't restored. Affected accounts inherit the organization rule mode from the closest parent that has an organization enrollment configuration, or get None allowed if no parent has one.

See also: AWS API Documentation

Request Syntax

client.delete_organization_enrollment_configuration(
    target={
        'accountId': 'string',
        'organizationalUnitId': 'string'
    },
    configurationTypes=[
        'OrganizationRuleMode',
    ],
    clientToken='string'
)
type target:

dict

param target:

[REQUIRED]

The account, organizational unit (OU), or organization root whose organization enrollment configuration you want to delete.

  • accountId (string) --

    The ID of the member account to target. You can't specify the management account.

  • organizationalUnitId (string) --

    The ID of the organizational unit (OU) or organization root to target.

type configurationTypes:

list

param configurationTypes:

[REQUIRED]

The organization enrollment configuration types to delete from the target.

  • (string) --

type clientToken:

string

param clientToken:

A unique identifier to ensure idempotency of the request.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListOrganizationEnrollmentConfigurations (new) Link ¶

Lists the organization enrollment configurations that are stored directly on accounts, organizational units (OUs), and the organization root.

See also: AWS API Documentation

Request Syntax

client.list_organization_enrollment_configurations(
    targetType='Account'|'OrganizationalUnit',
    maxResults=123,
    nextToken='string'
)
type targetType:

string

param targetType:

The target type to use to filter the results. If you specify OrganizationalUnit, the results also include configurations stored on the organization root. If you don't specify a target type, the operation returns configurations for every target type.

type maxResults:

integer

param maxResults:

The maximum number of organization enrollment configurations to return in a single response. If you don't specify a value, the default is 1,000.

type nextToken:

string

param nextToken:

The token to use to retrieve the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'organizationEnrollmentConfigurations': [
        {
            'targetId': 'string',
            'targetType': 'Account'|'OrganizationalUnit',
            'organizationRuleMode': 'AnyAllowed'|'NoneAllowed'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • organizationEnrollmentConfigurations (list) --

      The organization enrollment configurations stored on each target in this page of results.

      • (dict) --

        An organization enrollment configuration sets the organization rule mode on an account, organizational unit (OU), or the organization root and enables Automation for affected member accounts that have opted in to Compute Optimizer.

        • targetId (string) --

          The ID of the account, organizational unit (OU), or organization root on which the configuration is stored.

        • targetType (string) --

          The type of target on which the configuration is stored.

        • organizationRuleMode (string) --

          The organization rule mode set on the target by the organization enrollment configuration.

    • nextToken (string) --

      The token to use to retrieve the next page of results.

CreateAutomationRule (updated) Link ¶
Changes (both)
{'organizationConfiguration': {'excludedAccountIds': ['string'],
                               'excludedOrganizationalUnitIds': ['string'],
                               'organizationalUnitIds': ['string']}}

Creates a new automation rule to apply recommended actions to resources based on specified criteria.

See also: AWS API Documentation

Request Syntax

client.create_automation_rule(
    name='string',
    description='string',
    ruleType='OrganizationRule'|'AccountRule',
    organizationConfiguration={
        'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
        'accountIds': [
            'string',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    priority='string',
    recommendedActionTypes=[
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    criteria={
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ]
    },
    schedule={
        'scheduleExpression': 'string',
        'scheduleExpressionTimezone': 'string',
        'executionWindowInMinutes': 123
    },
    status='Active'|'Inactive',
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    clientToken='string'
)
type name:

string

param name:

[REQUIRED]

The name of the automation rule.

type description:

string

param description:

A description of the automation rule.

type ruleType:

string

param ruleType:

[REQUIRED]

The type of rule.

type organizationConfiguration:

dict

param organizationConfiguration:

Configuration for organization-level rules. Required for OrganizationRule type.

  • ruleApplyOrder (string) --

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

  • accountIds (list) --

    The specific Amazon Web Services account IDs where the organization rule should be applied. You can specify up to 50 account IDs.

    • (string) --

  • organizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to include in the organization rule scope. The rule applies to accounts in the specified OUs and their child OUs. You can specify up to 150 IDs.

    • (string) --

  • excludedOrganizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to exclude from the organization rule scope. The rule doesn't apply to accounts in the specified OUs or their child OUs. You can specify up to 150 IDs.

    • (string) --

  • excludedAccountIds (list) --

    The Amazon Web Services account IDs to exclude from the organization rule scope. You can specify up to 50 account IDs. An excluded account remains excluded even if it is in an included OU.

    • (string) --

type priority:

string

param priority:

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. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules.

type recommendedActionTypes:

list

param recommendedActionTypes:

[REQUIRED]

The types of recommended actions this rule will automate.

  • (string) --

    Recommended action type enumeration

type criteria:

dict

param criteria:

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.

  • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

    • (dict) --

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

      • comparison (string) --

        The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • values (list) --

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

        • (string) --

type schedule:

dict

param schedule:

[REQUIRED]

The schedule for when the rule should run.

  • 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)

  • 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.

type status:

string

param status:

[REQUIRED]

The status of the rule

type tags:

list

param tags:

The tags to associate with the rule.

  • (dict) --

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

    • key (string) -- [REQUIRED]

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

    • value (string) -- [REQUIRED]

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

type clientToken:

string

param clientToken:

A unique identifier to ensure idempotency of the request.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'ruleArn': 'string',
    'ruleId': 'string',
    'name': 'string',
    'description': 'string',
    'ruleType': 'OrganizationRule'|'AccountRule',
    'ruleRevision': 123,
    'organizationConfiguration': {
        'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
        'accountIds': [
            'string',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    'priority': 'string',
    'recommendedActionTypes': [
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    'criteria': {
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ]
    },
    'schedule': {
        'scheduleExpression': 'string',
        'scheduleExpressionTimezone': 'string',
        'executionWindowInMinutes': 123
    },
    'status': 'Active'|'Inactive',
    'tags': [
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    'createdTimestamp': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • ruleArn (string) --

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

    • ruleId (string) --

      The unique identifier of the created rule.

    • name (string) --

      The name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.

    • description (string) --

      A description of the automation rule. Can be up to 1024 characters long and contain alphanumeric characters, underscores, hyphens, spaces, and certain special characters.

    • ruleType (string) --

      The type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.

    • ruleRevision (integer) --

      The revision number of the automation rule. This is incremented each time the rule is updated.

    • organizationConfiguration (dict) --

      Configuration settings for organization-wide rules, including rule application order and target account IDs.

      • ruleApplyOrder (string) --

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

      • accountIds (list) --

        The specific Amazon Web Services account IDs where the organization rule should be applied. You can specify up to 50 account IDs.

        • (string) --

      • organizationalUnitIds (list) --

        The organizational unit (OU) or organization root IDs to include in the organization rule scope. The rule applies to accounts in the specified OUs and their child OUs. You can specify up to 150 IDs.

        • (string) --

      • excludedOrganizationalUnitIds (list) --

        The organizational unit (OU) or organization root IDs to exclude from the organization rule scope. The rule doesn't apply to accounts in the specified OUs or their child OUs. You can specify up to 150 IDs.

        • (string) --

      • excludedAccountIds (list) --

        The Amazon Web Services account IDs to exclude from the organization rule scope. You can specify up to 50 account IDs. An excluded account remains excluded even if it is in an included OU.

        • (string) --

    • priority (string) --

      The priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.

    • recommendedActionTypes (list) --

      List of recommended action types that this rule can execute, such as SnapshotAndDeleteUnattachedEbsVolume or UpgradeEbsVolumeType.

      • (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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

        • (dict) --

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

          • comparison (string) --

            The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • values (list) --

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

            • (string) --

    • schedule (dict) --

      The schedule configuration for when the automation rule should execute, including cron expression, timezone, and execution window.

      • 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)

      • 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. Can be Active or Inactive.

    • tags (list) --

      A list of key-value pairs used to categorize and organize the automation rule. Maximum of 200 tags allowed.

      • (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.

GetAutomationRule (updated) Link ¶
Changes (response)
{'organizationConfiguration': {'excludedAccountIds': ['string'],
                               'excludedOrganizationalUnitIds': ['string'],
                               'organizationalUnitIds': ['string']}}

Retrieves details about a specific automation rule.

See also: AWS API Documentation

Request Syntax

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',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    'priority': 'string',
    'recommendedActionTypes': [
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    'criteria': {
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                '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 that define the scope of an organization-wide automation rule. Each organizational unit (OU) list can contain up to 150 OUs or organization roots, and each account list can contain up to 50 accounts. Each included OU or organization root must have an effective organization rule mode of AnyAllowed. Exclusions take precedence over inclusions. An account that is in an included OU and is also excluded is excluded. The rule doesn't apply to the management account when the account is reached through an OU or the organization root.

      • ruleApplyOrder (string) --

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

      • accountIds (list) --

        The specific Amazon Web Services account IDs where the organization rule should be applied. You can specify up to 50 account IDs.

        • (string) --

      • organizationalUnitIds (list) --

        The organizational unit (OU) or organization root IDs to include in the organization rule scope. The rule applies to accounts in the specified OUs and their child OUs. You can specify up to 150 IDs.

        • (string) --

      • excludedOrganizationalUnitIds (list) --

        The organizational unit (OU) or organization root IDs to exclude from the organization rule scope. The rule doesn't apply to accounts in the specified OUs or their child OUs. You can specify up to 150 IDs.

        • (string) --

      • excludedAccountIds (list) --

        The Amazon Web Services account IDs to exclude from the organization rule scope. You can specify up to 50 account IDs. An excluded account remains excluded even if it is in an included OU.

        • (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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

        • (dict) --

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

          • comparison (string) --

            The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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)

      • 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.

GetEnrollmentConfiguration (updated) Link ¶
Changes (response)
{'organizationEnrollmentConfigurationStatus': 'Active | Inactive'}

Retrieves the current enrollment configuration for Compute Optimizer Automation.

See also: AWS API Documentation

Request Syntax

client.get_enrollment_configuration()
rtype:

dict

returns:

Response Syntax

{
    'status': 'Active'|'Inactive'|'Pending'|'Failed',
    'statusReason': 'string',
    'organizationRuleMode': 'AnyAllowed'|'NoneAllowed',
    'lastUpdatedTimestamp': datetime(2015, 1, 1),
    'organizationEnrollmentConfigurationStatus': 'Active'|'Inactive'
}

Response Structure

  • (dict) --

    • status (string) --

      The current enrollment status.

    • statusReason (string) --

      The reason for the current enrollment status.

    • organizationRuleMode (string) --

      Specifies whether the management account can create Automation rules that implement optimization actions for this account.

    • lastUpdatedTimestamp (datetime) --

      The timestamp of the last update to the enrollment configuration.

    • organizationEnrollmentConfigurationStatus (string) --

      Specifies whether an organization enrollment configuration on your account, or inherited from a parent OU or the organization root, enables Automation for your member account. Associations made using AssociateAccounts don't affect this status. This field is returned for organization member accounts, including delegated administrators. It's omitted for management accounts and accounts that aren't in an organization.

ListAccounts (updated) Link ¶
Changes (response)
{'accounts': {'organizationRuleModeSource': {'sourceTargetId': 'string',
                                             'sourceType': 'Applied | '
                                                           'Inherited | Direct '
                                                           '| Default'}}}

Lists the accounts in your organization that are enrolled in Compute Optimizer and whether they have enabled Automation.

See also: AWS API Documentation

Request Syntax

client.list_accounts(
    maxResults=123,
    nextToken='string'
)
type maxResults:

integer

param maxResults:

The maximum number of results to return in a single call.

type nextToken:

string

param nextToken:

The token for the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'status': 'Active'|'Inactive'|'Pending'|'Failed',
            'organizationRuleMode': 'AnyAllowed'|'NoneAllowed',
            'organizationRuleModeSource': {
                'sourceType': 'Applied'|'Inherited'|'Direct'|'Default',
                'sourceTargetId': 'string'
            },
            'statusReason': 'string',
            'lastUpdatedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • accounts (list) --

      The list of accounts in your organization enrolled in Compute Optimizer

      • (dict) --

        Contains information about an Amazon Web Services account's enrollment and association status with Compute Optimizer Automation.

        • accountId (string) --

          The ID of the Amazon Web Services account.

        • status (string) --

          The enrollment status of the account: Active, Inactive, Pending, or Failed.

        • organizationRuleMode (string) --

          Specifies whether the management account can create Automation rules that implement optimization actions for this account.

        • organizationRuleModeSource (dict) --

          Information about the source of the account's effective organization rule mode.

          • sourceType (string) --

            How the effective organization rule mode is supplied.

            • Applied - An organization enrollment configuration is on this organizational unit or account.

            • Inherited - The organization enrollment configuration is on the parent organizational unit or root.

            • Direct - The organization rule mode is set on the account itself, with no organization enrollment configuration applied.

            • Default - No organization enrollment configuration applies, so the organization rule mode is None allowed.

          • sourceTargetId (string) --

            The ID of the account, organizational unit (OU), or organization root that has the organization enrollment configuration. This field is omitted when sourceType is Direct or Default.

        • statusReason (string) --

          The reason for the current Automation enrollment status.

        • lastUpdatedTimestamp (datetime) --

          The timestamp when the account's Automation enrollment status was last updated.

    • nextToken (string) --

      The token to use to retrieve the next page of results.

ListAutomationEventSummaries (updated) Link ¶
Changes (request)
{'organizationalUnitIds': ['string']}

Provides a summary of automation events based on specified filters. Only events created within the past year will be included in the summary.

See also: AWS API Documentation

Request Syntax

client.list_automation_event_summaries(
    filters=[
        {
            'name': 'AccountId'|'ResourceType'|'EventType'|'EventStatus',
            'values': [
                'string',
            ]
        },
    ],
    organizationalUnitIds=[
        'string',
    ],
    startDateInclusive='string',
    endDateExclusive='string',
    maxResults=123,
    nextToken='string'
)
type filters:

list

param filters:

The filters to apply to the list of automation event summaries.

  • (dict) --

    A filter to apply when listing automation events.

    • name (string) -- [REQUIRED]

      The name of the filter to apply.

    • values (list) -- [REQUIRED]

      The values to use for the specified filter. For the ResourceType, EventType, and EventStatus filters, the value that you specify must exactly match the corresponding field of the automation event, including case. For example, specify Complete, not complete. Wildcards aren't supported. An asterisk ( *) or a question mark ( ?) in a value matches only that literal character.

      Valid values for the EventStatus filter are Ready, InProgress, Complete, Failed, Cancelled, RollbackReady, RollbackInProgress, RollbackComplete, and RollbackFailed.

      • (string) --

type organizationalUnitIds:

list

param organizationalUnitIds:

The organizational unit (OU) or organization root IDs to use to filter the results. The response includes event summaries for accounts in the specified OUs and their child OUs. Only the management account or a delegated administrator can specify this parameter.

  • (string) --

type startDateInclusive:

string

param startDateInclusive:

The start date for filtering automation event summaries, inclusive. Events created on or after this date will be included.

type endDateExclusive:

string

param endDateExclusive:

The end date for filtering automation event summaries, exclusive. Events created before this date will be included.

type maxResults:

integer

param maxResults:

The maximum number of automation event summaries to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

A token used for pagination to retrieve the next set of results when the response is truncated.

rtype:

dict

returns:

Response Syntax

{
    'automationEventSummaries': [
        {
            'key': 'string',
            'dimensions': [
                {
                    'key': 'EventStatus',
                    'value': 'string'
                },
            ],
            'timePeriod': {
                'startTimeInclusive': datetime(2015, 1, 1),
                'endTimeExclusive': datetime(2015, 1, 1)
            },
            'total': {
                'automationEventCount': 123,
                'estimatedMonthlySavings': {
                    'currency': 'string',
                    'beforeDiscountSavings': 123.0,
                    'afterDiscountSavings': 123.0,
                    'savingsEstimationMode': 'BeforeDiscount'|'AfterDiscount'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • automationEventSummaries (list) --

      The list of automation event summaries that match the specified criteria.

      • (dict) --

        A summary of automation events grouped by specified dimensions.

        • key (string) --

          The key identifier for this summary grouping.

        • dimensions (list) --

          The dimensions used to group this summary, such as event status.

          • (dict) --

            A key-value pair used to categorize and group summary data for analysis and reporting.

            • key (string) --

              The dimension key used for categorizing summary data.

            • value (string) --

              The specific value for this dimension key used in the summary grouping.

        • timePeriod (dict) --

          The time period covered by this summary, with inclusive start time and exclusive end time.

          • startTimeInclusive (datetime) --

            The start time of the period, inclusive. Events at or after this time are included.

          • endTimeExclusive (datetime) --

            The end time of the period, exclusive. Events before this time are included.

        • total (dict) --

          The aggregated totals for this summary, including event count and estimated savings.

          • automationEventCount (integer) --

            The total number of automation events in this summary group.

          • estimatedMonthlySavings (dict) --

            Contains information about estimated monthly cost savings.

            • currency (string) --

              The currency of the estimated savings.

            • beforeDiscountSavings (float) --

              The estimated monthly savings before applying any discounts.

            • afterDiscountSavings (float) --

              The estimated monthly savings after applying any discounts.

            • savingsEstimationMode (string) --

              The mode used to calculate savings, either BeforeDiscount or AfterDiscount.

    • nextToken (string) --

      A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.

ListAutomationEvents (updated) Link ¶
Changes (request)
{'organizationalUnitIds': ['string']}

Lists automation events based on specified filters. You can retrieve events that were created within the past year.

See also: AWS API Documentation

Request Syntax

client.list_automation_events(
    filters=[
        {
            'name': 'AccountId'|'ResourceType'|'EventType'|'EventStatus',
            'values': [
                'string',
            ]
        },
    ],
    organizationalUnitIds=[
        'string',
    ],
    startTimeInclusive=datetime(2015, 1, 1),
    endTimeExclusive=datetime(2015, 1, 1),
    maxResults=123,
    nextToken='string'
)
type filters:

list

param filters:

The filters to apply to the list of automation events.

  • (dict) --

    A filter to apply when listing automation events.

    • name (string) -- [REQUIRED]

      The name of the filter to apply.

    • values (list) -- [REQUIRED]

      The values to use for the specified filter. For the ResourceType, EventType, and EventStatus filters, the value that you specify must exactly match the corresponding field of the automation event, including case. For example, specify Complete, not complete. Wildcards aren't supported. An asterisk ( *) or a question mark ( ?) in a value matches only that literal character.

      Valid values for the EventStatus filter are Ready, InProgress, Complete, Failed, Cancelled, RollbackReady, RollbackInProgress, RollbackComplete, and RollbackFailed.

      • (string) --

type organizationalUnitIds:

list

param organizationalUnitIds:

The organizational unit (OU) or organization root IDs to use to filter the results. The response includes events for accounts in the specified OUs and their child OUs. Only the management account or a delegated administrator can specify this parameter.

  • (string) --

type startTimeInclusive:

datetime

param startTimeInclusive:

The start of the time range to query for events.

type endTimeExclusive:

datetime

param endTimeExclusive:

The end of the time range to query for events.

type maxResults:

integer

param maxResults:

The maximum number of automation events to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

The token for the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'automationEvents': [
        {
            'eventId': 'string',
            'eventDescription': 'string',
            'eventType': 'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
            'eventStatus': 'Ready'|'InProgress'|'Complete'|'Failed'|'Cancelled'|'RollbackReady'|'RollbackInProgress'|'RollbackComplete'|'RollbackFailed',
            'eventStatusReason': 'string',
            'resourceArn': 'string',
            'resourceId': 'string',
            'recommendedActionId': 'string',
            'accountId': 'string',
            'region': 'string',
            'ruleId': 'string',
            'resourceType': 'EbsVolume',
            'createdTimestamp': datetime(2015, 1, 1),
            'completedTimestamp': datetime(2015, 1, 1),
            'estimatedMonthlySavings': {
                'currency': 'string',
                'beforeDiscountSavings': 123.0,
                'afterDiscountSavings': 123.0,
                'savingsEstimationMode': 'BeforeDiscount'|'AfterDiscount'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • automationEvents (list) --

      The list of automation events that match the specified criteria.

      • (dict) --

        Contains information about an automation event.

        • eventId (string) --

          The unique identifier for the automation event.

        • eventDescription (string) --

          A description of the automation event.

        • eventType (string) --

          The type of automation event.

        • eventStatus (string) --

          The current status of the automation event.

        • eventStatusReason (string) --

          The reason for the current event status.

        • resourceArn (string) --

          The Amazon Resource Name (ARN) of the resource affected by the automation event.

        • resourceId (string) --

          The ID of the resource affected by the automation event.

        • recommendedActionId (string) --

          The ID of the recommended action associated with this automation event.

        • accountId (string) --

          The Amazon Web Services account ID associated with the automation event.

        • region (string) --

          The Amazon Web Services Region where the automation event occurred.

        • ruleId (string) --

          The ID of the automation rule that triggered this event.

        • resourceType (string) --

          The type of resource affected by the automation event.

        • createdTimestamp (datetime) --

          The timestamp when the automation event was created.

        • completedTimestamp (datetime) --

          The timestamp when the automation event completed.

        • estimatedMonthlySavings (dict) --

          The estimated monthly cost savings associated with this automation event.

          • currency (string) --

            The currency of the estimated savings.

          • beforeDiscountSavings (float) --

            The estimated monthly savings before applying any discounts.

          • afterDiscountSavings (float) --

            The estimated monthly savings after applying any discounts.

          • savingsEstimationMode (string) --

            The mode used to calculate savings, either BeforeDiscount or AfterDiscount.

    • nextToken (string) --

      The token to use to retrieve the next page of results.

ListAutomationRulePreview (updated) Link ¶
Changes (request)
{'organizationScope': {'excludedAccountIds': ['string'],
                       'excludedOrganizationalUnitIds': ['string'],
                       'organizationalUnitIds': ['string']}}

Returns a preview of the recommended actions that match your Automation rule's configuration and criteria.

See also: AWS API Documentation

Request Syntax

client.list_automation_rule_preview(
    ruleType='OrganizationRule'|'AccountRule',
    organizationScope={
        'accountIds': [
            'string',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    recommendedActionTypes=[
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    criteria={
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ]
    },
    maxResults=123,
    nextToken='string'
)
type ruleType:

string

param ruleType:

[REQUIRED]

The type of rule.

type organizationScope:

dict

param organizationScope:

The organizational scope for the rule preview. This parameter is required when ruleType is OrganizationRule. Don't specify it when ruleType is AccountRule.

  • accountIds (list) --

    List of Amazon Web Services account IDs to include in the organization scope.

    • (string) --

  • organizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to include in the preview scope. The preview includes accounts in the specified OUs and their child OUs.

    • (string) --

  • excludedOrganizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to exclude from the preview scope. The preview doesn't include accounts in the specified OUs or their child OUs.

    • (string) --

  • excludedAccountIds (list) --

    The Amazon Web Services account IDs to exclude from the preview scope.

    • (string) --

type recommendedActionTypes:

list

param recommendedActionTypes:

[REQUIRED]

The types of recommended actions to include in the preview.

  • (string) --

    Recommended action type enumeration

type criteria:

dict

param criteria:

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.

  • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

    • (dict) --

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

      • comparison (string) --

        The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • values (list) --

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

        • (string) --

type maxResults:

integer

param maxResults:

The maximum number of automation rule preview results to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

A token used for pagination to retrieve the next set of results when the response is truncated.

rtype:

dict

returns:

Response Syntax

{
    'previewResults': [
        {
            'recommendedActionId': 'string',
            'resourceArn': 'string',
            'resourceId': 'string',
            'accountId': 'string',
            'region': 'string',
            'resourceType': 'EbsVolume',
            'lookBackPeriodInDays': 123,
            'recommendedActionType': 'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
            'currentResourceSummary': 'string',
            'currentResourceDetails': {
                'ebsVolume': {
                    'configuration': {
                        'type': 'string',
                        'sizeInGib': 123,
                        'iops': 123,
                        'throughput': 123
                    }
                }
            },
            'recommendedResourceSummary': 'string',
            'recommendedResourceDetails': {
                'ebsVolume': {
                    'configuration': {
                        'type': 'string',
                        'sizeInGib': 123,
                        'iops': 123,
                        'throughput': 123
                    }
                }
            },
            'restartNeeded': True|False,
            'estimatedMonthlySavings': {
                'currency': 'string',
                'beforeDiscountSavings': 123.0,
                'afterDiscountSavings': 123.0,
                'savingsEstimationMode': 'BeforeDiscount'|'AfterDiscount'
            },
            'resourceTags': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • previewResults (list) --

      The list of actions that would be taken based on the specified criteria.

      • (dict) --

        Contains the results of previewing an automation rule against available recommendations.

        • recommendedActionId (string) --

          The ID of the recommended action being previewed.

        • resourceArn (string) --

          The Amazon Resource Name (ARN) of the resource affected by the recommended action.

        • resourceId (string) --

          The ID of the resource affected by the recommended action.

        • accountId (string) --

          The Amazon Web Services account ID associated with the resource.

        • region (string) --

          The Amazon Web Services Region where the resource is located.

        • resourceType (string) --

          The type of resource being evaluated.

        • lookBackPeriodInDays (integer) --

          The number of days of historical data used to analyze the resource.

        • recommendedActionType (string) --

          The type of recommended action being previewed.

        • currentResourceSummary (string) --

          A summary of the resource's current configuration.

        • currentResourceDetails (dict) --

          Detailed configuration information for a specific Amazon Web Services resource, with type-specific details.

          • ebsVolume (dict) --

            Detailed configuration information specific to EBS volumes, including volume type, size, IOPS, and throughput settings.

            • configuration (dict) --

              The configuration details of the EBS volume, including type, size, IOPS, and throughput.

              • type (string) --

                The EBS volume type, such as gp2, gp3, io1, io2, st1, or sc1.

              • sizeInGib (integer) --

                The size of the EBS volume in gibibytes (GiB).

              • iops (integer) --

                The number of I/O operations per second (IOPS) provisioned for the volume.

              • throughput (integer) --

                The throughput in MiB/s provisioned for the volume (applicable to gp3, io1, and io2bx volumes).

        • recommendedResourceSummary (string) --

          A summary of the resource's recommended configuration.

        • recommendedResourceDetails (dict) --

          Detailed configuration information for a specific Amazon Web Services resource, with type-specific details.

          • ebsVolume (dict) --

            Detailed configuration information specific to EBS volumes, including volume type, size, IOPS, and throughput settings.

            • configuration (dict) --

              The configuration details of the EBS volume, including type, size, IOPS, and throughput.

              • type (string) --

                The EBS volume type, such as gp2, gp3, io1, io2, st1, or sc1.

              • sizeInGib (integer) --

                The size of the EBS volume in gibibytes (GiB).

              • iops (integer) --

                The number of I/O operations per second (IOPS) provisioned for the volume.

              • throughput (integer) --

                The throughput in MiB/s provisioned for the volume (applicable to gp3, io1, and io2bx volumes).

        • restartNeeded (boolean) --

          Indicates whether implementing the recommended action requires a resource restart.

        • estimatedMonthlySavings (dict) --

          Contains information about estimated monthly cost savings.

          • currency (string) --

            The currency of the estimated savings.

          • beforeDiscountSavings (float) --

            The estimated monthly savings before applying any discounts.

          • afterDiscountSavings (float) --

            The estimated monthly savings after applying any discounts.

          • savingsEstimationMode (string) --

            The mode used to calculate savings, either BeforeDiscount or AfterDiscount.

        • resourceTags (list) --

          The tags associated with the resource.

          • (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.

    • nextToken (string) --

      A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.

ListAutomationRulePreviewSummaries (updated) Link ¶
Changes (request)
{'organizationScope': {'excludedAccountIds': ['string'],
                       'excludedOrganizationalUnitIds': ['string'],
                       'organizationalUnitIds': ['string']}}

Returns a summary of the recommended actions that match your rule preview configuration and criteria.

See also: AWS API Documentation

Request Syntax

client.list_automation_rule_preview_summaries(
    ruleType='OrganizationRule'|'AccountRule',
    organizationScope={
        'accountIds': [
            'string',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    recommendedActionTypes=[
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    criteria={
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ]
    },
    maxResults=123,
    nextToken='string'
)
type ruleType:

string

param ruleType:

[REQUIRED]

The type of rule.

type organizationScope:

dict

param organizationScope:

The organizational scope for the rule preview. This parameter is required when ruleType is OrganizationRule. Don't specify it when ruleType is AccountRule.

  • accountIds (list) --

    List of Amazon Web Services account IDs to include in the organization scope.

    • (string) --

  • organizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to include in the preview scope. The preview includes accounts in the specified OUs and their child OUs.

    • (string) --

  • excludedOrganizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to exclude from the preview scope. The preview doesn't include accounts in the specified OUs or their child OUs.

    • (string) --

  • excludedAccountIds (list) --

    The Amazon Web Services account IDs to exclude from the preview scope.

    • (string) --

type recommendedActionTypes:

list

param recommendedActionTypes:

[REQUIRED]

The types of recommended actions to include in the preview.

  • (string) --

    Recommended action type enumeration

type criteria:

dict

param criteria:

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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

    • (dict) --

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

      • comparison (string) --

        The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • values (list) --

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

        • (string) --

type maxResults:

integer

param maxResults:

The maximum number of automation rule preview summaries to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

A token used for pagination to retrieve the next set of results when the response is truncated.

rtype:

dict

returns:

Response Syntax

{
    'previewResultSummaries': [
        {
            'key': 'string',
            'total': {
                'recommendedActionCount': 123,
                'estimatedMonthlySavings': {
                    'currency': 'string',
                    'beforeDiscountSavings': 123.0,
                    'afterDiscountSavings': 123.0,
                    'savingsEstimationMode': 'BeforeDiscount'|'AfterDiscount'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • previewResultSummaries (list) --

      The list of automation rule preview summaries that match the specified criteria.

      • (dict) --

        Contains a summary of preview results for an automation rule.

        • key (string) --

          The key identifier for this preview result summary.

        • total (dict) --

          Aggregate totals for automation rule preview results, including count and estimated savings.

          • recommendedActionCount (integer) --

            The total number of recommended actions matching the rule preview configuration.

          • estimatedMonthlySavings (dict) --

            Contains information about estimated monthly cost savings.

            • currency (string) --

              The currency of the estimated savings.

            • beforeDiscountSavings (float) --

              The estimated monthly savings before applying any discounts.

            • afterDiscountSavings (float) --

              The estimated monthly savings after applying any discounts.

            • savingsEstimationMode (string) --

              The mode used to calculate savings, either BeforeDiscount or AfterDiscount.

    • nextToken (string) --

      A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.

ListAutomationRules (updated) Link ¶
Changes (response)
{'automationRules': {'organizationConfiguration': {'excludedAccountIds': ['string'],
                                                   'excludedOrganizationalUnitIds': ['string'],
                                                   'organizationalUnitIds': ['string']}}}

Lists the automation rules that match specified filters.

See also: AWS API Documentation

Request Syntax

client.list_automation_rules(
    filters=[
        {
            'name': 'Name'|'RecommendedActionType'|'Status'|'RuleType'|'OrganizationConfigurationRuleApplyOrder'|'AccountId',
            'values': [
                'string',
            ]
        },
    ],
    maxResults=123,
    nextToken='string'
)
type filters:

list

param filters:

The filters to apply to the list of automation rules.

  • (dict) --

    A filter used to narrow down results based on specific criteria.

    • name (string) -- [REQUIRED]

      The name of the filter field to apply.

    • values (list) -- [REQUIRED]

      The list of values to filter by for the specified filter field.

      • (string) --

type maxResults:

integer

param maxResults:

The maximum number of automation rules to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

A token used for pagination to retrieve the next set of results when the response is truncated.

rtype:

dict

returns:

Response Syntax

{
    'automationRules': [
        {
            'ruleArn': 'string',
            'ruleId': 'string',
            'name': 'string',
            'description': 'string',
            'ruleType': 'OrganizationRule'|'AccountRule',
            'ruleRevision': 123,
            'accountId': 'string',
            'organizationConfiguration': {
                'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
                'accountIds': [
                    'string',
                ],
                'organizationalUnitIds': [
                    'string',
                ],
                'excludedOrganizationalUnitIds': [
                    'string',
                ],
                'excludedAccountIds': [
                    'string',
                ]
            },
            'priority': 'string',
            'recommendedActionTypes': [
                'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
            ],
            'schedule': {
                'scheduleExpression': 'string',
                'scheduleExpressionTimezone': 'string',
                'executionWindowInMinutes': 123
            },
            'status': 'Active'|'Inactive',
            'createdTimestamp': datetime(2015, 1, 1),
            'lastUpdatedTimestamp': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • automationRules (list) --

      The list of automation rules that match the specified criteria.

      • (dict) --

        Represents a complete automation rule configuration including criteria, schedule, and execution settings.

        • 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 (OrganizationRule or AccountRule).

        • 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 rules.

          • ruleApplyOrder (string) --

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

          • accountIds (list) --

            The specific Amazon Web Services account IDs where the organization rule should be applied. You can specify up to 50 account IDs.

            • (string) --

          • organizationalUnitIds (list) --

            The organizational unit (OU) or organization root IDs to include in the organization rule scope. The rule applies to accounts in the specified OUs and their child OUs. You can specify up to 150 IDs.

            • (string) --

          • excludedOrganizationalUnitIds (list) --

            The organizational unit (OU) or organization root IDs to exclude from the organization rule scope. The rule doesn't apply to accounts in the specified OUs or their child OUs. You can specify up to 150 IDs.

            • (string) --

          • excludedAccountIds (list) --

            The Amazon Web Services account IDs to exclude from the organization rule scope. You can specify up to 50 account IDs. An excluded account remains excluded even if it is in an included OU.

            • (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. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules.

        • recommendedActionTypes (list) --

          List of recommended action types that this rule can execute.

          • (string) --

            Recommended action type enumeration

        • schedule (dict) --

          The schedule configuration for when the automation rule should execute.

          • 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)

          • 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).

        • createdTimestamp (datetime) --

          The timestamp when the automation rule was created.

        • lastUpdatedTimestamp (datetime) --

          The timestamp when the automation rule was last updated.

    • nextToken (string) --

      A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.

ListRecommendedActionSummaries (updated) Link ¶
Changes (request)
{'organizationalUnitIds': ['string']}

Provides a summary of recommended actions based on specified filters.

See also: AWS API Documentation

Request Syntax

client.list_recommended_action_summaries(
    filters=[
        {
            'name': 'ResourceType'|'RecommendedActionType'|'ResourceId'|'LookBackPeriodInDays'|'CurrentResourceDetailsEbsVolumeType'|'ResourceTagsKey'|'ResourceTagsValue'|'AccountId'|'RestartNeeded',
            'values': [
                'string',
            ]
        },
    ],
    organizationalUnitIds=[
        'string',
    ],
    maxResults=123,
    nextToken='string'
)
type filters:

list

param filters:

A list of filters to apply when retrieving recommended action summaries. Filters can be based on resource type, action type, account ID, and other criteria.

  • (dict) --

    A filter used to narrow down recommended action results based on specific criteria. If a filter has more than one value, a recommended action matches the filter when it matches any of the values. If you specify more than one filter, a recommended action must match all of the filters.

    • name (string) -- [REQUIRED]

      The name of the filter field to apply.

    • values (list) -- [REQUIRED]

      The list of values to filter by for the specified filter name. Wildcards aren't supported. An asterisk ( *) or a question mark ( ?) in a value matches only that literal character. How a value is matched depends on the filter name:

      ResourceType, RecommendedActionType, ResourceId, and AccountId

      The value that you specify must exactly match the corresponding field of the recommended action, including case. For example, specify EbsVolume, not ebsvolume.

      CurrentResourceDetailsEbsVolumeType

      Matches when the value appears anywhere in the current resource details of the recommended action, which include the volume type, size, IOPS, and throughput. Matching is case sensitive, and a partial value also matches. For example, gp matches both gp2 and gp3 volumes, and 100 matches any volume whose size, IOPS, or throughput contains 100. To filter by volume type, specify the complete volume type, such as gp3 or io2.

      ResourceTagsKey and ResourceTagsValue

      Matches when the value appears anywhere in the tags of the resource. Both filter names search every tag key and tag value. Matching is case sensitive, and a partial value also matches. For example, a ResourceTagsKey value of test matches a resource that has a tag value of test.

      LookBackPeriodInDays

      Matches when the lookback period of the recommended action equals the value. Specify a number of days, such as 14.

      RestartNeeded

      Matches recommended actions based on whether implementing them requires a resource restart. Specify true or false.

      • (string) --

type organizationalUnitIds:

list

param organizationalUnitIds:

The organizational unit (OU) or organization root IDs to use to filter the results. The response includes recommended action summaries for accounts in the specified OUs and their child OUs. Only the management account or a delegated administrator can specify this parameter.

  • (string) --

type maxResults:

integer

param maxResults:

The maximum number of recommended action summaries to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

A token used for pagination to retrieve the next set of results when the response is truncated.

rtype:

dict

returns:

Response Syntax

{
    'recommendedActionSummaries': [
        {
            'key': 'string',
            'total': {
                'recommendedActionCount': 123,
                'estimatedMonthlySavings': {
                    'currency': 'string',
                    'beforeDiscountSavings': 123.0,
                    'afterDiscountSavings': 123.0,
                    'savingsEstimationMode': 'BeforeDiscount'|'AfterDiscount'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • recommendedActionSummaries (list) --

      The summary of recommended actions that match the specified criteria.

      • (dict) --

        Summary information about recommended actions, grouped by specific criteria with totals and counts.

        • key (string) --

          The grouping key used to categorize the recommended actions in this summary.

        • total (dict) --

          Aggregate totals for the recommended actions in this group, including count and estimated savings.

          • recommendedActionCount (integer) --

            The total number of recommended actions in this group.

          • estimatedMonthlySavings (dict) --

            Contains information about estimated monthly cost savings.

            • currency (string) --

              The currency of the estimated savings.

            • beforeDiscountSavings (float) --

              The estimated monthly savings before applying any discounts.

            • afterDiscountSavings (float) --

              The estimated monthly savings after applying any discounts.

            • savingsEstimationMode (string) --

              The mode used to calculate savings, either BeforeDiscount or AfterDiscount.

    • nextToken (string) --

      A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.

ListRecommendedActions (updated) Link ¶
Changes (request)
{'organizationalUnitIds': ['string']}

Lists the recommended actions that match the specified filters.

See also: AWS API Documentation

Request Syntax

client.list_recommended_actions(
    filters=[
        {
            'name': 'ResourceType'|'RecommendedActionType'|'ResourceId'|'LookBackPeriodInDays'|'CurrentResourceDetailsEbsVolumeType'|'ResourceTagsKey'|'ResourceTagsValue'|'AccountId'|'RestartNeeded',
            'values': [
                'string',
            ]
        },
    ],
    organizationalUnitIds=[
        'string',
    ],
    maxResults=123,
    nextToken='string'
)
type filters:

list

param filters:

The filters to apply to the list of recommended actions.

  • (dict) --

    A filter used to narrow down recommended action results based on specific criteria. If a filter has more than one value, a recommended action matches the filter when it matches any of the values. If you specify more than one filter, a recommended action must match all of the filters.

    • name (string) -- [REQUIRED]

      The name of the filter field to apply.

    • values (list) -- [REQUIRED]

      The list of values to filter by for the specified filter name. Wildcards aren't supported. An asterisk ( *) or a question mark ( ?) in a value matches only that literal character. How a value is matched depends on the filter name:

      ResourceType, RecommendedActionType, ResourceId, and AccountId

      The value that you specify must exactly match the corresponding field of the recommended action, including case. For example, specify EbsVolume, not ebsvolume.

      CurrentResourceDetailsEbsVolumeType

      Matches when the value appears anywhere in the current resource details of the recommended action, which include the volume type, size, IOPS, and throughput. Matching is case sensitive, and a partial value also matches. For example, gp matches both gp2 and gp3 volumes, and 100 matches any volume whose size, IOPS, or throughput contains 100. To filter by volume type, specify the complete volume type, such as gp3 or io2.

      ResourceTagsKey and ResourceTagsValue

      Matches when the value appears anywhere in the tags of the resource. Both filter names search every tag key and tag value. Matching is case sensitive, and a partial value also matches. For example, a ResourceTagsKey value of test matches a resource that has a tag value of test.

      LookBackPeriodInDays

      Matches when the lookback period of the recommended action equals the value. Specify a number of days, such as 14.

      RestartNeeded

      Matches recommended actions based on whether implementing them requires a resource restart. Specify true or false.

      • (string) --

type organizationalUnitIds:

list

param organizationalUnitIds:

The organizational unit (OU) or organization root IDs to use to filter the results. The response includes recommended actions for accounts in the specified OUs and their child OUs. Only the management account or a delegated administrator can specify this parameter.

  • (string) --

type maxResults:

integer

param maxResults:

The maximum number of recommended actions to return in a single response. If you don't specify a value, the default is 100.

type nextToken:

string

param nextToken:

A token used for pagination to retrieve the next set of results when the response is truncated.

rtype:

dict

returns:

Response Syntax

{
    'recommendedActions': [
        {
            'recommendedActionId': 'string',
            'resourceArn': 'string',
            'resourceId': 'string',
            'accountId': 'string',
            'region': 'string',
            'resourceType': 'EbsVolume',
            'lookBackPeriodInDays': 123,
            'recommendedActionType': 'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
            'currentResourceSummary': 'string',
            'currentResourceDetails': {
                'ebsVolume': {
                    'configuration': {
                        'type': 'string',
                        'sizeInGib': 123,
                        'iops': 123,
                        'throughput': 123
                    }
                }
            },
            'recommendedResourceSummary': 'string',
            'recommendedResourceDetails': {
                'ebsVolume': {
                    'configuration': {
                        'type': 'string',
                        'sizeInGib': 123,
                        'iops': 123,
                        'throughput': 123
                    }
                }
            },
            'restartNeeded': True|False,
            'estimatedMonthlySavings': {
                'currency': 'string',
                'beforeDiscountSavings': 123.0,
                'afterDiscountSavings': 123.0,
                'savingsEstimationMode': 'BeforeDiscount'|'AfterDiscount'
            },
            'resourceTags': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • recommendedActions (list) --

      The list of recommended actions that match the specified criteria.

      • (dict) --

        Contains information about a recommended action that can be applied to optimize an Amazon Web Services resource.

        • recommendedActionId (string) --

          The unique identifier of the recommended action.

        • resourceArn (string) --

          The Amazon Resource Name (ARN) of the resource that the recommendation applies to.

        • resourceId (string) --

          The ID of the resource that the recommendation applies to.

        • accountId (string) --

          The Amazon Web Services account ID that owns the resource.

        • region (string) --

          The Amazon Web Services Region where the resource is located.

        • resourceType (string) --

          The type of resource being evaluated.

        • lookBackPeriodInDays (integer) --

          The number of days of historical data used to generate the recommendation.

        • recommendedActionType (string) --

          The type of action being recommended.

        • currentResourceSummary (string) --

          A summary of the resource's current configuration.

        • currentResourceDetails (dict) --

          Detailed configuration information for a specific Amazon Web Services resource, with type-specific details.

          • ebsVolume (dict) --

            Detailed configuration information specific to EBS volumes, including volume type, size, IOPS, and throughput settings.

            • configuration (dict) --

              The configuration details of the EBS volume, including type, size, IOPS, and throughput.

              • type (string) --

                The EBS volume type, such as gp2, gp3, io1, io2, st1, or sc1.

              • sizeInGib (integer) --

                The size of the EBS volume in gibibytes (GiB).

              • iops (integer) --

                The number of I/O operations per second (IOPS) provisioned for the volume.

              • throughput (integer) --

                The throughput in MiB/s provisioned for the volume (applicable to gp3, io1, and io2bx volumes).

        • recommendedResourceSummary (string) --

          A summary of the resource's recommended configuration.

        • recommendedResourceDetails (dict) --

          Detailed configuration information for a specific Amazon Web Services resource, with type-specific details.

          • ebsVolume (dict) --

            Detailed configuration information specific to EBS volumes, including volume type, size, IOPS, and throughput settings.

            • configuration (dict) --

              The configuration details of the EBS volume, including type, size, IOPS, and throughput.

              • type (string) --

                The EBS volume type, such as gp2, gp3, io1, io2, st1, or sc1.

              • sizeInGib (integer) --

                The size of the EBS volume in gibibytes (GiB).

              • iops (integer) --

                The number of I/O operations per second (IOPS) provisioned for the volume.

              • throughput (integer) --

                The throughput in MiB/s provisioned for the volume (applicable to gp3, io1, and io2bx volumes).

        • restartNeeded (boolean) --

          Indicates whether implementing the recommended action requires a resource restart.

        • estimatedMonthlySavings (dict) --

          Contains information about estimated monthly cost savings.

          • currency (string) --

            The currency of the estimated savings.

          • beforeDiscountSavings (float) --

            The estimated monthly savings before applying any discounts.

          • afterDiscountSavings (float) --

            The estimated monthly savings after applying any discounts.

          • savingsEstimationMode (string) --

            The mode used to calculate savings, either BeforeDiscount or AfterDiscount.

        • resourceTags (list) --

          The tags associated with the resource.

          • (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.

    • nextToken (string) --

      A token used for pagination. If present, indicates there are more results available and can be used in subsequent requests.

UpdateAutomationRule (updated) Link ¶
Changes (both)
{'organizationConfiguration': {'excludedAccountIds': ['string'],
                               'excludedOrganizationalUnitIds': ['string'],
                               'organizationalUnitIds': ['string']}}

Updates an existing automation rule.

See also: AWS API Documentation

Request Syntax

client.update_automation_rule(
    ruleArn='string',
    ruleRevision=123,
    name='string',
    description='string',
    ruleType='OrganizationRule'|'AccountRule',
    organizationConfiguration={
        'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
        'accountIds': [
            'string',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    priority='string',
    recommendedActionTypes=[
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    criteria={
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ]
    },
    schedule={
        'scheduleExpression': 'string',
        'scheduleExpressionTimezone': 'string',
        'executionWindowInMinutes': 123
    },
    status='Active'|'Inactive',
    clientToken='string'
)
type ruleArn:

string

param ruleArn:

[REQUIRED]

The ARN of the rule to update.

type ruleRevision:

integer

param ruleRevision:

[REQUIRED]

The revision number of the rule to update.

type name:

string

param name:

The updated name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.

type description:

string

param description:

The updated description of the automation rule. Can be up to 1024 characters long and contain alphanumeric characters, underscores, hyphens, spaces, and certain special characters.

type ruleType:

string

param ruleType:

The updated type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.

type organizationConfiguration:

dict

param organizationConfiguration:

Updated configuration settings for organization-wide rules, including rule application order and target account IDs.

  • ruleApplyOrder (string) --

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

  • accountIds (list) --

    The specific Amazon Web Services account IDs where the organization rule should be applied. You can specify up to 50 account IDs.

    • (string) --

  • organizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to include in the organization rule scope. The rule applies to accounts in the specified OUs and their child OUs. You can specify up to 150 IDs.

    • (string) --

  • excludedOrganizationalUnitIds (list) --

    The organizational unit (OU) or organization root IDs to exclude from the organization rule scope. The rule doesn't apply to accounts in the specified OUs or their child OUs. You can specify up to 150 IDs.

    • (string) --

  • excludedAccountIds (list) --

    The Amazon Web Services account IDs to exclude from the organization rule scope. You can specify up to 50 account IDs. An excluded account remains excluded even if it is in an included OU.

    • (string) --

type priority:

string

param priority:

The updated priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.

type recommendedActionTypes:

list

param recommendedActionTypes:

Updated list of recommended action types that this rule can execute, such as SnapshotAndDeleteUnattachedEbsVolume or UpgradeEbsVolumeType.

  • (string) --

    Recommended action type enumeration

type criteria:

dict

param criteria:

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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

      • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

    • (dict) --

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

      • comparison (string) --

        The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

      • values (list) --

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

        • (string) --

type schedule:

dict

param schedule:

The updated schedule configuration for when the automation rule should execute, including cron expression, timezone, and execution window.

  • 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)

  • 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.

type status:

string

param status:

The updated status of the automation rule. Can be Active or Inactive.

type clientToken:

string

param clientToken:

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'ruleArn': 'string',
    'ruleRevision': 123,
    'name': 'string',
    'description': 'string',
    'ruleType': 'OrganizationRule'|'AccountRule',
    'organizationConfiguration': {
        'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
        'accountIds': [
            'string',
        ],
        'organizationalUnitIds': [
            'string',
        ],
        'excludedOrganizationalUnitIds': [
            'string',
        ],
        'excludedAccountIds': [
            'string',
        ]
    },
    'priority': 'string',
    'recommendedActionTypes': [
        'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
    ],
    'criteria': {
        'region': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'resourceArn': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeType': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ],
        'ebsVolumeSizeInGib': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'estimatedMonthlySavings': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123.0,
                ]
            },
        ],
        'resourceTag': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'key': 'string',
                'values': [
                    'string',
                ]
            },
        ],
        'lookBackPeriodInDays': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    123,
                ]
            },
        ],
        'restartNeeded': [
            {
                'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals'|'StringEqualsIfExists'|'StringNotEqualsIfExists'|'StringEqualsIgnoreCaseIfExists'|'StringNotEqualsIgnoreCaseIfExists'|'StringLikeIfExists'|'StringNotLikeIfExists'|'NumericEqualsIfExists'|'NumericNotEqualsIfExists'|'NumericLessThanIfExists'|'NumericLessThanEqualsIfExists'|'NumericGreaterThanIfExists'|'NumericGreaterThanEqualsIfExists',
                'values': [
                    'string',
                ]
            },
        ]
    },
    'schedule': {
        'scheduleExpression': 'string',
        'scheduleExpressionTimezone': 'string',
        'executionWindowInMinutes': 123
    },
    'status': 'Active'|'Inactive',
    'createdTimestamp': datetime(2015, 1, 1),
    'lastUpdatedTimestamp': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • ruleArn (string) --

      The ARN of the updated rule.

    • ruleRevision (integer) --

      The new revision number of the updated rule.

    • name (string) --

      The updated name of the automation rule.

    • description (string) --

      The updated description of the automation rule.

    • ruleType (string) --

      The updated type of automation rule.

    • organizationConfiguration (dict) --

      The updated organization configuration settings.

      • ruleApplyOrder (string) --

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

      • accountIds (list) --

        The specific Amazon Web Services account IDs where the organization rule should be applied. You can specify up to 50 account IDs.

        • (string) --

      • organizationalUnitIds (list) --

        The organizational unit (OU) or organization root IDs to include in the organization rule scope. The rule applies to accounts in the specified OUs and their child OUs. You can specify up to 150 IDs.

        • (string) --

      • excludedOrganizationalUnitIds (list) --

        The organizational unit (OU) or organization root IDs to exclude from the organization rule scope. The rule doesn't apply to accounts in the specified OUs or their child OUs. You can specify up to 150 IDs.

        • (string) --

      • excludedAccountIds (list) --

        The Amazon Web Services account IDs to exclude from the organization rule scope. You can specify up to 50 account IDs. An excluded account remains excluded even if it is in an included OU.

        • (string) --

    • priority (string) --

      The updated priority level of the automation rule.

    • recommendedActionTypes (list) --

      The updated list of recommended action types.

      • (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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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 attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • 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 used to evaluate the attribute against the specified values. Only operators that begin with Numeric are valid. Any other operator returns an InvalidParameterValueException.

          • 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. Valid values are true and false. Values are case-sensitive unless you use an IgnoreCase comparison operator. For example, StringEquals with the value False matches no recommended actions.

        • (dict) --

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

          • comparison (string) --

            The comparison operator used to evaluate the attribute against the specified values. Only operators that begin with String are valid. Any other operator returns an InvalidParameterValueException.

          • values (list) --

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

            • (string) --

    • schedule (dict) --

      The updated schedule configuration.

      • 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)

      • 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 updated status of the automation rule.

    • createdTimestamp (datetime) --

      The timestamp when the automation rule was originally created.

    • lastUpdatedTimestamp (datetime) --

      The timestamp when the automation rule was last updated.