Class CfnAutomationRule
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.computeoptimizer.CfnAutomationRule
- All Implemented Interfaces:
IInspectable,IAutomationRuleRef,IEnvironmentAware,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-03-19T12:55:01.612Z")
@Stability(Stable)
public class CfnAutomationRule
extends CfnResource
implements IInspectable, IAutomationRuleRef, ITaggableV2
Creates an AWS Compute Optimizer automation rule that automatically implements recommended actions based on your defined criteria and schedule.
Automation rules are global resources that manage automated actions across all AWS Regions where Compute Optimizer Automation is available. Organization-level rules can only be created by the management account or delegated administrator.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.computeoptimizer.*;
CfnAutomationRule cfnAutomationRule = CfnAutomationRule.Builder.create(this, "MyCfnAutomationRule")
.name("name")
.recommendedActionTypes(List.of("recommendedActionTypes"))
.ruleType("ruleType")
.schedule(ScheduleProperty.builder()
.executionWindowInMinutes(123)
.scheduleExpression("scheduleExpression")
.scheduleExpressionTimezone("scheduleExpressionTimezone")
.build())
.status("status")
// the properties below are optional
.criteria(CriteriaProperty.builder()
.ebsVolumeSizeInGib(List.of(IntegerCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of(123))
.build()))
.ebsVolumeType(List.of(StringCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of("values"))
.build()))
.estimatedMonthlySavings(List.of(DoubleCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of(123))
.build()))
.lookBackPeriodInDays(List.of(IntegerCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of(123))
.build()))
.region(List.of(StringCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of("values"))
.build()))
.resourceArn(List.of(StringCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of("values"))
.build()))
.resourceTag(List.of(ResourceTagsCriteriaConditionProperty.builder()
.comparison("comparison")
.key("key")
.values(List.of("values"))
.build()))
.restartNeeded(List.of(StringCriteriaConditionProperty.builder()
.comparison("comparison")
.values(List.of("values"))
.build()))
.build())
.description("description")
.organizationConfiguration(OrganizationConfigurationProperty.builder()
.accountIds(List.of("accountIds"))
.ruleApplyOrder("ruleApplyOrder")
.build())
.priority("priority")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnAutomationRule.static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.computeoptimizer.IAutomationRuleRef
IAutomationRuleRef.Jsii$Default, IAutomationRuleRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAutomationRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAutomationRule(software.amazon.jsii.JsiiObjectRef objRef) CfnAutomationRule(software.constructs.Construct scope, String id, CfnAutomationRuleProps props) Create a newAWS::ComputeOptimizer::AutomationRule. -
Method Summary
Modifier and TypeMethodDescriptionThe AWS account ID that owns the automation rule.The timestamp when the automation rule was created.The timestamp when the automation rule was last updated.The Amazon Resource Name (ARN) of the automation rule.The unique identifier of the automation rule.The revision number of the automation rule.A reference to a AutomationRule resource.Tag Manager which manages the tags for this resource.Returns union: eitherIResolvableorCfnAutomationRule.CriteriaPropertyThe description of the automation rule.getName()The name of the automation rule.Returns union: eitherIResolvableorCfnAutomationRule.OrganizationConfigurationPropertyRule priority within its group.The types of recommended actions this rule will implement.The type of automation rule.Returns union: eitherIResolvableorCfnAutomationRule.SchedulePropertyThe status of the automation rule.getTags()Tags associated with the automation rule.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnAutomationRule.renderProperties(Map<String, Object> props) voidsetCriteria(IResolvable value) voidvoidsetDescription(String value) The description of the automation rule.voidThe name of the automation rule.voidvoidvoidsetPriority(String value) Rule priority within its group.voidsetRecommendedActionTypes(List<String> value) The types of recommended actions this rule will implement.voidsetRuleType(String value) The type of automation rule.voidsetSchedule(IResolvable value) voidvoidThe status of the automation rule.voidTags associated with the automation rule.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId, withMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAutomationRule
protected CfnAutomationRule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAutomationRule
protected CfnAutomationRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAutomationRule
@Stability(Stable) public CfnAutomationRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAutomationRuleProps props) Create a newAWS::ComputeOptimizer::AutomationRule.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
isCfnAutomationRule
Checks whether the given object is a CfnAutomationRule.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrAccountId
The AWS account ID that owns the automation rule. -
getAttrCreatedTimestamp
The timestamp when the automation rule was created. -
getAttrLastUpdatedTimestamp
The timestamp when the automation rule was last updated. -
getAttrRuleArn
The Amazon Resource Name (ARN) of the automation rule. -
getAttrRuleId
The unique identifier of the automation rule. -
getAttrRuleRevision
The revision number of the automation rule. -
getAutomationRuleRef
A reference to a AutomationRule resource.- Specified by:
getAutomationRuleRefin interfaceIAutomationRuleRef
-
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getName
The name of the automation rule. -
setName
The name of the automation rule. -
getRecommendedActionTypes
The types of recommended actions this rule will implement. -
setRecommendedActionTypes
The types of recommended actions this rule will implement. -
getRuleType
The type of automation rule. -
setRuleType
The type of automation rule. -
getSchedule
Returns union: eitherIResolvableorCfnAutomationRule.ScheduleProperty -
setSchedule
-
setSchedule
-
getStatus
The status of the automation rule. -
setStatus
The status of the automation rule. -
getCriteria
Returns union: eitherIResolvableorCfnAutomationRule.CriteriaProperty -
setCriteria
-
setCriteria
-
getDescription
The description of the automation rule. -
setDescription
The description of the automation rule. -
getOrganizationConfiguration
Returns union: eitherIResolvableorCfnAutomationRule.OrganizationConfigurationProperty -
setOrganizationConfiguration
-
setOrganizationConfiguration
@Stability(Stable) public void setOrganizationConfiguration(@Nullable CfnAutomationRule.OrganizationConfigurationProperty value) -
getPriority
Rule priority within its group. -
setPriority
Rule priority within its group. -
getTags
Tags associated with the automation rule. -
setTags
Tags associated with the automation rule.
-