Class CfnConfigRulePropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.config.CfnConfigRulePropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:19:57.477Z") @Stability(Stable) public class CfnConfigRulePropsMixin extends Mixin implements 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:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> 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 to AWS::Config::ConfigRule.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnConfigRulePropsMixin

      @Stability(Stable) public CfnConfigRulePropsMixin(@NotNull CfnConfigRuleMixinProps props)
      Create a mixin to apply properties to AWS::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.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnConfigRuleMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()