@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. Managed rules are predefined, customizable rules created by Config. For a list of managed rules, see List of Config Managed Rules.
Custom rules are rules that you can create using either Guard or Lambda functions. Guard (Guard GitHub Repository) is a policy-as-code language that allows you to write policies that are enforced by Config Custom Policy rules. Lambda uses custom code that you upload to evaluate a custom rule. It is invoked by events that are published to it by an event source, which Config invokes when the custom rule is initiated.
For more information about developing and using Config rules, see Evaluating Amazon Web Services resource Configurations with Config 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) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
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 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 © 2022. All rights reserved.