2025/11/21 - Compute Optimizer Automation - 23 new api methods
Changes Initial release of AWS Compute Optimizer Automation. Create automation rules to implement recommended actions on a recurring schedule based on your specified criteria. Supported actions include: snapshot and delete unattached EBS volumes and upgrade volume types to the latest generation.
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',
]
},
],
startTimeInclusive=datetime(2015, 1, 1),
endTimeExclusive=datetime(2015, 1, 1),
maxResults=123,
nextToken='string'
)
list
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.
(string) --
datetime
The start of the time range to query for events.
datetime
The end of the time range to query for events.
integer
The maximum number of results to return in a single call.
string
The token for the next page of results.
dict
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.
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'
)
integer
The maximum number of results to return in a single call.
string
The token for the next page of results.
dict
Response Syntax
{
'accounts': [
{
'accountId': 'string',
'status': 'Active'|'Inactive'|'Pending'|'Failed',
'organizationRuleMode': 'AnyAllowed'|'NoneAllowed',
'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.
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.
Retrieves details about a specific automation rule.
See also: AWS API Documentation
Request Syntax
client.get_automation_rule(
ruleArn='string'
)
string
[REQUIRED]
The ARN of the rule to retrieve.
dict
Response Syntax
{
'ruleArn': 'string',
'ruleId': 'string',
'name': 'string',
'description': 'string',
'ruleType': 'OrganizationRule'|'AccountRule',
'ruleRevision': 123,
'accountId': 'string',
'organizationConfiguration': {
'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
'accountIds': [
'string',
]
},
'priority': 'string',
'recommendedActionTypes': [
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
'criteria': {
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
'schedule': {
'scheduleExpression': 'string',
'scheduleExpressionTimezone': 'string',
'executionWindowInMinutes': 123
},
'status': 'Active'|'Inactive',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'createdTimestamp': datetime(2015, 1, 1),
'lastUpdatedTimestamp': datetime(2015, 1, 1)
}
Response Structure
(dict) --
ruleArn (string) --
The Amazon Resource Name (ARN) of the automation rule.
ruleId (string) --
The unique identifier of the automation rule.
name (string) --
The name of the automation rule.
description (string) --
A description of the automation rule.
ruleType (string) --
The type of automation rule.
ruleRevision (integer) --
The revision number of the automation rule.
accountId (string) --
The 12-digit Amazon Web Services account ID that owns this automation rule.
organizationConfiguration (dict) --
Configuration settings for organization-wide automation rules.
ruleApplyOrder (string) --
Specifies when organization rules should be applied relative to account rules.
accountIds (list) --
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(string) --
priority (string) --
A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule.
recommendedActionTypes (list) --
List of recommended action types that this rule can execute.
(string) --
Recommended action type enumeration
criteria (dict) --
A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.
region (list) --
Filter criteria for Amazon Web Services regions where resources must be located.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
schedule (dict) --
Configuration for scheduling when automation rules should execute, including timing and execution windows.
scheduleExpression (string) --
The expression that defines when the schedule runs. cron expression is supported. A cron expression consists of six fields separated by white spaces: ( minutes hours day_of_month month day_of_week year)
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.
Associates one or more member accounts with your organization's management account, enabling centralized implementation of optimization actions across those accounts. Once associated, the management account (or a delegated administrator) can apply recommended actions to the member account. When you associate a member account, its organization rule mode is automatically set to "Any allowed," which permits the management account to create Automation rules that automatically apply actions to that account. If the member account has not previously enabled the Automation feature, the association process automatically enables it.
See also: AWS API Documentation
Request Syntax
client.associate_accounts(
accountIds=[
'string',
],
clientToken='string'
)
list
[REQUIRED]
The IDs of the member accounts to associate. You can specify up to 50 account IDs.
(string) --
string
A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.
This field is autopopulated if not provided.
dict
Response Syntax
{
'accountIds': [
'string',
],
'errors': [
'string',
]
}
Response Structure
(dict) --
accountIds (list) --
The IDs of the member accounts that were successfully associated.
(string) --
errors (list) --
Any errors that occurred during the association process.
(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',
]
},
priority='string',
recommendedActionTypes=[
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
criteria={
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
schedule={
'scheduleExpression': 'string',
'scheduleExpressionTimezone': 'string',
'executionWindowInMinutes': 123
},
status='Active'|'Inactive',
tags=[
{
'key': 'string',
'value': 'string'
},
],
clientToken='string'
)
string
[REQUIRED]
The name of the automation rule.
string
A description of the automation rule.
string
[REQUIRED]
The type of rule.
dict
Configuration for organization-level rules. Required for OrganizationRule type.
ruleApplyOrder (string) --
Specifies when organization rules should be applied relative to account rules.
accountIds (list) --
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(string) --
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.
list
[REQUIRED]
The types of recommended actions this rule will automate.
(string) --
Recommended action type enumeration
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.
region (list) --
Filter criteria for Amazon Web Services regions where resources must be located.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
dict
[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.
string
[REQUIRED]
The status of the rule
list
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.
string
A unique identifier to ensure idempotency of the request.
This field is autopopulated if not provided.
dict
Response Syntax
{
'ruleArn': 'string',
'ruleId': 'string',
'name': 'string',
'description': 'string',
'ruleType': 'OrganizationRule'|'AccountRule',
'ruleRevision': 123,
'organizationConfiguration': {
'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
'accountIds': [
'string',
]
},
'priority': 'string',
'recommendedActionTypes': [
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
'criteria': {
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
'schedule': {
'scheduleExpression': 'string',
'scheduleExpressionTimezone': 'string',
'executionWindowInMinutes': 123
},
'status': 'Active'|'Inactive',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'createdTimestamp': datetime(2015, 1, 1)
}
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) --
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(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 string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
schedule (dict) --
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.
Deletes an existing automation rule.
See also: AWS API Documentation
Request Syntax
client.delete_automation_rule(
ruleArn='string',
ruleRevision=123,
clientToken='string'
)
string
[REQUIRED]
The ARN of the rule to delete.
integer
[REQUIRED]
The revision number of the rule to delete.
string
A unique identifier to ensure idempotency of the request.
This field is autopopulated if not provided.
dict
Response Syntax
{}
Response Structure
(dict) --
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',
]
},
recommendedActionTypes=[
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
criteria={
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
maxResults=123,
nextToken='string'
)
string
[REQUIRED]
The type of rule.
dict
The organizational scope for the rule preview.
accountIds (list) --
List of Amazon Web Services account IDs to include in the organization scope.
(string) --
list
[REQUIRED]
The types of recommended actions to include in the preview.
(string) --
Recommended action type enumeration
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.
region (list) --
Filter criteria for Amazon Web Services regions where resources must be located.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
integer
The maximum number of automation rule preview results to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
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.
Disassociates member accounts from your organization's management account, removing centralized automation capabilities. Once disassociated, organization rules no longer apply to the member account, and the management account (or delegated administrator) cannot create Automation rules for that account.
See also: AWS API Documentation
Request Syntax
client.disassociate_accounts(
accountIds=[
'string',
],
clientToken='string'
)
list
[REQUIRED]
The IDs of the member accounts to disassociate.
(string) --
string
A unique identifier to ensure idempotency of the request.
This field is autopopulated if not provided.
dict
Response Syntax
{
'accountIds': [
'string',
],
'errors': [
'string',
]
}
Response Structure
(dict) --
accountIds (list) --
The IDs of the member accounts that were successfully disassociated.
(string) --
errors (list) --
Any errors that occurred during the disassociation process.
(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',
]
},
priority='string',
recommendedActionTypes=[
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
criteria={
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
schedule={
'scheduleExpression': 'string',
'scheduleExpressionTimezone': 'string',
'executionWindowInMinutes': 123
},
status='Active'|'Inactive',
clientToken='string'
)
string
[REQUIRED]
The ARN of the rule to update.
integer
[REQUIRED]
The revision number of the rule to update.
string
The updated name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.
string
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.
string
The updated type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.
dict
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) --
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(string) --
string
The updated priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.
list
Updated list of recommended action types that this rule can execute, such as SnapshotAndDeleteUnattachedEbsVolume or UpgradeEbsVolumeType.
(string) --
Recommended action type enumeration
dict
A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.
region (list) --
Filter criteria for Amazon Web Services regions where resources must be located.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
dict
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.
string
The updated status of the automation rule. Can be Active or Inactive.
string
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.
dict
Response Syntax
{
'ruleArn': 'string',
'ruleRevision': 123,
'name': 'string',
'description': 'string',
'ruleType': 'OrganizationRule'|'AccountRule',
'organizationConfiguration': {
'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
'accountIds': [
'string',
]
},
'priority': 'string',
'recommendedActionTypes': [
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
'criteria': {
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
'schedule': {
'scheduleExpression': 'string',
'scheduleExpressionTimezone': 'string',
'executionWindowInMinutes': 123
},
'status': 'Active'|'Inactive',
'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) --
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(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 string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
schedule (dict) --
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.
Lists the tags for a specified resource.
See also: AWS API Documentation
Request Syntax
client.list_tags_for_resource(
resourceArn='string'
)
string
[REQUIRED]
The ARN of the resource to list tags for.
dict
Response Syntax
{
'tags': [
{
'key': 'string',
'value': 'string'
},
]
}
Response Structure
(dict) --
tags (list) --
The list of tags associated with the specified 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.
Initiates a one-time, on-demand automation for the specified recommended action.
See also: AWS API Documentation
Request Syntax
client.start_automation_event(
recommendedActionId='string',
clientToken='string'
)
string
[REQUIRED]
The ID of the recommended action to automate.
string
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.
dict
Response Syntax
{
'recommendedActionId': 'string',
'eventId': 'string',
'eventStatus': 'Ready'|'InProgress'|'Complete'|'Failed'|'Cancelled'|'RollbackReady'|'RollbackInProgress'|'RollbackComplete'|'RollbackFailed'
}
Response Structure
(dict) --
recommendedActionId (string) --
The ID of the recommended action being automated.
eventId (string) --
The ID of the automation event.
eventStatus (string) --
The current status of the automation event.
Retrieves details about a specific automation event.
See also: AWS API Documentation
Request Syntax
client.get_automation_event(
eventId='string'
)
string
[REQUIRED]
The ID of the automation event to retrieve.
dict
Response Syntax
{
'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'
}
}
Response Structure
(dict) --
eventId (string) --
The ID of the automation event to retrieve.
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) --
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.
Updates your account’s Compute Optimizer Automation enrollment configuration.
See also: AWS API Documentation
Request Syntax
client.update_enrollment_configuration(
status='Active'|'Inactive'|'Pending'|'Failed',
clientToken='string'
)
string
[REQUIRED]
The desired enrollment status.
Active - Enables the Automation feature for your account.
Inactive - Disables the Automation feature for your account and stops all of your automation rules. If you opt in again later, all rules will be inactive, and you must enable the rules you want to run. You must wait at least 24 hours after opting out to opt in again.
string
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.
dict
Response Syntax
{
'status': 'Active'|'Inactive'|'Pending'|'Failed',
'statusReason': 'string',
'lastUpdatedTimestamp': datetime(2015, 1, 1)
}
Response Structure
(dict) --
status (string) --
The updated enrollment status.
statusReason (string) --
The reason for the updated enrollment status.
lastUpdatedTimestamp (datetime) --
The timestamp when the enrollment configuration was last updated.
Lists the steps for a specific automation event. You can only list steps for events created within the past year.
See also: AWS API Documentation
Request Syntax
client.list_automation_event_steps(
eventId='string',
maxResults=123,
nextToken='string'
)
string
[REQUIRED]
The ID of the automation event.
integer
The maximum number of automation event steps to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
Response Syntax
{
'automationEventSteps': [
{
'eventId': 'string',
'stepId': 'string',
'stepType': 'CreateEbsSnapshot'|'DeleteEbsVolume'|'ModifyEbsVolume'|'CreateEbsVolume',
'stepStatus': 'Ready'|'InProgress'|'Complete'|'Failed',
'resourceId': 'string',
'startTimestamp': 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) --
automationEventSteps (list) --
The list of steps for the specified automation event.
(dict) --
Contains information about a step in an automation event.
eventId (string) --
The ID of the automation event this step belongs to.
stepId (string) --
The unique identifier for this step.
stepType (string) --
The type of step.
stepStatus (string) --
The current status of the step.
resourceId (string) --
The unique identifier of the resource being acted upon in this step.
startTimestamp (datetime) --
The timestamp when this automation event step started execution.
completedTimestamp (datetime) --
The timestamp when this automation event step completed execution.
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.
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'
)
list
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) --
integer
The maximum number of automation rules to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
Response Syntax
{
'automationRules': [
{
'ruleArn': 'string',
'ruleId': 'string',
'name': 'string',
'description': 'string',
'ruleType': 'OrganizationRule'|'AccountRule',
'ruleRevision': 123,
'accountId': 'string',
'organizationConfiguration': {
'ruleApplyOrder': 'BeforeAccountRules'|'AfterAccountRules',
'accountIds': [
'string',
]
},
'priority': 'string',
'recommendedActionTypes': [
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
'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) --
List of specific Amazon Web Services account IDs where the organization rule should be applied.
(string) --
priority (string) --
A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule. 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.
Retrieves the current enrollment configuration for Compute Optimizer Automation.
See also: AWS API Documentation
Request Syntax
client.get_enrollment_configuration()
dict
Response Syntax
{
'status': 'Active'|'Inactive'|'Pending'|'Failed',
'statusReason': 'string',
'organizationRuleMode': 'AnyAllowed'|'NoneAllowed',
'lastUpdatedTimestamp': datetime(2015, 1, 1)
}
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.
Adds tags to the specified resource.
See also: AWS API Documentation
Request Syntax
client.tag_resource(
resourceArn='string',
ruleRevision=123,
tags=[
{
'key': 'string',
'value': 'string'
},
],
clientToken='string'
)
string
[REQUIRED]
The ARN of the resource to tag.
integer
[REQUIRED]
The revision number of the automation rule to tag. This ensures you're tagging the correct version of the rule.
list
[REQUIRED]
The tags to add to the resource.
(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.
string
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.
dict
Response Syntax
{}
Response Structure
(dict) --
Removes tags from the specified resource.
See also: AWS API Documentation
Request Syntax
client.untag_resource(
resourceArn='string',
ruleRevision=123,
tagKeys=[
'string',
],
clientToken='string'
)
string
[REQUIRED]
The ARN of the resource to untag.
integer
[REQUIRED]
The revision number of the automation rule to untag. This ensures you're untagging the correct version of the rule.
list
[REQUIRED]
The keys of the tags to remove from the resource.
(string) --
string
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.
dict
Response Syntax
{}
Response Structure
(dict) --
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',
]
},
],
startDateInclusive='string',
endDateExclusive='string',
maxResults=123,
nextToken='string'
)
list
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.
(string) --
string
The start date for filtering automation event summaries, inclusive. Events created on or after this date will be included.
string
The end date for filtering automation event summaries, exclusive. Events created before this date will be included.
integer
The maximum number of automation event summaries to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
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.
Lists the recommended actions based that match 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',
]
},
],
maxResults=123,
nextToken='string'
)
list
The filters to apply to the list of recommended actions.
(dict) --
A filter used to narrow down recommended action results based on specific criteria.
name (string) -- [REQUIRED]
The name of the filter field to apply.
values (list) -- [REQUIRED]
List of filter values to match against the specified filter name. Used to narrow down recommended actions based on specific criteria.
(string) --
integer
The maximum number of recommended actions to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
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.
Initiates a rollback for a completed automation event.
See also: AWS API Documentation
Request Syntax
client.rollback_automation_event(
eventId='string',
clientToken='string'
)
string
[REQUIRED]
The ID of the automation event to roll back.
string
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.
dict
Response Syntax
{
'eventId': 'string',
'eventStatus': 'Ready'|'InProgress'|'Complete'|'Failed'|'Cancelled'|'RollbackReady'|'RollbackInProgress'|'RollbackComplete'|'RollbackFailed'
}
Response Structure
(dict) --
eventId (string) --
The ID of the automation event being rolled back.
eventStatus (string) --
The current status of the rollback operation.
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',
]
},
],
maxResults=123,
nextToken='string'
)
list
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.
name (string) -- [REQUIRED]
The name of the filter field to apply.
values (list) -- [REQUIRED]
List of filter values to match against the specified filter name. Used to narrow down recommended actions based on specific criteria.
(string) --
integer
The maximum number of recommended action summaries to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
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.
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',
]
},
recommendedActionTypes=[
'SnapshotAndDeleteUnattachedEbsVolume'|'UpgradeEbsVolumeType',
],
criteria={
'region': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'resourceArn': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeType': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
],
'ebsVolumeSizeInGib': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'estimatedMonthlySavings': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123.0,
]
},
],
'resourceTag': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'key': 'string',
'values': [
'string',
]
},
],
'lookBackPeriodInDays': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
123,
]
},
],
'restartNeeded': [
{
'comparison': 'StringEquals'|'StringNotEquals'|'StringEqualsIgnoreCase'|'StringNotEqualsIgnoreCase'|'StringLike'|'StringNotLike'|'NumericEquals'|'NumericNotEquals'|'NumericLessThan'|'NumericLessThanEquals'|'NumericGreaterThan'|'NumericGreaterThanEquals',
'values': [
'string',
]
},
]
},
maxResults=123,
nextToken='string'
)
string
[REQUIRED]
The type of rule.
dict
The organizational scope for the rule preview.
accountIds (list) --
List of Amazon Web Services account IDs to include in the organization scope.
(string) --
list
[REQUIRED]
The types of recommended actions to include in the preview.
(string) --
Recommended action type enumeration
dict
A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.
region (list) --
Filter criteria for Amazon Web Services regions where resources must be located.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
resourceArn (list) --
Filter criteria for specific resource ARNs to include or exclude.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeType (list) --
Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
ebsVolumeSizeInGib (list) --
Filter criteria for EBS volume sizes in gibibytes (GiB).
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
estimatedMonthlySavings (list) --
Filter criteria for estimated monthly cost savings from the recommended action.
(dict) --
Defines a condition for filtering based on double/floating-point numeric values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of double values to compare against using the specified comparison operator.
(float) --
resourceTag (list) --
Filter criteria for resource tags, allowing filtering by tag key and value combinations.
(dict) --
Criteria condition for filtering resources based on their tags, including comparison operators and values.
comparison (string) --
The comparison operator used to evaluate the tag criteria, such as equals, not equals, or contains.
key (string) --
The tag key to use for comparison when filtering resources.
values (list) --
List of tag values to compare against when filtering resources.
(string) --
lookBackPeriodInDays (list) --
Filter criteria for the lookback period in days used to analyze resource utilization.
(dict) --
Defines a condition for filtering based on integer values with comparison operators.
comparison (string) --
The comparison operator to use, such as equals, greater than, less than, etc.
values (list) --
The list of integer values to compare against using the specified comparison operator.
(integer) --
restartNeeded (list) --
Filter criteria indicating whether the recommended action requires a resource restart.
(dict) --
Criteria condition for filtering based on string values, including comparison operators and target values.
comparison (string) --
The comparison operator used to evaluate the string criteria, such as equals, not equals, or contains.
values (list) --
List of string values to compare against when applying the criteria condition.
(string) --
integer
The maximum number of automation rule preview summaries to return in a single response. Valid range is 1-1000.
string
A token used for pagination to retrieve the next set of results when the response is truncated.
dict
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.