UpdateAutomationRule
Updates an existing automation rule.
Request Syntax
{
"clientToken": "string",
"criteria": {
"ebsVolumeSizeInGib": [
{
"comparison": "string",
"values": [ number ]
}
],
"ebsVolumeType": [
{
"comparison": "string",
"values": [ "string" ]
}
],
"estimatedMonthlySavings": [
{
"comparison": "string",
"values": [ number ]
}
],
"lookBackPeriodInDays": [
{
"comparison": "string",
"values": [ number ]
}
],
"region": [
{
"comparison": "string",
"values": [ "string" ]
}
],
"resourceArn": [
{
"comparison": "string",
"values": [ "string" ]
}
],
"resourceTag": [
{
"comparison": "string",
"key": "string",
"values": [ "string" ]
}
],
"restartNeeded": [
{
"comparison": "string",
"values": [ "string" ]
}
]
},
"description": "string",
"name": "string",
"organizationConfiguration": {
"accountIds": [ "string" ],
"ruleApplyOrder": "string"
},
"priority": "string",
"recommendedActionTypes": [ "string" ],
"ruleArn": "string",
"ruleRevision": number,
"ruleType": "string",
"schedule": {
"executionWindowInMinutes": number,
"scheduleExpression": "string",
"scheduleExpressionTimezone": "string"
},
"status": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- clientToken
-
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.
Type: String
Pattern:
[a-zA-Z0-9_-]{1,64}Required: No
- criteria
-
A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.
Type: Criteria object
Required: No
- description
-
The updated description of the automation rule. Can be up to 1024 characters long and contain alphanumeric characters, underscores, hyphens, spaces, and certain special characters.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 1024.
Pattern:
[a-zA-Z0-9_\-\s@\.]*Required: No
- name
-
The updated name of the automation rule. Must be 1-128 characters long and contain only alphanumeric characters, underscores, and hyphens.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 128.
Pattern:
[a-zA-Z0-9_-]*Required: No
- organizationConfiguration
-
Updated configuration settings for organization-wide rules, including rule application order and target account IDs.
Type: OrganizationConfiguration object
Required: No
- priority
-
The updated priority level of the automation rule, used to determine execution order when multiple rules apply to the same resource.
Type: String
Required: No
- recommendedActionTypes
-
Updated list of recommended action types that this rule can execute, such as SnapshotAndDeleteUnattachedEbsVolume or UpgradeEbsVolumeType.
Type: Array of strings
Valid Values:
SnapshotAndDeleteUnattachedEbsVolume | UpgradeEbsVolumeTypeRequired: No
- ruleArn
-
The ARN of the rule to update.
Type: String
Pattern:
arn:aws:compute-optimizer::[0-9]{12}:automation-rule/[a-zA-Z0-9_-]+Required: Yes
- ruleRevision
-
The revision number of the rule to update.
Type: Long
Required: Yes
- ruleType
-
The updated type of automation rule. Can be either OrganizationRule for organization-wide rules or AccountRule for account-specific rules.
Type: String
Valid Values:
OrganizationRule | AccountRuleRequired: No
- schedule
-
The updated schedule configuration for when the automation rule should execute, including cron expression, timezone, and execution window.
Type: Schedule object
Required: No
- status
-
The updated status of the automation rule. Can be Active or Inactive.
Type: String
Valid Values:
Active | InactiveRequired: No
Response Syntax
{
"createdTimestamp": number,
"criteria": {
"ebsVolumeSizeInGib": [
{
"comparison": "string",
"values": [ number ]
}
],
"ebsVolumeType": [
{
"comparison": "string",
"values": [ "string" ]
}
],
"estimatedMonthlySavings": [
{
"comparison": "string",
"values": [ number ]
}
],
"lookBackPeriodInDays": [
{
"comparison": "string",
"values": [ number ]
}
],
"region": [
{
"comparison": "string",
"values": [ "string" ]
}
],
"resourceArn": [
{
"comparison": "string",
"values": [ "string" ]
}
],
"resourceTag": [
{
"comparison": "string",
"key": "string",
"values": [ "string" ]
}
],
"restartNeeded": [
{
"comparison": "string",
"values": [ "string" ]
}
]
},
"description": "string",
"lastUpdatedTimestamp": number,
"name": "string",
"organizationConfiguration": {
"accountIds": [ "string" ],
"ruleApplyOrder": "string"
},
"priority": "string",
"recommendedActionTypes": [ "string" ],
"ruleArn": "string",
"ruleRevision": number,
"ruleType": "string",
"schedule": {
"executionWindowInMinutes": number,
"scheduleExpression": "string",
"scheduleExpressionTimezone": "string"
},
"status": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- createdTimestamp
-
The timestamp when the automation rule was originally created.
Type: Timestamp
- criteria
-
A set of conditions that specify which recommended action qualify for implementation. When a rule is active and a recommended action matches these criteria, Compute Optimizer implements the action at the scheduled run time. You can specify up to 20 conditions per filter criteria and 20 values per condition.
Type: Criteria object
- description
-
The updated description of the automation rule.
Type: String
- lastUpdatedTimestamp
-
The timestamp when the automation rule was last updated.
Type: Timestamp
- name
-
The updated name of the automation rule.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 128.
Pattern:
[a-zA-Z0-9_-]* - organizationConfiguration
-
The updated organization configuration settings.
Type: OrganizationConfiguration object
- priority
-
The updated priority level of the automation rule.
Type: String
- recommendedActionTypes
-
The updated list of recommended action types.
Type: Array of strings
Valid Values:
SnapshotAndDeleteUnattachedEbsVolume | UpgradeEbsVolumeType - ruleArn
-
The ARN of the updated rule.
Type: String
Pattern:
arn:aws:compute-optimizer::[0-9]{12}:automation-rule/[a-zA-Z0-9_-]+ - ruleRevision
-
The new revision number of the updated rule.
Type: Long
- ruleType
-
The updated type of automation rule.
Type: String
Valid Values:
OrganizationRule | AccountRule - schedule
-
The updated schedule configuration.
Type: Schedule object
- status
-
The updated status of the automation rule.
Type: String
Valid Values:
Active | Inactive
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 400
- ForbiddenException
-
You are not authorized to perform this action.
HTTP Status Code: 400
- IdempotencyTokenInUseException
-
The specified client token is already in use.
HTTP Status Code: 400
- IdempotentParameterMismatchException
-
Exception thrown when the same client token is used with different parameters, indicating a mismatch in idempotent request parameters.
HTTP Status Code: 400
- InternalServerException
-
An internal error occurred while processing the request.
HTTP Status Code: 500
- InvalidParameterValueException
-
One or more parameter values are not valid.
HTTP Status Code: 400
- OptInRequiredException
-
The account must be opted in to Compute Optimizer Automation before performing this action.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource was not found.
HTTP Status Code: 400
- ServiceUnavailableException
-
The service is temporarily unavailable.
HTTP Status Code: 500
- ThrottlingException
-
The request was denied due to request throttling.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: