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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigRule.Builderbuilder()final StringThe Amazon Resource Name (ARN) of the Config rule.final StringThe ID of the Config rule.final StringThe name that you assign to the Config rule.final ConfigRuleStateIndicates whether the Config rule is active or is currently being deleted by Config.final StringIndicates whether the Config rule is active or is currently being deleted by Config.final StringService principal name of the service that created the rule.final StringThe description that you provide for the Config rule.final booleanfinal booleanequalsBySdkFields(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 booleanFor responses, this returns true if the service returned a value for the EvaluationModes property.final inthashCode()final StringA 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 StringThe maximum frequency with which Config runs evaluations for a rule.final Scopescope()Defines which resources can trigger an evaluation for the rule.static Class<? extends ConfigRule.Builder> final Sourcesource()Provides the rule owner (Amazon Web Servicesfor managed rules,CUSTOM_POLICYfor Custom Policy rules, andCUSTOM_LAMBDAfor 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 StringtoString()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
-
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.
- 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.
-
source
Provides the rule owner (
Amazon Web Servicesfor managed rules,CUSTOM_POLICYfor Custom Policy rules, andCUSTOM_LAMBDAfor 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 Servicesfor managed rules,CUSTOM_POLICYfor Custom Policy rules, andCUSTOM_LAMBDAfor 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
MaximumExecutionFrequencywhen:-
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
MaximumExecutionFrequencyparameter.If the service returns an enum value that is not available in the current SDK version,
maximumExecutionFrequencywill 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
MaximumExecutionFrequencywhen:-
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
MaximumExecutionFrequencyparameter. -
- See Also:
-
-
maximumExecutionFrequencyAsString
The maximum frequency with which Config runs evaluations for a rule. You can specify a value for
MaximumExecutionFrequencywhen:-
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
MaximumExecutionFrequencyparameter.If the service returns an enum value that is not available in the current SDK version,
maximumExecutionFrequencywill 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
MaximumExecutionFrequencywhen:-
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
MaximumExecutionFrequencyparameter. -
- 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
EVALUATINGtemporarily after you use theStartConfigRulesEvaluationrequest to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTStemporarily after you use theDeleteEvaluationResultsrequest to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETINGafter you use theDeleteConfigRulerequest 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,
configRuleStatewill 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
EVALUATINGtemporarily after you use theStartConfigRulesEvaluationrequest to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTStemporarily after you use theDeleteEvaluationResultsrequest to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETINGafter you use theDeleteConfigRulerequest 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
EVALUATINGtemporarily after you use theStartConfigRulesEvaluationrequest to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTStemporarily after you use theDeleteEvaluationResultsrequest to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETINGafter you use theDeleteConfigRulerequest 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,
configRuleStatewill 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
EVALUATINGtemporarily after you use theStartConfigRulesEvaluationrequest to evaluate your resources against the Config rule.Config sets the state of the rule to
DELETING_RESULTStemporarily after you use theDeleteEvaluationResultsrequest to delete the current evaluation results for the Config rule.Config temporarily sets the state of a rule to
DELETINGafter you use theDeleteConfigRulerequest 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:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<ConfigRule.Builder,ConfigRule> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin 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
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-