

# ConfigRule
<a name="API_ConfigRule"></a>

 Amazon Config rules evaluate the configuration settings of your Amazon resources. A rule can run when Amazon Config detects a configuration change to an Amazon resource or at a periodic frequency that you choose (for example, every 24 hours). There are two types of rules: * Amazon Config Managed Rules* and * Amazon Config Custom Rules*.

 Amazon Config Managed Rules are predefined, customizable rules created by Amazon Config. For a list of managed rules, see [List of Amazon Config Managed Rules](https://docs.amazonaws.cn/config/latest/developerguide/managed-rules-by-aws-config.html).

 Amazon Config Custom Rules are rules that you create from scratch. There are two ways to create Amazon Config custom rules: with Lambda functions ([Amazon Lambda Developer Guide](https://docs.amazonaws.cn/config/latest/developerguide/gettingstarted-concepts.html#gettingstarted-concepts-function)) and with Guard ([Guard GitHub Repository](https://github.com/aws-cloudformation/cloudformation-guard)), a policy-as-code language. Amazon Config custom rules created with Amazon Lambda are called * Amazon Config Custom Lambda Rules* and Amazon Config custom rules created with Guard are called * Amazon Config Custom Policy Rules*.

For more information about developing and using Amazon Config rules, see [Evaluating Resource with Amazon Config Rules](https://docs.amazonaws.cn/config/latest/developerguide/evaluate-config.html) in the * Amazon Config Developer Guide*.

**Note**  
You can use the Amazon CLI and Amazon SDKs if you want to create a rule that triggers evaluations for your resources when Amazon Config delivers the configuration snapshot. For more information, see [ConfigSnapshotDeliveryProperties](API_ConfigSnapshotDeliveryProperties.md).

## Contents
<a name="API_ConfigRule_Contents"></a>

 ** Source **   <a name="config-Type-ConfigRule-Source"></a>
Provides the rule owner (` Amazon ` 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 resources.  
Type: [Source](API_Source.md) object  
Required: Yes

 ** ConfigRuleArn **   <a name="config-Type-ConfigRule-ConfigRuleArn"></a>
The Amazon Resource Name (ARN) of the Amazon Config rule.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

 ** ConfigRuleId **   <a name="config-Type-ConfigRule-ConfigRuleId"></a>
The ID of the Amazon Config rule.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Required: No

 ** ConfigRuleName **   <a name="config-Type-ConfigRule-ConfigRuleName"></a>
The name that you assign to the Amazon Config rule. The name is required if you are adding a new rule.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `.*\S.*`   
Required: No

 ** ConfigRuleState **   <a name="config-Type-ConfigRule-ConfigRuleState"></a>
Indicates whether the Amazon Config rule is active or is currently being deleted by Amazon Config. It can also indicate the evaluation status for the Amazon Config rule.  
 Amazon Config sets the state of the rule to `EVALUATING` temporarily after you use the `StartConfigRulesEvaluation` request to evaluate your resources against the Amazon Config rule.  
 Amazon 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 Amazon Config rule.  
 Amazon Config temporarily sets the state of a rule to `DELETING` after you use the `DeleteConfigRule` request to delete the rule. After Amazon Config deletes the rule, the rule and all of its evaluations are erased and are no longer available.  
Type: String  
Valid Values: `ACTIVE | DELETING | DELETING_RESULTS | EVALUATING`   
Required: No

 ** CreatedBy **   <a name="config-Type-ConfigRule-CreatedBy"></a>
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.
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

 ** Description **   <a name="config-Type-ConfigRule-Description"></a>
The description that you provide for the Amazon Config rule.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 256.  
Required: No

 ** EvaluationModes **   <a name="config-Type-ConfigRule-EvaluationModes"></a>
The modes the Amazon Config rule can be evaluated in. The valid values are distinct objects. By default, the value is Detective evaluation mode only.  
Type: Array of [EvaluationModeConfiguration](API_EvaluationModeConfiguration.md) objects  
Required: No

 ** InputParameters **   <a name="config-Type-ConfigRule-InputParameters"></a>
A string, in JSON format, that is passed to the Amazon Config rule Lambda function.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1024.  
Required: No

 ** MaximumExecutionFrequency **   <a name="config-Type-ConfigRule-MaximumExecutionFrequency"></a>
The maximum frequency with which Amazon Config runs evaluations for a rule. You can specify a value for `MaximumExecutionFrequency` when:  
+ This is for an Amazon Config managed rule that is triggered at a periodic frequency.
+ Your custom rule is triggered when Amazon Config delivers the configuration snapshot. For more information, see [ConfigSnapshotDeliveryProperties](API_ConfigSnapshotDeliveryProperties.md).
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the `MaximumExecutionFrequency` parameter.
Type: String  
Valid Values: `One_Hour | Three_Hours | Six_Hours | Twelve_Hours | TwentyFour_Hours`   
Required: No

 ** Scope **   <a name="config-Type-ConfigRule-Scope"></a>
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.  
Type: [Scope](API_Scope.md) object  
Required: No

## See Also
<a name="API_ConfigRule_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/config-2014-11-12/ConfigRule) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/config-2014-11-12/ConfigRule) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/config-2014-11-12/ConfigRule) 