Skip to content
v2.277.0

SourceProperty Struct ​

Provides the CustomPolicyDetails, 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 events that cause the evaluation of your AWS resources.

Example ​

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';
const sourceProperty: config.CfnConfigRule.SourceProperty = {
  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',
};
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

source_property = 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"
)
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.*;

SourceProperty sourceProperty = 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();
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 sourceProperty = 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"
};
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"

sourceProperty := &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"),
}

Properties ​

customPolicyDetailsoptionalIResolvable | CfnConfigRule.CustomPolicyDetailsPropertycustom_policy_detailsoptionaltyping.Union[IResolvable, CustomPolicyDetailsProperty]customPolicyDetailsoptionalIResolvableCustomPolicyDetailsoptionalIResolvableCustomPolicyDetailsoptionalinterface{}#
Provides the runtime system, policy definition, and whether debug logging is enabled.

Required when owner is set to CUSTOM_POLICY .

ownerstringownerstrownerStringOwnerstringOwner*stringrequired#
Indicates whether AWS or the customer owns and manages the AWS Config rule.
notes

AWS Config Managed Rules are predefined rules owned by AWS . For more information, see AWS Config Managed Rules in the AWS Config developer guide .

AWS Config Custom Rules are rules that you can develop either with Guard ( CUSTOM_POLICY ) or AWS Lambda ( CUSTOM_LAMBDA ). For more information, see AWS Config Custom Rules in the AWS Config developer guide .

sourceDetailsoptionalIResolvable | IResolvable | CfnConfigRule.SourceDetailProperty[]source_detailsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, SourceDetailProperty]]]sourceDetailsoptionalIResolvableSourceDetailsoptionalIResolvableSourceDetailsoptionalinterface{}#
Provides the source and the message types that cause AWS Config to evaluate your AWS resources against a rule.
notes

It also provides the frequency with which you want AWS Config to run evaluations for the rule if the trigger type is periodic.

If the owner is set to CUSTOM_POLICY , the only acceptable values for the AWS Config rule trigger message type are ConfigurationItemChangeNotification and OversizedConfigurationItemChangeNotification .

sourceIdentifieroptionalstringsource_identifieroptionalstrsourceIdentifieroptionalStringSourceIdentifieroptionalstringSourceIdentifieroptional*string#
For AWS Config Managed rules, a predefined identifier from a list.
notes

For example, IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see List of AWS Config Managed Rules .

For AWS Config Custom Lambda rules, the identifier is the Amazon Resource Name (ARN) of the rule's AWS Lambda function, such as arn:aws:lambda:us-east-2:123456789012:function:custom_rule_name .

For AWS Config Custom Policy rules, this field will be ignored.