# CfnConfigRuleProps

Properties for defining a `CfnConfigRule`.

Used as props by: [CfnConfigRule](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.CfnConfigRule.html)

- Source: Generated at build time
- Type last changed: v2.91.0 · 10 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_config as config } from 'aws-cdk-lib';

declare const inputParameters: any;
const cfnConfigRuleProps: config.CfnConfigRuleProps = {
  source: {
    owner: 'owner',

    // the properties below are optional
    customPolicyDetails: {
      enableDebugLogDelivery: false,
      policyRuntime: 'policyRuntime',
      policyText: 'policyText',
    },
    sourceDetails: [{
      eventSource: 'eventSource',
      messageType: 'messageType',

      // the properties below are optional
      maximumExecutionFrequency: 'maximumExecutionFrequency',
    }],
    sourceIdentifier: 'sourceIdentifier',
  },

  // the properties below are optional
  compliance: {
    type: 'type',
  },
  configRuleName: 'configRuleName',
  description: 'description',
  evaluationModes: [{
    mode: 'mode',
  }],
  inputParameters: inputParameters,
  maximumExecutionFrequency: 'maximumExecutionFrequency',
  scope: {
    complianceResourceId: 'complianceResourceId',
    complianceResourceTypes: ['complianceResourceTypes'],
    tagKey: 'tagKey',
    tagValue: 'tagValue',
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_config as config

# input_parameters: Any

cfn_config_rule_props = config.CfnConfigRuleProps(
    source=config.CfnConfigRule.SourceProperty(
        owner="owner",

        # the properties below are optional
        custom_policy_details=config.CfnConfigRule.CustomPolicyDetailsProperty(
            enable_debug_log_delivery=False,
            policy_runtime="policyRuntime",
            policy_text="policyText"
        ),
        source_details=[config.CfnConfigRule.SourceDetailProperty(
            event_source="eventSource",
            message_type="messageType",

            # the properties below are optional
            maximum_execution_frequency="maximumExecutionFrequency"
        )],
        source_identifier="sourceIdentifier"
    ),

    # the properties below are optional
    compliance=config.CfnConfigRule.ComplianceProperty(
        type="type"
    ),
    config_rule_name="configRuleName",
    description="description",
    evaluation_modes=[config.CfnConfigRule.EvaluationModeConfigurationProperty(
        mode="mode"
    )],
    input_parameters=input_parameters,
    maximum_execution_frequency="maximumExecutionFrequency",
    scope=config.CfnConfigRule.ScopeProperty(
        compliance_resource_id="complianceResourceId",
        compliance_resource_types=["complianceResourceTypes"],
        tag_key="tagKey",
        tag_value="tagValue"
    )
)
```

Java:

```java
// 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;

CfnConfigRuleProps cfnConfigRuleProps = CfnConfigRuleProps.builder()
        .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
        .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())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Config;

var inputParameters;

var cfnConfigRuleProps = new CfnConfigRuleProps {
    Source = new SourceProperty {
        Owner = "owner",

        // the properties below are optional
        CustomPolicyDetails = new CustomPolicyDetailsProperty {
            EnableDebugLogDelivery = false,
            PolicyRuntime = "policyRuntime",
            PolicyText = "policyText"
        },
        SourceDetails = new [] { new SourceDetailProperty {
            EventSource = "eventSource",
            MessageType = "messageType",

            // the properties below are optional
            MaximumExecutionFrequency = "maximumExecutionFrequency"
        } },
        SourceIdentifier = "sourceIdentifier"
    },

    // the properties below are optional
    Compliance = new ComplianceProperty {
        Type = "type"
    },
    ConfigRuleName = "configRuleName",
    Description = "description",
    EvaluationModes = new [] { new EvaluationModeConfigurationProperty {
        Mode = "mode"
    } },
    InputParameters = inputParameters,
    MaximumExecutionFrequency = "maximumExecutionFrequency",
    Scope = new ScopeProperty {
        ComplianceResourceId = "complianceResourceId",
        ComplianceResourceTypes = new [] { "complianceResourceTypes" },
        TagKey = "tagKey",
        TagValue = "tagValue"
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var inputParameters interface{}

cfnConfigRuleProps := &CfnConfigRuleProps{
	Source: &SourceProperty{
		Owner: jsii.String("owner"),

		// the properties below are optional
		CustomPolicyDetails: &CustomPolicyDetailsProperty{
			EnableDebugLogDelivery: jsii.Boolean(false),
			PolicyRuntime: jsii.String("policyRuntime"),
			PolicyText: jsii.String("policyText"),
		},
		SourceDetails: []interface{}{
			&SourceDetailProperty{
				EventSource: jsii.String("eventSource"),
				MessageType: jsii.String("messageType"),

				// the properties below are optional
				MaximumExecutionFrequency: jsii.String("maximumExecutionFrequency"),
			},
		},
		SourceIdentifier: jsii.String("sourceIdentifier"),
	},

	// the properties below are optional
	Compliance: &ComplianceProperty{
		Type: jsii.String("type"),
	},
	ConfigRuleName: jsii.String("configRuleName"),
	Description: jsii.String("description"),
	EvaluationModes: []interface{}{
		&EvaluationModeConfigurationProperty{
			Mode: jsii.String("mode"),
		},
	},
	InputParameters: inputParameters,
	MaximumExecutionFrequency: jsii.String("maximumExecutionFrequency"),
	Scope: &ScopeProperty{
		ComplianceResourceId: jsii.String("complianceResourceId"),
		ComplianceResourceTypes: []*string{
			jsii.String("complianceResourceTypes"),
		},
		TagKey: jsii.String("tagKey"),
		TagValue: jsii.String("tagValue"),
	},
}
```

## Properties

- `compliance`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnConfigRule.ComplianceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.CfnConfigRule.ComplianceProperty.html) — Indicates whether an AWS resource or AWS Config rule is compliant and provides the number of contributors that affect the compliance.

- `configRuleName`: string — A name for the AWS Config rule.

  If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .

- `description`: string — The description that you provide for the AWS Config rule.

- `evaluationModes`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnConfigRule.EvaluationModeConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.CfnConfigRule.EvaluationModeConfigurationProperty.html)[] — The modes the AWS Config rule can be evaluated in.

  The valid values are distinct objects. By default, the value is Detective evaluation mode only.

- `inputParameters`: any — A string, in JSON format, that is passed to the AWS Config rule Lambda function.

- `maximumExecutionFrequency`: string — The maximum frequency with which AWS Config runs evaluations for a rule.

  You can specify a value for `MaximumExecutionFrequency` when:

  - You are using an AWS managed rule that is triggered at a periodic frequency.
  - Your custom rule is triggered when AWS Config delivers the configuration snapshot. For more information, see [ConfigSnapshotDeliveryProperties](https://docs.aws.amazon.com/config/latest/APIReference/API_ConfigSnapshotDeliveryProperties.html) .

  > By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the `MaximumExecutionFrequency` parameter.

- `scope`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnConfigRule.ScopeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.CfnConfigRule.ScopeProperty.html) — 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.

- `source`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnConfigRule.SourceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_config.CfnConfigRule.SourceProperty.html) (required) — Provides the rule owner ( `AWS` 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 AWS resources.
