class CfnConfigRulePropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.Config.Mixins.CfnConfigRulePropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsconfig/mixins#CfnConfigRulePropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.config.mixins.CfnConfigRulePropsMixin |
Python | aws_cdk.mixins_preview.aws_config.mixins.CfnConfigRulePropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_config » mixins » CfnConfigRulePropsMixin |
Implements
IMixin
Extends
Mixin
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 .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-configrule.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as config_mixins } from '@aws-cdk/mixins-preview/aws-config';
declare const inputParameters: any;
const cfnConfigRulePropsMixin = new config_mixins.CfnConfigRulePropsMixin({
compliance: {
type: 'type',
},
configRuleName: 'configRuleName',
description: 'description',
evaluationModes: [{
mode: 'mode',
}],
inputParameters: inputParameters,
maximumExecutionFrequency: 'maximumExecutionFrequency',
scope: {
complianceResourceId: 'complianceResourceId',
complianceResourceTypes: ['complianceResourceTypes'],
tagKey: 'tagKey',
tagValue: 'tagValue',
},
source: {
customPolicyDetails: {
enableDebugLogDelivery: false,
policyRuntime: 'policyRuntime',
policyText: 'policyText',
},
owner: 'owner',
sourceDetails: [{
eventSource: 'eventSource',
maximumExecutionFrequency: 'maximumExecutionFrequency',
messageType: 'messageType',
}],
sourceIdentifier: 'sourceIdentifier',
},
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnConfigRulePropsMixin(props: CfnConfigRuleMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Config Rule Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::Config::ConfigRule.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript