Skip to content
v2.274.0

CfnEventSourceMapping L1 construct ​

The AWS::Lambda::EventSourceMapping resource creates a mapping between an event source and an AWS Lambda function.

Lambda reads items from the event source and triggers the function.

For details about each event source type, see the following topics. In particular, each of the topics describes the required and optional parameters for the specific event source.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const cfnEventSourceMapping = new lambda.CfnEventSourceMapping(this, 'MyCfnEventSourceMapping', {
  functionName: 'functionName',

  // the properties below are optional
  amazonManagedKafkaEventSourceConfig: {
    consumerGroupId: 'consumerGroupId',
    schemaRegistryConfig: {
      accessConfigs: [{
        type: 'type',
        uri: 'uri',
      }],
      eventRecordFormat: 'eventRecordFormat',
      schemaRegistryUri: 'schemaRegistryUri',
      schemaValidationConfigs: [{
        attribute: 'attribute',
      }],
    },
  },
  batchSize: 123,
  bisectBatchOnFunctionError: false,
  destinationConfig: {
    onFailure: {
      destination: 'destination',
    },
  },
  documentDbEventSourceConfig: {
    collectionName: 'collectionName',
    databaseName: 'databaseName',
    fullDocument: 'fullDocument',
  },
  enabled: false,
  eventSourceArn: 'eventSourceArn',
  filterCriteria: {
    filters: [{
      pattern: 'pattern',
    }],
  },
  functionResponseTypes: ['functionResponseTypes'],
  kmsKeyArn: 'kmsKeyArn',
  loggingConfig: {
    systemLogLevel: 'systemLogLevel',
  },
  maximumBatchingWindowInSeconds: 123,
  maximumRecordAgeInSeconds: 123,
  maximumRetryAttempts: 123,
  metricsConfig: {
    metrics: ['metrics'],
  },
  parallelizationFactor: 123,
  provisionedPollerConfig: {
    maximumPollers: 123,
    minimumPollers: 123,
    pollerGroupName: 'pollerGroupName',
  },
  queues: ['queues'],
  scalingConfig: {
    maximumConcurrency: 123,
  },
  selfManagedEventSource: {
    endpoints: {
      kafkaBootstrapServers: ['kafkaBootstrapServers'],
    },
  },
  selfManagedKafkaEventSourceConfig: {
    consumerGroupId: 'consumerGroupId',
    consumptionMode: 'consumptionMode',
    schemaRegistryConfig: {
      accessConfigs: [{
        type: 'type',
        uri: 'uri',
      }],
      eventRecordFormat: 'eventRecordFormat',
      schemaRegistryUri: 'schemaRegistryUri',
      schemaValidationConfigs: [{
        attribute: 'attribute',
      }],
    },
  },
  sourceAccessConfigurations: [{
    type: 'type',
    uri: 'uri',
  }],
  startingPosition: 'startingPosition',
  startingPositionTimestamp: 123,
  tags: [{
    key: 'key',
    value: 'value',
  }],
  topics: ['topics'],
  tumblingWindowInSeconds: 123,
});
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

cfn_event_source_mapping = lambda_.CfnEventSourceMapping(self, "MyCfnEventSourceMapping",
    function_name="functionName",

    # the properties below are optional
    amazon_managed_kafka_event_source_config=lambda.CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty(
        consumer_group_id="consumerGroupId",
        schema_registry_config=lambda.CfnEventSourceMapping.SchemaRegistryConfigProperty(
            access_configs=[lambda.CfnEventSourceMapping.SchemaRegistryAccessConfigProperty(
                type="type",
                uri="uri"
            )],
            event_record_format="eventRecordFormat",
            schema_registry_uri="schemaRegistryUri",
            schema_validation_configs=[lambda.CfnEventSourceMapping.SchemaValidationConfigProperty(
                attribute="attribute"
            )]
        )
    ),
    batch_size=123,
    bisect_batch_on_function_error=False,
    destination_config=lambda.CfnEventSourceMapping.DestinationConfigProperty(
        on_failure=lambda.CfnEventSourceMapping.OnFailureProperty(
            destination="destination"
        )
    ),
    document_db_event_source_config=lambda.CfnEventSourceMapping.DocumentDBEventSourceConfigProperty(
        collection_name="collectionName",
        database_name="databaseName",
        full_document="fullDocument"
    ),
    enabled=False,
    event_source_arn="eventSourceArn",
    filter_criteria=lambda.CfnEventSourceMapping.FilterCriteriaProperty(
        filters=[lambda.CfnEventSourceMapping.FilterProperty(
            pattern="pattern"
        )]
    ),
    function_response_types=["functionResponseTypes"],
    kms_key_arn="kmsKeyArn",
    logging_config=lambda.CfnEventSourceMapping.LoggingConfigProperty(
        system_log_level="systemLogLevel"
    ),
    maximum_batching_window_in_seconds=123,
    maximum_record_age_in_seconds=123,
    maximum_retry_attempts=123,
    metrics_config=lambda.CfnEventSourceMapping.MetricsConfigProperty(
        metrics=["metrics"]
    ),
    parallelization_factor=123,
    provisioned_poller_config=lambda.CfnEventSourceMapping.ProvisionedPollerConfigProperty(
        maximum_pollers=123,
        minimum_pollers=123,
        poller_group_name="pollerGroupName"
    ),
    queues=["queues"],
    scaling_config=lambda.CfnEventSourceMapping.ScalingConfigProperty(
        maximum_concurrency=123
    ),
    self_managed_event_source=lambda.CfnEventSourceMapping.SelfManagedEventSourceProperty(
        endpoints=lambda.CfnEventSourceMapping.EndpointsProperty(
            kafka_bootstrap_servers=["kafkaBootstrapServers"]
        )
    ),
    self_managed_kafka_event_source_config=lambda.CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty(
        consumer_group_id="consumerGroupId",
        consumption_mode="consumptionMode",
        schema_registry_config=lambda.CfnEventSourceMapping.SchemaRegistryConfigProperty(
            access_configs=[lambda.CfnEventSourceMapping.SchemaRegistryAccessConfigProperty(
                type="type",
                uri="uri"
            )],
            event_record_format="eventRecordFormat",
            schema_registry_uri="schemaRegistryUri",
            schema_validation_configs=[lambda.CfnEventSourceMapping.SchemaValidationConfigProperty(
                attribute="attribute"
            )]
        )
    ),
    source_access_configurations=[lambda.CfnEventSourceMapping.SourceAccessConfigurationProperty(
        type="type",
        uri="uri"
    )],
    starting_position="startingPosition",
    starting_position_timestamp=123,
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    topics=["topics"],
    tumbling_window_in_seconds=123
)
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.lambda.*;

CfnEventSourceMapping cfnEventSourceMapping = CfnEventSourceMapping.Builder.create(this, "MyCfnEventSourceMapping")
        .functionName("functionName")

        // the properties below are optional
        .amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfigProperty.builder()
                .consumerGroupId("consumerGroupId")
                .schemaRegistryConfig(SchemaRegistryConfigProperty.builder()
                        .accessConfigs(List.of(SchemaRegistryAccessConfigProperty.builder()
                                .type("type")
                                .uri("uri")
                                .build()))
                        .eventRecordFormat("eventRecordFormat")
                        .schemaRegistryUri("schemaRegistryUri")
                        .schemaValidationConfigs(List.of(SchemaValidationConfigProperty.builder()
                                .attribute("attribute")
                                .build()))
                        .build())
                .build())
        .batchSize(123)
        .bisectBatchOnFunctionError(false)
        .destinationConfig(DestinationConfigProperty.builder()
                .onFailure(OnFailureProperty.builder()
                        .destination("destination")
                        .build())
                .build())
        .documentDbEventSourceConfig(DocumentDBEventSourceConfigProperty.builder()
                .collectionName("collectionName")
                .databaseName("databaseName")
                .fullDocument("fullDocument")
                .build())
        .enabled(false)
        .eventSourceArn("eventSourceArn")
        .filterCriteria(FilterCriteriaProperty.builder()
                .filters(List.of(FilterProperty.builder()
                        .pattern("pattern")
                        .build()))
                .build())
        .functionResponseTypes(List.of("functionResponseTypes"))
        .kmsKeyArn("kmsKeyArn")
        .loggingConfig(LoggingConfigProperty.builder()
                .systemLogLevel("systemLogLevel")
                .build())
        .maximumBatchingWindowInSeconds(123)
        .maximumRecordAgeInSeconds(123)
        .maximumRetryAttempts(123)
        .metricsConfig(MetricsConfigProperty.builder()
                .metrics(List.of("metrics"))
                .build())
        .parallelizationFactor(123)
        .provisionedPollerConfig(ProvisionedPollerConfigProperty.builder()
                .maximumPollers(123)
                .minimumPollers(123)
                .pollerGroupName("pollerGroupName")
                .build())
        .queues(List.of("queues"))
        .scalingConfig(ScalingConfigProperty.builder()
                .maximumConcurrency(123)
                .build())
        .selfManagedEventSource(SelfManagedEventSourceProperty.builder()
                .endpoints(EndpointsProperty.builder()
                        .kafkaBootstrapServers(List.of("kafkaBootstrapServers"))
                        .build())
                .build())
        .selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfigProperty.builder()
                .consumerGroupId("consumerGroupId")
                .consumptionMode("consumptionMode")
                .schemaRegistryConfig(SchemaRegistryConfigProperty.builder()
                        .accessConfigs(List.of(SchemaRegistryAccessConfigProperty.builder()
                                .type("type")
                                .uri("uri")
                                .build()))
                        .eventRecordFormat("eventRecordFormat")
                        .schemaRegistryUri("schemaRegistryUri")
                        .schemaValidationConfigs(List.of(SchemaValidationConfigProperty.builder()
                                .attribute("attribute")
                                .build()))
                        .build())
                .build())
        .sourceAccessConfigurations(List.of(SourceAccessConfigurationProperty.builder()
                .type("type")
                .uri("uri")
                .build()))
        .startingPosition("startingPosition")
        .startingPositionTimestamp(123)
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .topics(List.of("topics"))
        .tumblingWindowInSeconds(123)
        .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.Lambda;

var cfnEventSourceMapping = new CfnEventSourceMapping(this, "MyCfnEventSourceMapping", new CfnEventSourceMappingProps {
    FunctionName = "functionName",

    // the properties below are optional
    AmazonManagedKafkaEventSourceConfig = new AmazonManagedKafkaEventSourceConfigProperty {
        ConsumerGroupId = "consumerGroupId",
        SchemaRegistryConfig = new SchemaRegistryConfigProperty {
            AccessConfigs = new [] { new SchemaRegistryAccessConfigProperty {
                Type = "type",
                Uri = "uri"
            } },
            EventRecordFormat = "eventRecordFormat",
            SchemaRegistryUri = "schemaRegistryUri",
            SchemaValidationConfigs = new [] { new SchemaValidationConfigProperty {
                Attribute = "attribute"
            } }
        }
    },
    BatchSize = 123,
    BisectBatchOnFunctionError = false,
    DestinationConfig = new DestinationConfigProperty {
        OnFailure = new OnFailureProperty {
            Destination = "destination"
        }
    },
    DocumentDbEventSourceConfig = new DocumentDBEventSourceConfigProperty {
        CollectionName = "collectionName",
        DatabaseName = "databaseName",
        FullDocument = "fullDocument"
    },
    Enabled = false,
    EventSourceArn = "eventSourceArn",
    FilterCriteria = new FilterCriteriaProperty {
        Filters = new [] { new FilterProperty {
            Pattern = "pattern"
        } }
    },
    FunctionResponseTypes = new [] { "functionResponseTypes" },
    KmsKeyArn = "kmsKeyArn",
    LoggingConfig = new LoggingConfigProperty {
        SystemLogLevel = "systemLogLevel"
    },
    MaximumBatchingWindowInSeconds = 123,
    MaximumRecordAgeInSeconds = 123,
    MaximumRetryAttempts = 123,
    MetricsConfig = new MetricsConfigProperty {
        Metrics = new [] { "metrics" }
    },
    ParallelizationFactor = 123,
    ProvisionedPollerConfig = new ProvisionedPollerConfigProperty {
        MaximumPollers = 123,
        MinimumPollers = 123,
        PollerGroupName = "pollerGroupName"
    },
    Queues = new [] { "queues" },
    ScalingConfig = new ScalingConfigProperty {
        MaximumConcurrency = 123
    },
    SelfManagedEventSource = new SelfManagedEventSourceProperty {
        Endpoints = new EndpointsProperty {
            KafkaBootstrapServers = new [] { "kafkaBootstrapServers" }
        }
    },
    SelfManagedKafkaEventSourceConfig = new SelfManagedKafkaEventSourceConfigProperty {
        ConsumerGroupId = "consumerGroupId",
        ConsumptionMode = "consumptionMode",
        SchemaRegistryConfig = new SchemaRegistryConfigProperty {
            AccessConfigs = new [] { new SchemaRegistryAccessConfigProperty {
                Type = "type",
                Uri = "uri"
            } },
            EventRecordFormat = "eventRecordFormat",
            SchemaRegistryUri = "schemaRegistryUri",
            SchemaValidationConfigs = new [] { new SchemaValidationConfigProperty {
                Attribute = "attribute"
            } }
        }
    },
    SourceAccessConfigurations = new [] { new SourceAccessConfigurationProperty {
        Type = "type",
        Uri = "uri"
    } },
    StartingPosition = "startingPosition",
    StartingPositionTimestamp = 123,
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    Topics = new [] { "topics" },
    TumblingWindowInSeconds = 123
});
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"

cfnEventSourceMapping := awscdk.Aws_lambda.NewCfnEventSourceMapping(this, jsii.String("MyCfnEventSourceMapping"), &CfnEventSourceMappingProps{
	FunctionName: jsii.String("functionName"),

	// the properties below are optional
	AmazonManagedKafkaEventSourceConfig: &AmazonManagedKafkaEventSourceConfigProperty{
		ConsumerGroupId: jsii.String("consumerGroupId"),
		SchemaRegistryConfig: &SchemaRegistryConfigProperty{
			AccessConfigs: []interface{}{
				&SchemaRegistryAccessConfigProperty{
					Type: jsii.String("type"),
					Uri: jsii.String("uri"),
				},
			},
			EventRecordFormat: jsii.String("eventRecordFormat"),
			SchemaRegistryUri: jsii.String("schemaRegistryUri"),
			SchemaValidationConfigs: []interface{}{
				&SchemaValidationConfigProperty{
					Attribute: jsii.String("attribute"),
				},
			},
		},
	},
	BatchSize: jsii.Number(123),
	BisectBatchOnFunctionError: jsii.Boolean(false),
	DestinationConfig: &DestinationConfigProperty{
		OnFailure: &OnFailureProperty{
			Destination: jsii.String("destination"),
		},
	},
	DocumentDbEventSourceConfig: &DocumentDBEventSourceConfigProperty{
		CollectionName: jsii.String("collectionName"),
		DatabaseName: jsii.String("databaseName"),
		FullDocument: jsii.String("fullDocument"),
	},
	Enabled: jsii.Boolean(false),
	EventSourceArn: jsii.String("eventSourceArn"),
	FilterCriteria: &FilterCriteriaProperty{
		Filters: []interface{}{
			&FilterProperty{
				Pattern: jsii.String("pattern"),
			},
		},
	},
	FunctionResponseTypes: []*string{
		jsii.String("functionResponseTypes"),
	},
	KmsKeyArn: jsii.String("kmsKeyArn"),
	LoggingConfig: &LoggingConfigProperty{
		SystemLogLevel: jsii.String("systemLogLevel"),
	},
	MaximumBatchingWindowInSeconds: jsii.Number(123),
	MaximumRecordAgeInSeconds: jsii.Number(123),
	MaximumRetryAttempts: jsii.Number(123),
	MetricsConfig: &MetricsConfigProperty{
		Metrics: []*string{
			jsii.String("metrics"),
		},
	},
	ParallelizationFactor: jsii.Number(123),
	ProvisionedPollerConfig: &ProvisionedPollerConfigProperty{
		MaximumPollers: jsii.Number(123),
		MinimumPollers: jsii.Number(123),
		PollerGroupName: jsii.String("pollerGroupName"),
	},
	Queues: []*string{
		jsii.String("queues"),
	},
	ScalingConfig: &ScalingConfigProperty{
		MaximumConcurrency: jsii.Number(123),
	},
	SelfManagedEventSource: &SelfManagedEventSourceProperty{
		Endpoints: &EndpointsProperty{
			KafkaBootstrapServers: []*string{
				jsii.String("kafkaBootstrapServers"),
			},
		},
	},
	SelfManagedKafkaEventSourceConfig: &SelfManagedKafkaEventSourceConfigProperty{
		ConsumerGroupId: jsii.String("consumerGroupId"),
		ConsumptionMode: jsii.String("consumptionMode"),
		SchemaRegistryConfig: &SchemaRegistryConfigProperty{
			AccessConfigs: []interface{}{
				&SchemaRegistryAccessConfigProperty{
					Type: jsii.String("type"),
					Uri: jsii.String("uri"),
				},
			},
			EventRecordFormat: jsii.String("eventRecordFormat"),
			SchemaRegistryUri: jsii.String("schemaRegistryUri"),
			SchemaValidationConfigs: []interface{}{
				&SchemaValidationConfigProperty{
					Attribute: jsii.String("attribute"),
				},
			},
		},
	},
	SourceAccessConfigurations: []interface{}{
		&SourceAccessConfigurationProperty{
			Type: jsii.String("type"),
			Uri: jsii.String("uri"),
		},
	},
	StartingPosition: jsii.String("startingPosition"),
	StartingPositionTimestamp: jsii.Number(123),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Topics: []*string{
		jsii.String("topics"),
	},
	TumblingWindowInSeconds: jsii.Number(123),
})

Initializer ​

ts
new CfnEventSourceMapping(scope: Construct, id: string, props: CfnEventSourceMappingProps)
python
CfnEventSourceMapping(scope: Construct, id: str, props: CfnEventSourceMappingProps)
java
new CfnEventSourceMapping(Construct scope, String id, CfnEventSourceMappingProps props)
csharp
new CfnEventSourceMapping(Construct scope, string id, CfnEventSourceMappingProps props)
go
NewCfnEventSourceMapping(Scope Construct, Id *string, Props CfnEventSourceMappingProps)

Construct Props ​

amazonManagedKafkaEventSourceConfigIResolvable | CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigPropertyamazon_managed_kafka_event_source_configtyping.Union[IResolvable, AmazonManagedKafkaEventSourceConfigProperty]amazonManagedKafkaEventSourceConfigIResolvableAmazonManagedKafkaEventSourceConfigIResolvableAmazonManagedKafkaEventSourceConfiginterface{}#
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
batchSizenumberbatch_sizeint | floatbatchSizeNumberBatchSizedoubleBatchSize*float64#
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.
notes

Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).

  • Amazon Kinesis – Default 100. Max 10,000.
  • Amazon DynamoDB Streams – Default 100. Max 10,000.
  • Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.
  • Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
  • Self-managed Apache Kafka – Default 100. Max 10,000.
  • Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
  • DocumentDB – Default 100. Max 10,000.
bisectBatchOnFunctionErrorboolean | IResolvablebisect_batch_on_function_errortyping.Union[bool, IResolvable]bisectBatchOnFunctionErrorBooleanBisectBatchOnFunctionErrorboolBisectBatchOnFunctionErrorinterface{}#
(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.
notes

The default value is false.

When using BisectBatchOnFunctionError , check the BatchSize parameter in the OnFailure destination message's metadata. The BatchSize could be greater than 1 since Lambda consolidates failed messages metadata when writing to the OnFailure destination.

destinationConfigIResolvable | CfnEventSourceMapping.DestinationConfigPropertydestination_configtyping.Union[IResolvable, DestinationConfigProperty]destinationConfigIResolvableDestinationConfigIResolvableDestinationConfiginterface{}#
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A configuration object that specifies the destination of an event after Lambda processes it.
documentDbEventSourceConfigIResolvable | CfnEventSourceMapping.DocumentDBEventSourceConfigPropertydocument_db_event_source_configtyping.Union[IResolvable, DocumentDBEventSourceConfigProperty]documentDbEventSourceConfigIResolvableDocumentDbEventSourceConfigIResolvableDocumentDbEventSourceConfiginterface{}#
Specific configuration settings for a DocumentDB event source.
enabledboolean | IResolvableenabledtyping.Union[bool, IResolvable]enabledBooleanEnabledboolEnabledinterface{}#
When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

Default: True

eventSourceArnstring | IStreamRef | IClusterRef | IQueueRefevent_source_arntyping.Union[str, IStreamRef, IClusterRef, IQueueRef]eventSourceArnStringEventSourceArnstringEventSourceArninterface{}#
The Amazon Resource Name (ARN) of the event source.
notes
  • Amazon Kinesis – The ARN of the data stream or a stream consumer.
  • Amazon DynamoDB Streams – The ARN of the stream.
  • Amazon Simple Queue Service – The ARN of the queue.
  • Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings ).
  • Amazon MQ – The ARN of the broker.
  • Amazon DocumentDB – The ARN of the DocumentDB change stream.
filterCriteriaIResolvable | CfnEventSourceMapping.FilterCriteriaPropertyfilter_criteriatyping.Union[IResolvable, FilterCriteriaProperty]filterCriteriaIResolvableFilterCriteriaIResolvableFilterCriteriainterface{}#
An object that defines the filter criteria that determine whether Lambda should process an event.

For more information, see Lambda event filtering .

functionNamestring | IFunctionRef | IVersionReffunction_nametyping.Union[str, IFunctionRef, IVersionRef]functionNameStringFunctionNamestringFunctionNameinterface{}required#
The name or ARN of the Lambda function.
notes

Name formats - Function name – MyFunction .

  • Function ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
  • Version or Alias ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD .
  • Partial ARN – 123456789012:function:MyFunction .

The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

functionResponseTypesstring[]function_response_typestyping.List[str]functionResponseTypesList<String>FunctionResponseTypesstring[]FunctionResponseTypes*[]*string#
(Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping.

Valid Values: ReportBatchItemFailures

kmsKeyArnstringkms_key_arnstrkmsKeyArnStringKmsKeyArnstringKmsKeyArn*string#
The ARN of the AWS Key Management Service ( AWS ) customer managed key that Lambda uses to encrypt your function's [filter criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics) .
loggingConfigIResolvable | CfnEventSourceMapping.LoggingConfigPropertylogging_configtyping.Union[IResolvable, LoggingConfigProperty]loggingConfigIResolvableLoggingConfigIResolvableLoggingConfiginterface{}#
The function's Amazon CloudWatch Logs configuration settings.
maximumBatchingWindowInSecondsnumbermaximum_batching_window_in_secondsint | floatmaximumBatchingWindowInSecondsNumberMaximumBatchingWindowInSecondsdoubleMaximumBatchingWindowInSeconds*float64#
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
notes

Default ( Kinesis , DynamoDB , Amazon SQS event sources) : 0

Default ( Amazon MSK , Kafka, Amazon MQ , Amazon DocumentDB event sources) : 500 ms

Related setting: For Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

maximumRecordAgeInSecondsnumbermaximum_record_age_in_secondsint | floatmaximumRecordAgeInSecondsNumberMaximumRecordAgeInSecondsdoubleMaximumRecordAgeInSeconds*float64#
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records older than the specified age.
notes

The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.

The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowed

maximumRetryAttemptsnumbermaximum_retry_attemptsint | floatmaximumRetryAttemptsNumberMaximumRetryAttemptsdoubleMaximumRetryAttempts*float64#
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records after the specified number of retries.

The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.

metricsConfigIResolvable | CfnEventSourceMapping.MetricsConfigPropertymetrics_configtyping.Union[IResolvable, MetricsConfigProperty]metricsConfigIResolvableMetricsConfigIResolvableMetricsConfiginterface{}#
The metrics configuration for your event source.

For more information, see Event source mapping metrics .

parallelizationFactornumberparallelization_factorint | floatparallelizationFactorNumberParallelizationFactordoubleParallelizationFactor*float64#
(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.

The default value is 1.

provisionedPollerConfigIResolvable | CfnEventSourceMapping.ProvisionedPollerConfigPropertyprovisioned_poller_configtyping.Union[IResolvable, ProvisionedPollerConfigProperty]provisionedPollerConfigIResolvableProvisionedPollerConfigIResolvableProvisionedPollerConfiginterface{}#
(Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source.

For more information, see provisioned mode .

queuesstring[]queuestyping.List[str]queuesList<String>Queuesstring[]Queues*[]*string#
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
scalingConfigIResolvable | CfnEventSourceMapping.ScalingConfigPropertyscaling_configtyping.Union[IResolvable, ScalingConfigProperty]scalingConfigIResolvableScalingConfigIResolvableScalingConfiginterface{}#
This property is for Amazon SQS event sources only.

You cannot use ProvisionedPollerConfig while using ScalingConfig . These options are mutually exclusive. To remove the scaling configuration, pass an empty value.

selfManagedEventSourceIResolvable | CfnEventSourceMapping.SelfManagedEventSourcePropertyself_managed_event_sourcetyping.Union[IResolvable, SelfManagedEventSourceProperty]selfManagedEventSourceIResolvableSelfManagedEventSourceIResolvableSelfManagedEventSourceinterface{}#
The self-managed Apache Kafka cluster for your event source.
selfManagedKafkaEventSourceConfigIResolvable | CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigPropertyself_managed_kafka_event_source_configtyping.Union[IResolvable, SelfManagedKafkaEventSourceConfigProperty]selfManagedKafkaEventSourceConfigIResolvableSelfManagedKafkaEventSourceConfigIResolvableSelfManagedKafkaEventSourceConfiginterface{}#
Specific configuration settings for a self-managed Apache Kafka event source.
sourceAccessConfigurationsIResolvable | IResolvable | CfnEventSourceMapping.SourceAccessConfigurationProperty[]source_access_configurationstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, SourceAccessConfigurationProperty]]]sourceAccessConfigurationsIResolvableSourceAccessConfigurationsIResolvableSourceAccessConfigurationsinterface{}#
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
startingPositionstringstarting_positionstrstartingPositionStringStartingPositionstringStartingPosition*string#
The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.
  • LATEST - Read only new records.
  • TRIM_HORIZON - Process all available records.
  • AT_TIMESTAMP - Specify a time from which to start reading records.
startingPositionTimestampnumberstarting_position_timestampint | floatstartingPositionTimestampNumberStartingPositionTimestampdoubleStartingPositionTimestamp*float64#
With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds.

StartingPositionTimestamp cannot be in the future.

tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag#
A list of tags to add to the event source mapping.
notes

You must have the lambda:TagResource , lambda:UntagResource , and lambda:ListTags permissions for your IAM principal to manage the CloudFormation stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.

topicsstring[]topicstyping.List[str]topicsList<String>Topicsstring[]Topics*[]*string#
The name of the Kafka topic.
tumblingWindowInSecondsnumbertumbling_window_in_secondsint | floattumblingWindowInSecondsNumberTumblingWindowInSecondsdoubleTumblingWindowInSeconds*float64#
(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.

A value of 0 seconds indicates no tumbling window.

Properties ​

amazonManagedKafkaEventSourceConfigIResolvable | CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigPropertyamazon_managed_kafka_event_source_configtyping.Union[IResolvable, AmazonManagedKafkaEventSourceConfigProperty]amazonManagedKafkaEventSourceConfigIResolvableAmazonManagedKafkaEventSourceConfigIResolvableAmazonManagedKafkaEventSourceConfiginterface{}#
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
attrEventSourceMappingArnstringattr_event_source_mapping_arnstrattrEventSourceMappingArnStringAttrEventSourceMappingArnstringAttrEventSourceMappingArn*stringrequired#
The Amazon Resource Name (ARN) of the event source mapping.
attrIdstringattr_idstrattrIdStringAttrIdstringAttrId*stringrequired#
The event source mapping's ID.
batchSizenumberbatch_sizeint | floatbatchSizeNumberBatchSizedoubleBatchSize*float64#
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.
bisectBatchOnFunctionErrorboolean | IResolvablebisect_batch_on_function_errortyping.Union[bool, IResolvable]bisectBatchOnFunctionErrorBooleanBisectBatchOnFunctionErrorboolBisectBatchOnFunctionErrorinterface{}#
(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.
cdkTagManagerTagManagercdk_tag_managerTagManagercdkTagManagerTagManagerCdkTagManagerTagManagerCdkTagManagerTagManagerrequired#
Tag Manager which manages the tags for this resource.
CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringrequiredstatic#
The CloudFormation resource type name for this resource class.
Options for this resource, such as condition, update policy etc.
cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*stringrequired#
AWS resource type.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#
destinationConfigIResolvable | CfnEventSourceMapping.DestinationConfigPropertydestination_configtyping.Union[IResolvable, DestinationConfigProperty]destinationConfigIResolvableDestinationConfigIResolvableDestinationConfiginterface{}#
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A configuration object that specifies the destination of an event after Lambda processes it.
documentDbEventSourceConfigIResolvable | CfnEventSourceMapping.DocumentDBEventSourceConfigPropertydocument_db_event_source_configtyping.Union[IResolvable, DocumentDBEventSourceConfigProperty]documentDbEventSourceConfigIResolvableDocumentDbEventSourceConfigIResolvableDocumentDbEventSourceConfiginterface{}#
Specific configuration settings for a DocumentDB event source.
enabledboolean | IResolvableenabledtyping.Union[bool, IResolvable]enabledBooleanEnabledboolEnabledinterface{}#
When true, the event source mapping is active.

When false, Lambda pauses polling and invocation.

eventSourceArnstringevent_source_arnstreventSourceArnStringEventSourceArnstringEventSourceArn*string#
The Amazon Resource Name (ARN) of the event source.
eventSourceMappingRefEventSourceMappingReferenceevent_source_mapping_refEventSourceMappingReferenceeventSourceMappingRefEventSourceMappingReferenceEventSourceMappingRefEventSourceMappingReferenceEventSourceMappingRefEventSourceMappingReferencerequired#
A reference to a EventSourceMapping resource.
filterCriteriaIResolvable | CfnEventSourceMapping.FilterCriteriaPropertyfilter_criteriatyping.Union[IResolvable, FilterCriteriaProperty]filterCriteriaIResolvableFilterCriteriaIResolvableFilterCriteriainterface{}#
An object that defines the filter criteria that determine whether Lambda should process an event.
functionNamestringfunction_namestrfunctionNameStringFunctionNamestringFunctionName*stringrequired#
The name or ARN of the Lambda function.
functionResponseTypesstring[]function_response_typestyping.List[str]functionResponseTypesList<String>FunctionResponseTypesstring[]FunctionResponseTypes*[]*string#
(Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping.
kmsKeyArnstringkms_key_arnstrkmsKeyArnStringKmsKeyArnstringKmsKeyArn*string#
The ARN of the AWS Key Management Service ( AWS ) customer managed key that Lambda uses to encrypt your function's [filter criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics) .
loggingConfigIResolvable | CfnEventSourceMapping.LoggingConfigPropertylogging_configtyping.Union[IResolvable, LoggingConfigProperty]loggingConfigIResolvableLoggingConfigIResolvableLoggingConfiginterface{}#
The function's Amazon CloudWatch Logs configuration settings.
logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*stringrequired#
The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

maximumBatchingWindowInSecondsnumbermaximum_batching_window_in_secondsint | floatmaximumBatchingWindowInSecondsNumberMaximumBatchingWindowInSecondsdoubleMaximumBatchingWindowInSeconds*float64#
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
maximumRecordAgeInSecondsnumbermaximum_record_age_in_secondsint | floatmaximumRecordAgeInSecondsNumberMaximumRecordAgeInSecondsdoubleMaximumRecordAgeInSeconds*float64#
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records older than the specified age.
maximumRetryAttemptsnumbermaximum_retry_attemptsint | floatmaximumRetryAttemptsNumberMaximumRetryAttemptsdoubleMaximumRetryAttempts*float64#
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records after the specified number of retries.
metricsConfigIResolvable | CfnEventSourceMapping.MetricsConfigPropertymetrics_configtyping.Union[IResolvable, MetricsConfigProperty]metricsConfigIResolvableMetricsConfigIResolvableMetricsConfiginterface{}#
The metrics configuration for your event source.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
parallelizationFactornumberparallelization_factorint | floatparallelizationFactorNumberParallelizationFactordoubleParallelizationFactor*float64#
(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.
provisionedPollerConfigIResolvable | CfnEventSourceMapping.ProvisionedPollerConfigPropertyprovisioned_poller_configtyping.Union[IResolvable, ProvisionedPollerConfigProperty]provisionedPollerConfigIResolvableProvisionedPollerConfigIResolvableProvisionedPollerConfiginterface{}#
(Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source.
queuesstring[]queuestyping.List[str]queuesList<String>Queuesstring[]Queues*[]*string#
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
refstringrefstrrefStringRefstringRef*stringrequired#
Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

scalingConfigIResolvable | CfnEventSourceMapping.ScalingConfigPropertyscaling_configtyping.Union[IResolvable, ScalingConfigProperty]scalingConfigIResolvableScalingConfigIResolvableScalingConfiginterface{}#
This property is for Amazon SQS event sources only.
selfManagedEventSourceIResolvable | CfnEventSourceMapping.SelfManagedEventSourcePropertyself_managed_event_sourcetyping.Union[IResolvable, SelfManagedEventSourceProperty]selfManagedEventSourceIResolvableSelfManagedEventSourceIResolvableSelfManagedEventSourceinterface{}#
The self-managed Apache Kafka cluster for your event source.
selfManagedKafkaEventSourceConfigIResolvable | CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigPropertyself_managed_kafka_event_source_configtyping.Union[IResolvable, SelfManagedKafkaEventSourceConfigProperty]selfManagedKafkaEventSourceConfigIResolvableSelfManagedKafkaEventSourceConfigIResolvableSelfManagedKafkaEventSourceConfiginterface{}#
Specific configuration settings for a self-managed Apache Kafka event source.
sourceAccessConfigurationsIResolvable | IResolvable | CfnEventSourceMapping.SourceAccessConfigurationProperty[]source_access_configurationstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, SourceAccessConfigurationProperty]]]sourceAccessConfigurationsIResolvableSourceAccessConfigurationsIResolvableSourceAccessConfigurationsinterface{}#
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

startingPositionstringstarting_positionstrstartingPositionStringStartingPositionstringStartingPosition*string#
The position in a stream from which to start reading.

Required for Amazon Kinesis and Amazon DynamoDB.

startingPositionTimestampnumberstarting_position_timestampint | floatstartingPositionTimestampNumberStartingPositionTimestampdoubleStartingPositionTimestamp*float64#
With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds.
tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag#
A list of tags to add to the event source mapping.
topicsstring[]topicstyping.List[str]topicsList<String>Topicsstring[]Topics*[]*string#
The name of the Kafka topic.
tumblingWindowInSecondsnumbertumbling_window_in_secondsint | floattumblingWindowInSecondsNumberTumblingWindowInSecondsdoubleTumblingWindowInSeconds*float64#
(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.

Methods ​

addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#
Syntactic sugar for `addOverride(path, undefined)`.
1 parameter

Parameters

  • pathpathpathpathPath — The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#
Use `addResourceDependency` instead.

This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.

addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#
Use `addResourceDependency` instead.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.

addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#
Add a value to the CloudFormation Resource Metadata.
addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#
Adds an override to the synthesized CloudFormation resource.
notes · 2 parameters

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

json
"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters

  • pathpathpathpathPath — - The path of the property, you can use dot notation to override values in complex types.
  • valuevaluevaluevalueValue — - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#
Adds an override that deletes the value of a property from the resource definition.
1 parameter

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#
Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

2 parameters

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path of the property.
  • valuevaluevaluevalueValue — The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

1 parameter

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#
Sets the deletion policy of the resource based on the removal policy specified.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

arnForEventSourceMapping(resource: IEventSourceMappingRef): string@staticmethod def arn_for_event_source_mapping(resource: IEventSourceMappingRef) -> strpublic static String arnForEventSourceMapping(IEventSourceMappingRef resource)public static string ArnForEventSourceMapping(IEventSourceMappingRef resource)func ArnForEventSourceMapping(Resource IEventSourceMappingRef) *stringstatic#
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#
getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#
Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

1 parameter

Parameters

  • attributeNameattribute_nameattributeNameattributeNameAttributeName — The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#
Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#
Examines the CloudFormation resource and discloses attributes.
1 parameter

Parameters

  • inspectorinspectorinspectorinspectorInspector — tree inspector to collect and process attributes.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

isCfnEventSourceMapping(x: any): boolean@staticmethod def is_cfn_event_source_mapping(x: Any) -> boolpublic static Boolean isCfnEventSourceMapping(Object x)public static bool IsCfnEventSourceMapping(object x)func IsCfnEventSourceMapping(X interface{}) *boolstatic#
Checks whether the given object is a CfnEventSourceMapping.
isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#
Check whether the given object is a CfnResource.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#
Retrieves an array of resources and stacks this resource depends on.

For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#
Use `removeResourceDependency` instead

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#
Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#
Replaces one dependency with another.
2 parameters

Parameters

  • targettargettargettargetTarget — The dependency to replace.
  • newTargetnew_targetnewTargetnewTargetNewTarget — The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
returns

Returns: a string representation of this resource

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.