@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.717Z") @Stability(value=Stable) public class CfnConfigRule extends CfnResource implements IInspectable
Specifies an AWS Config rule for evaluating whether your AWS resources comply with your desired configurations.
You can use this action for custom AWS Config rules and AWS managed Config rules. A custom AWS Config rule is a rule that you develop and maintain. An AWS managed Config rule is a customizable, predefined rule that AWS Config provides.
If you are adding a new custom AWS Config rule, you must first create the AWS Lambda function that the rule invokes to evaluate your resources. When you use the PutConfigRule action to add the rule to AWS Config , you must specify the Amazon Resource Name (ARN) that AWS Lambda assigns to the function. Specify the ARN for the SourceIdentifier key. This key is part of the Source object, which is part of the ConfigRule object.
If you are adding an AWS managed Config rule, specify the rule's identifier for the SourceIdentifier key. To reference AWS managed Config rule identifiers, see About AWS Managed Config Rules .
For any new rule that you add, specify the ConfigRuleName in the ConfigRule object. Do not specify the ConfigRuleArn or the ConfigRuleId . These values are generated by AWS Config for new rules.
If you are updating a rule that you added previously, you can specify the rule by ConfigRuleName , ConfigRuleId , or ConfigRuleArn in the ConfigRule data type that you use in this request.
The maximum number of rules that AWS Config supports is 400.
For information about requesting a rule limit increase, see AWS Config endpoints and quotas in the AWS General Reference Guide .
For more information about developing and using AWS Config rules, see Evaluating AWS Resource Configurations with AWS Config in the AWS Config Developer Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.config.*;
Object inputParameters;
CfnConfigRule cfnConfigRule = CfnConfigRule.Builder.create(this, "MyCfnConfigRule")
.source(SourceProperty.builder()
.owner("owner")
// the properties below are optional
.customPolicyDetails(CustomPolicyDetailsProperty.builder()
.enableDebugLogDelivery(false)
.policyRuntime("policyRuntime")
.policyText("policyText")
.build())
.sourceDetails(List.of(SourceDetailProperty.builder()
.eventSource("eventSource")
.messageType("messageType")
// the properties below are optional
.maximumExecutionFrequency("maximumExecutionFrequency")
.build()))
.sourceIdentifier("sourceIdentifier")
.build())
// the properties below are optional
.configRuleName("configRuleName")
.description("description")
.inputParameters(inputParameters)
.maximumExecutionFrequency("maximumExecutionFrequency")
.scope(ScopeProperty.builder()
.complianceResourceId("complianceResourceId")
.complianceResourceTypes(List.of("complianceResourceTypes"))
.tagKey("tagKey")
.tagValue("tagValue")
.build())
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnConfigRule.Builder
A fluent builder for
CfnConfigRule. |
static interface |
CfnConfigRule.CustomPolicyDetailsProperty
Example:
|
static interface |
CfnConfigRule.ScopeProperty
Defines which resources trigger an evaluation for an AWS Config rule.
|
static interface |
CfnConfigRule.SourceDetailProperty
Provides the source and the message types that trigger AWS Config to evaluate your AWS resources against a rule.
|
static interface |
CfnConfigRule.SourceProperty
Provides the CustomPolicyDetails, the rule owner ( AWS or customer), the rule identifier, and the events that cause the evaluation of your AWS resources.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnConfigRule(software.constructs.Construct scope,
String id,
CfnConfigRuleProps props)
Create a new `AWS::Config::ConfigRule`.
|
protected |
CfnConfigRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnConfigRule(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
The Amazon Resource Name (ARN) of the AWS Config rule, such as `arn:aws:config:us-east-1:123456789012:config-rule/config-rule-a1bzhi` .
|
String |
getAttrComplianceType()
The compliance status of an AWS Config rule, such as `COMPLIANT` or `NON_COMPLIANT` .
|
String |
getAttrConfigRuleId()
The ID of the AWS Config rule, such as `config-rule-a1bzhi` .
|
protected Map<String,Object> |
getCfnProperties() |
String |
getConfigRuleName()
A name for the AWS Config rule.
|
String |
getDescription()
The description that you provide for the AWS Config rule.
|
Object |
getInputParameters()
A string, in JSON format, that is passed to the AWS Config rule Lambda function.
|
String |
getMaximumExecutionFrequency()
The maximum frequency with which AWS Config runs evaluations for a rule.
|
Object |
getScope()
Defines which resources can trigger an evaluation for the rule.
|
Object |
getSource()
Provides the rule owner ( AWS or customer), the rule identifier, and the notifications that cause the function to evaluate your AWS resources.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setConfigRuleName(String value)
A name for the AWS Config rule.
|
void |
setDescription(String value)
The description that you provide for the AWS Config rule.
|
void |
setInputParameters(Object value)
A string, in JSON format, that is passed to the AWS Config rule Lambda function.
|
void |
setMaximumExecutionFrequency(String value)
The maximum frequency with which AWS Config runs evaluations for a rule.
|
void |
setScope(CfnConfigRule.ScopeProperty value)
Defines which resources can trigger an evaluation for the rule.
|
void |
setScope(IResolvable value)
Defines which resources can trigger an evaluation for the rule.
|
void |
setSource(CfnConfigRule.SourceProperty value)
Provides the rule owner ( AWS or customer), the rule identifier, and the notifications that cause the function to evaluate your AWS resources.
|
void |
setSource(IResolvable value)
Provides the rule owner ( AWS or customer), the rule identifier, and the notifications that cause the function to evaluate your AWS resources.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnConfigRule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnConfigRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnConfigRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnConfigRuleProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull public String getAttrComplianceType()
@Stability(value=Stable) @NotNull public String getAttrConfigRuleId()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Object getInputParameters()
@Stability(value=Stable)
public void setInputParameters(@NotNull
Object value)
@Stability(value=Stable) @NotNull public Object getSource()
@Stability(value=Stable)
public void setSource(@NotNull
CfnConfigRule.SourceProperty value)
@Stability(value=Stable)
public void setSource(@NotNull
IResolvable value)
@Stability(value=Stable) @Nullable public String getConfigRuleName()
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type .
@Stability(value=Stable)
public void setConfigRuleName(@Nullable
String value)
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type .
@Stability(value=Stable) @Nullable public String getDescription()
@Stability(value=Stable)
public void setDescription(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getMaximumExecutionFrequency()
You can specify a value for MaximumExecutionFrequency when:
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the
MaximumExecutionFrequencyparameter.
@Stability(value=Stable)
public void setMaximumExecutionFrequency(@Nullable
String value)
You can specify a value for MaximumExecutionFrequency when:
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the
MaximumExecutionFrequencyparameter.
@Stability(value=Stable) @Nullable public Object getScope()
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.
@Stability(value=Stable)
public void setScope(@Nullable
CfnConfigRule.ScopeProperty value)
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.
@Stability(value=Stable)
public void setScope(@Nullable
IResolvable value)
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.
Copyright © 2022. All rights reserved.