Class ConfigRule
- All Implemented Interfaces:
Serializable
,SdkPojo
,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.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigRule.Builder
builder()
final String
The Amazon Resource Name (ARN) of the Config rule.final String
The ID of the Config rule.final String
The name that you assign to the Config rule.final ConfigRuleState
Indicates whether the Config rule is active or is currently being deleted by Config.final String
Indicates whether the Config rule is active or is currently being deleted by Config.final String
Service principal name of the service that created the rule.final String
The description that you provide for the Config rule.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final List
<EvaluationModeConfiguration> The modes the Config rule can be evaluated in.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the EvaluationModes property.final int
hashCode()
final String
A string, in JSON format, that is passed to the Config rule Lambda function.The maximum frequency with which Config runs evaluations for a rule.final String
The maximum frequency with which Config runs evaluations for a rule.final Scope
scope()
Defines which resources can trigger an evaluation for the rule.static Class
<? extends ConfigRule.Builder> final Source
source()
Provides the rule owner (Amazon Web Services
for managed rules,CUSTOM_POLICY
for Custom Policy rules, andCUSTOM_LAMBDA
for Custom Lambda rules), the rule identifier, and the notifications that cause the function to evaluate your Amazon Web Services resources.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
configRuleName
The name that you assign to the Config rule. The name is required if you are adding a new rule.
- Returns:
- The name that you assign to the Config rule. The name is required if you are adding a new rule.
-
configRuleArn
The Amazon Resource Name (ARN) of the Config rule.
- Returns:
- The Amazon Resource Name (ARN) of the Config rule.
-
configRuleId
The ID of the Config rule.
- Returns:
- The ID of the Config rule.
-
description
The description that you provide for the Config rule.
- Returns:
- The description that you provide for the Config rule.
-
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.
- Returns:
- 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.
-
source
Provides the rule owner (
Amazon Web Services
for managed rules,CUSTOM_POLICY
for Custom Policy rules, andCUSTOM_LAMBDA
for Custom Lambda rules), the rule identifier, and the notifications that cause the function to evaluate your Amazon Web Services resources.- Returns:
- Provides the rule owner (
Amazon Web Services
for managed rules,CUSTOM_POLICY
for Custom Policy rules, andCUSTOM_LAMBDA
for Custom Lambda rules), the rule identifier, and the notifications that cause the function to evaluate your Amazon Web Services resources.
-
inputParameters
A string, in JSON format, that is passed to the Config rule Lambda function.
- Returns:
- A string, in JSON format, that is passed to the Config rule Lambda function.
-
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 returnMaximumExecutionFrequency.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frommaximumExecutionFrequencyAsString()
.- Returns:
- 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. -
- See Also:
-
-
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 returnMaximumExecutionFrequency.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frommaximumExecutionFrequencyAsString()
.- Returns:
- 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. -
- See Also:
-
-
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 theStartConfigRulesEvaluation
request to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTS
temporarily after you use theDeleteEvaluationResults
request to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETING
after you use theDeleteConfigRule
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 returnConfigRuleState.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromconfigRuleStateAsString()
.- Returns:
- 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 theStartConfigRulesEvaluation
request to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTS
temporarily after you use theDeleteEvaluationResults
request to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETING
after you use theDeleteConfigRule
request to delete the rule. After Config deletes the rule, the rule and all of its evaluations are erased and are no longer available. - See Also:
-
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 theStartConfigRulesEvaluation
request to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTS
temporarily after you use theDeleteEvaluationResults
request to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETING
after you use theDeleteConfigRule
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 returnConfigRuleState.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromconfigRuleStateAsString()
.- Returns:
- 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 theStartConfigRulesEvaluation
request to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTS
temporarily after you use theDeleteEvaluationResults
request to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETING
after you use theDeleteConfigRule
request to delete the rule. After Config deletes the rule, the rule and all of its evaluations are erased and are no longer available. - See Also:
-
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.
- Returns:
- 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.
-
hasEvaluationModes
public final boolean hasEvaluationModes()For responses, this returns true if the service returned a value for the EvaluationModes property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
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. -
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.- Returns:
- The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is Detective evaluation mode only.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<ConfigRule.Builder,
ConfigRule> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
sdkFields
-