@Generated(value="software.amazon.awssdk:codegen") public final class ConfigRule extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ConfigRule.Builder,ConfigRule>
Config rules evaluate the configuration settings of your Amazon Web Services resources. A rule can run when Config detects a configuration change to an Amazon Web Services resource or at a periodic frequency that you choose (for example, every 24 hours). There are two types of rules: Config Managed Rules and Config Custom Rules.
Config Managed Rules are predefined, customizable rules created by Config. For a list of managed rules, see List of Config Managed Rules.
Config Custom Rules are rules that you create from scratch. There are two ways to create Config custom rules: with Lambda functions ( Lambda Developer Guide) and with Guard (Guard GitHub Repository), a policy-as-code language. Config custom rules created with Lambda are called Config Custom Lambda Rules and Config custom rules created with Guard are called Config Custom Policy Rules.
For more information about developing and using Config rules, see Evaluating Resource with Config Rules in the Config Developer Guide.
You can use the Amazon Web Services CLI and Amazon Web Services SDKs if you want to create a rule that triggers evaluations for your resources when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConfigRule.Builder |
| Modifier and Type | Method and Description |
|---|---|
static ConfigRule.Builder |
builder() |
String |
configRuleArn()
The Amazon Resource Name (ARN) of the Config rule.
|
String |
configRuleId()
The ID of the Config rule.
|
String |
configRuleName()
The name that you assign to the Config rule.
|
ConfigRuleState |
configRuleState()
Indicates whether the Config rule is active or is currently being deleted by Config.
|
String |
configRuleStateAsString()
Indicates whether the Config rule is active or is currently being deleted by Config.
|
String |
createdBy()
Service principal name of the service that created the rule.
|
String |
description()
The description that you provide for the Config rule.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
List<EvaluationModeConfiguration> |
evaluationModes()
The modes the Config rule can be evaluated in.
|
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
boolean |
hasEvaluationModes()
For responses, this returns true if the service returned a value for the EvaluationModes property.
|
int |
hashCode() |
String |
inputParameters()
A string, in JSON format, that is passed to the Config rule Lambda function.
|
MaximumExecutionFrequency |
maximumExecutionFrequency()
The maximum frequency with which Config runs evaluations for a rule.
|
String |
maximumExecutionFrequencyAsString()
The maximum frequency with which Config runs evaluations for a rule.
|
Scope |
scope()
Defines which resources can trigger an evaluation for the rule.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends ConfigRule.Builder> |
serializableBuilderClass() |
Source |
source()
Provides the rule owner (
Amazon Web Services for managed rules, CUSTOM_POLICY for
Custom Policy rules, and CUSTOM_LAMBDA for Custom Lambda rules), the rule identifier, and the
notifications that cause the function to evaluate your Amazon Web Services resources. |
ConfigRule.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic final String configRuleName()
The name that you assign to the Config rule. The name is required if you are adding a new rule.
public final String configRuleArn()
The Amazon Resource Name (ARN) of the Config rule.
public final String configRuleId()
The ID of the Config rule.
public final String description()
The description that you provide for the Config rule.
public final Scope scope()
Defines which resources can trigger an evaluation for the rule. The scope can include one or more resource types, a combination of one resource type and one resource ID, or a combination of a tag key and value. Specify a scope to constrain the resources that can trigger an evaluation for the rule. If you do not specify a scope, evaluations are triggered when any resource in the recording group changes.
The scope can be empty.
The scope can be empty.
public final Source source()
Provides the rule owner (Amazon Web Services for managed rules, CUSTOM_POLICY for
Custom Policy rules, and CUSTOM_LAMBDA for Custom Lambda rules), the rule identifier, and the
notifications that cause the function to evaluate your Amazon Web Services resources.
Amazon Web Services for managed rules, CUSTOM_POLICY
for Custom Policy rules, and CUSTOM_LAMBDA for Custom Lambda rules), the rule identifier,
and the notifications that cause the function to evaluate your Amazon Web Services resources.public final String inputParameters()
A string, in JSON format, that is passed to the Config rule Lambda function.
public final MaximumExecutionFrequency maximumExecutionFrequency()
The maximum frequency with which Config runs evaluations for a rule. You can specify a value for
MaximumExecutionFrequency when:
This is for an Config managed rule that is triggered at a periodic frequency.
Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid
value for the MaximumExecutionFrequency parameter.
If the service returns an enum value that is not available in the current SDK version,
maximumExecutionFrequency will return MaximumExecutionFrequency.UNKNOWN_TO_SDK_VERSION. The raw
value returned by the service is available from maximumExecutionFrequencyAsString().
MaximumExecutionFrequency when:
This is for an Config managed rule that is triggered at a periodic frequency.
Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify
a valid value for the MaximumExecutionFrequency parameter.
MaximumExecutionFrequencypublic final String maximumExecutionFrequencyAsString()
The maximum frequency with which Config runs evaluations for a rule. You can specify a value for
MaximumExecutionFrequency when:
This is for an Config managed rule that is triggered at a periodic frequency.
Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid
value for the MaximumExecutionFrequency parameter.
If the service returns an enum value that is not available in the current SDK version,
maximumExecutionFrequency will return MaximumExecutionFrequency.UNKNOWN_TO_SDK_VERSION. The raw
value returned by the service is available from maximumExecutionFrequencyAsString().
MaximumExecutionFrequency when:
This is for an Config managed rule that is triggered at a periodic frequency.
Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify
a valid value for the MaximumExecutionFrequency parameter.
MaximumExecutionFrequencypublic final ConfigRuleState configRuleState()
Indicates whether the Config rule is active or is currently being deleted by Config. It can also indicate the evaluation status for the Config rule.
Config sets the state of the rule to EVALUATING temporarily after you use the
StartConfigRulesEvaluation request to evaluate your resources against the Config rule.
Config sets the state of the rule to DELETING_RESULTS temporarily after you use the
DeleteEvaluationResults request to delete the current evaluation results for the Config rule.
Config temporarily sets the state of a rule to DELETING after you use the
DeleteConfigRule request to delete the rule. After Config deletes the rule, the rule and all of its
evaluations are erased and are no longer available.
If the service returns an enum value that is not available in the current SDK version, configRuleState
will return ConfigRuleState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available
from configRuleStateAsString().
Config sets the state of the rule to EVALUATING temporarily after you use the
StartConfigRulesEvaluation request to evaluate your resources against the Config rule.
Config sets the state of the rule to DELETING_RESULTS temporarily after you use the
DeleteEvaluationResults request to delete the current evaluation results for the Config
rule.
Config temporarily sets the state of a rule to DELETING after you use the
DeleteConfigRule request to delete the rule. After Config deletes the rule, the rule and all
of its evaluations are erased and are no longer available.
ConfigRuleStatepublic final String configRuleStateAsString()
Indicates whether the Config rule is active or is currently being deleted by Config. It can also indicate the evaluation status for the Config rule.
Config sets the state of the rule to EVALUATING temporarily after you use the
StartConfigRulesEvaluation request to evaluate your resources against the Config rule.
Config sets the state of the rule to DELETING_RESULTS temporarily after you use the
DeleteEvaluationResults request to delete the current evaluation results for the Config rule.
Config temporarily sets the state of a rule to DELETING after you use the
DeleteConfigRule request to delete the rule. After Config deletes the rule, the rule and all of its
evaluations are erased and are no longer available.
If the service returns an enum value that is not available in the current SDK version, configRuleState
will return ConfigRuleState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available
from configRuleStateAsString().
Config sets the state of the rule to EVALUATING temporarily after you use the
StartConfigRulesEvaluation request to evaluate your resources against the Config rule.
Config sets the state of the rule to DELETING_RESULTS temporarily after you use the
DeleteEvaluationResults request to delete the current evaluation results for the Config
rule.
Config temporarily sets the state of a rule to DELETING after you use the
DeleteConfigRule request to delete the rule. After Config deletes the rule, the rule and all
of its evaluations are erased and are no longer available.
ConfigRuleStatepublic final String createdBy()
Service principal name of the service that created the rule.
The field is populated only if the service-linked rule is created by a service. The field is empty if you create your own rule.
The field is populated only if the service-linked rule is created by a service. The field is empty if you create your own rule.
public final boolean hasEvaluationModes()
isEmpty() method on the property).
This is useful because the SDK will never return a null collection or map, but you may need to differentiate
between the service returning nothing (or null) and the service returning an empty collection or map. For
requests, this returns true if a value for the property was specified in the request builder, and false if a
value was not specified.public final List<EvaluationModeConfiguration> evaluationModes()
The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is Detective evaluation mode only.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasEvaluationModes() method.
public ConfigRule.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<ConfigRule.Builder,ConfigRule>public static ConfigRule.Builder builder()
public static Class<? extends ConfigRule.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields in interface SdkPojopublic final String toString()
Copyright © 2023. All rights reserved.