ComputeOptimizerAutomation / Client / update_automation_rule
update_automation_rule¶
- ComputeOptimizerAutomation.Client.update_automation_rule(**kwargs)¶
Updates an existing automation rule.
See also: AWS API Documentation
Request Syntax
response = 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' )
- Parameters:
ruleArn (string) –
[REQUIRED]
The ARN of the rule to update.
ruleRevision (integer) –
[REQUIRED]
The revision number of the rule to update.
name (string) – The updated name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.
description (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.
ruleType (string) – The updated type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.
organizationConfiguration (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) –
priority (string) – The updated priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.
recommendedActionTypes (list) –
Updated 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 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.
cronexpression is supported. Acronexpression consists of six fields separated by white spaces: (minuteshoursday_of_monthmonthday_of_weekyear)Note
You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (
30 12 * * *) runs daily at 12:30 PM UTC.scheduleExpressionTimezone (string) –
The timezone to use when interpreting the schedule expression.
executionWindowInMinutes (integer) –
The time window in minutes during which the automation rule can start implementing recommended actions.
status (string) – The updated status of the automation rule. Can be Active or Inactive.
clientToken (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.
- Return type:
dict
- Returns:
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.
cronexpression is supported. Acronexpression consists of six fields separated by white spaces: (minuteshoursday_of_monthmonthday_of_weekyear)Note
You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (
30 12 * * *) runs daily at 12:30 PM UTC.scheduleExpressionTimezone (string) –
The timezone to use when interpreting the schedule expression.
executionWindowInMinutes (integer) –
The time window in minutes during which the automation rule can start implementing recommended actions.
status (string) –
The 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.
Exceptions
ComputeOptimizerAutomation.Client.exceptions.InvalidParameterValueExceptionComputeOptimizerAutomation.Client.exceptions.ForbiddenExceptionComputeOptimizerAutomation.Client.exceptions.OptInRequiredExceptionComputeOptimizerAutomation.Client.exceptions.ResourceNotFoundExceptionComputeOptimizerAutomation.Client.exceptions.ThrottlingExceptionComputeOptimizerAutomation.Client.exceptions.IdempotentParameterMismatchExceptionComputeOptimizerAutomation.Client.exceptions.AccessDeniedExceptionComputeOptimizerAutomation.Client.exceptions.InternalServerExceptionComputeOptimizerAutomation.Client.exceptions.ServiceUnavailableExceptionComputeOptimizerAutomation.Client.exceptions.IdempotencyTokenInUseException