Class CfnConfigRulePropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
You must first create and start the AWS Config configuration recorder in order to create AWS Config managed rules with AWS CloudFormation .
For more information, see Managing the Configuration Recorder .
Adds or updates an AWS Config rule to evaluate if your AWS resources comply with your desired configurations. For information on how many AWS Config rules you can have per account, see Service Limits in the AWS Config Developer Guide .
There are two types of rules: AWS Config Managed Rules and AWS Config Custom Rules . You can use the ConfigRule resource to create both AWS Config Managed Rules and AWS Config Custom Rules.
AWS Config Managed Rules are predefined, customizable rules created by AWS Config . For a list of managed rules, see List of AWS Config Managed Rules . If you are adding an AWS Config managed rule, you must specify the rule's identifier for the SourceIdentifier key.
AWS Config Custom Rules are rules that you create from scratch. There are two ways to create AWS Config custom rules: with Lambda functions ( AWS Lambda Developer Guide ) and with Guard ( Guard GitHub Repository ), a policy-as-code language. AWS Config custom rules created with AWS Lambda are called AWS Config Custom Lambda Rules and AWS Config custom rules created with Guard are called AWS Config Custom Policy Rules .
If you are adding a new AWS Config Custom Lambda rule, you first need to create an AWS Lambda function that the rule invokes to evaluate your resources. When you use the ConfigRule resource to add a Custom Lambda rule to AWS Config , you must specify the Amazon Resource Name (ARN) that AWS Lambda assigns to the function. You specify the ARN in the SourceIdentifier key. This key is part of the Source object, which is part of the ConfigRule object.
For any new AWS Config 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.
For more information about developing and using AWS Config rules, see Evaluating Resources with AWS Config Rules 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.cfnpropertymixins.services.config.*;
import software.amazon.awscdk.*;
Object inputParameters;
IMergeStrategy mergeStrategy;
CfnConfigRulePropsMixin cfnConfigRulePropsMixin = CfnConfigRulePropsMixin.Builder.create(CfnConfigRuleMixinProps.builder()
.compliance(ComplianceProperty.builder()
.type("type")
.build())
.configRuleName("configRuleName")
.description("description")
.evaluationModes(List.of(EvaluationModeConfigurationProperty.builder()
.mode("mode")
.build()))
.inputParameters(inputParameters)
.maximumExecutionFrequency("maximumExecutionFrequency")
.scope(ScopeProperty.builder()
.complianceResourceId("complianceResourceId")
.complianceResourceTypes(List.of("complianceResourceTypes"))
.tagKey("tagKey")
.tagValue("tagValue")
.build())
.source(SourceProperty.builder()
.customPolicyDetails(CustomPolicyDetailsProperty.builder()
.enableDebugLogDelivery(false)
.policyRuntime("policyRuntime")
.policyText("policyText")
.build())
.owner("owner")
.sourceDetails(List.of(SourceDetailProperty.builder()
.eventSource("eventSource")
.maximumExecutionFrequency("maximumExecutionFrequency")
.messageType("messageType")
.build()))
.sourceIdentifier("sourceIdentifier")
.build())
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnConfigRulePropsMixin.static interfaceIndicates whether an AWS resource or AWS Config rule is compliant and provides the number of contributors that affect the compliance.static interfaceProvides the CustomPolicyDetails, the rule owner (AWSfor managed rules,CUSTOM_POLICYfor Custom Policy rules, andCUSTOM_LAMBDAfor Custom Lambda rules), the rule identifier, and the events that cause the evaluation of your AWS resources.static interfaceThe configuration object for AWS Config rule evaluation mode.static interfaceDefines which resources trigger an evaluation for an AWS Config rule.static interfaceProvides the source and the message types that trigger AWS Config to evaluate your AWS resources against a rule.static interfaceProvides the CustomPolicyDetails, the rule owner (AWSfor managed rules,CUSTOM_POLICYfor Custom Policy rules, andCUSTOM_LAMBDAfor Custom Lambda rules), the rule identifier, and the events that cause the evaluation of your AWS resources.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::Config::ConfigRule.CfnConfigRulePropsMixin(CfnConfigRuleMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Config::ConfigRule.protectedCfnConfigRulePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnConfigRulePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnConfigRuleMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnConfigRulePropsMixin
protected CfnConfigRulePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnConfigRulePropsMixin
protected CfnConfigRulePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnConfigRulePropsMixin
@Stability(Stable) public CfnConfigRulePropsMixin(@NotNull CfnConfigRuleMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Config::ConfigRule.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnConfigRulePropsMixin
Create a mixin to apply properties toAWS::Config::ConfigRule.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-