github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lambda/eventSourceMapping.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package lambda 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for Apache Kafka (MSK). 16 // 17 // For information about Lambda and how to use it, see [What is AWS Lambda?](http://docs.aws.amazon.com/lambda/latest/dg/welcome.html). 18 // For information about event source mappings, see [CreateEventSourceMapping](http://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) in the API docs. 19 // 20 // ## Example Usage 21 // 22 // ### DynamoDB 23 // 24 // <!--Start PulumiCodeChooser --> 25 // ```go 26 // package main 27 // 28 // import ( 29 // 30 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 31 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 32 // 33 // ) 34 // 35 // func main() { 36 // pulumi.Run(func(ctx *pulumi.Context) error { 37 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 38 // EventSourceArn: pulumi.Any(exampleAwsDynamodbTable.StreamArn), 39 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 40 // StartingPosition: pulumi.String("LATEST"), 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 // 52 // ### Kinesis 53 // 54 // <!--Start PulumiCodeChooser --> 55 // ```go 56 // package main 57 // 58 // import ( 59 // 60 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 61 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 62 // 63 // ) 64 // 65 // func main() { 66 // pulumi.Run(func(ctx *pulumi.Context) error { 67 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 68 // EventSourceArn: pulumi.Any(exampleAwsKinesisStream.Arn), 69 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 70 // StartingPosition: pulumi.String("LATEST"), 71 // }) 72 // if err != nil { 73 // return err 74 // } 75 // return nil 76 // }) 77 // } 78 // 79 // ``` 80 // <!--End PulumiCodeChooser --> 81 // 82 // ### Managed Streaming for Apache Kafka (MSK) 83 // 84 // <!--Start PulumiCodeChooser --> 85 // ```go 86 // package main 87 // 88 // import ( 89 // 90 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 91 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 92 // 93 // ) 94 // 95 // func main() { 96 // pulumi.Run(func(ctx *pulumi.Context) error { 97 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 98 // EventSourceArn: pulumi.Any(exampleAwsMskCluster.Arn), 99 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 100 // Topics: pulumi.StringArray{ 101 // pulumi.String("Example"), 102 // }, 103 // StartingPosition: pulumi.String("TRIM_HORIZON"), 104 // }) 105 // if err != nil { 106 // return err 107 // } 108 // return nil 109 // }) 110 // } 111 // 112 // ``` 113 // <!--End PulumiCodeChooser --> 114 // 115 // ### Self Managed Apache Kafka 116 // 117 // <!--Start PulumiCodeChooser --> 118 // ```go 119 // package main 120 // 121 // import ( 122 // 123 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 124 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 125 // 126 // ) 127 // 128 // func main() { 129 // pulumi.Run(func(ctx *pulumi.Context) error { 130 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 131 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 132 // Topics: pulumi.StringArray{ 133 // pulumi.String("Example"), 134 // }, 135 // StartingPosition: pulumi.String("TRIM_HORIZON"), 136 // SelfManagedEventSource: &lambda.EventSourceMappingSelfManagedEventSourceArgs{ 137 // Endpoints: pulumi.StringMap{ 138 // "KAFKA_BOOTSTRAP_SERVERS": pulumi.String("kafka1.example.com:9092,kafka2.example.com:9092"), 139 // }, 140 // }, 141 // SourceAccessConfigurations: lambda.EventSourceMappingSourceAccessConfigurationArray{ 142 // &lambda.EventSourceMappingSourceAccessConfigurationArgs{ 143 // Type: pulumi.String("VPC_SUBNET"), 144 // Uri: pulumi.String("subnet:subnet-example1"), 145 // }, 146 // &lambda.EventSourceMappingSourceAccessConfigurationArgs{ 147 // Type: pulumi.String("VPC_SUBNET"), 148 // Uri: pulumi.String("subnet:subnet-example2"), 149 // }, 150 // &lambda.EventSourceMappingSourceAccessConfigurationArgs{ 151 // Type: pulumi.String("VPC_SECURITY_GROUP"), 152 // Uri: pulumi.String("security_group:sg-example"), 153 // }, 154 // }, 155 // }) 156 // if err != nil { 157 // return err 158 // } 159 // return nil 160 // }) 161 // } 162 // 163 // ``` 164 // <!--End PulumiCodeChooser --> 165 // 166 // ### SQS 167 // 168 // <!--Start PulumiCodeChooser --> 169 // ```go 170 // package main 171 // 172 // import ( 173 // 174 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 175 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 176 // 177 // ) 178 // 179 // func main() { 180 // pulumi.Run(func(ctx *pulumi.Context) error { 181 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 182 // EventSourceArn: pulumi.Any(sqsQueueTest.Arn), 183 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 184 // }) 185 // if err != nil { 186 // return err 187 // } 188 // return nil 189 // }) 190 // } 191 // 192 // ``` 193 // <!--End PulumiCodeChooser --> 194 // 195 // ### SQS with event filter 196 // 197 // <!--Start PulumiCodeChooser --> 198 // ```go 199 // package main 200 // 201 // import ( 202 // 203 // "encoding/json" 204 // 205 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 206 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 207 // 208 // ) 209 // 210 // func main() { 211 // pulumi.Run(func(ctx *pulumi.Context) error { 212 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 213 // "body": map[string]interface{}{ 214 // "Temperature": []map[string]interface{}{ 215 // map[string]interface{}{ 216 // "numeric": []interface{}{ 217 // ">", 218 // 0, 219 // "<=", 220 // 100, 221 // }, 222 // }, 223 // }, 224 // "Location": []string{ 225 // "New York", 226 // }, 227 // }, 228 // }) 229 // if err != nil { 230 // return err 231 // } 232 // json0 := string(tmpJSON0) 233 // _, err = lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 234 // EventSourceArn: pulumi.Any(sqsQueueTest.Arn), 235 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 236 // FilterCriteria: &lambda.EventSourceMappingFilterCriteriaArgs{ 237 // Filters: lambda.EventSourceMappingFilterCriteriaFilterArray{ 238 // &lambda.EventSourceMappingFilterCriteriaFilterArgs{ 239 // Pattern: pulumi.String(json0), 240 // }, 241 // }, 242 // }, 243 // }) 244 // if err != nil { 245 // return err 246 // } 247 // return nil 248 // }) 249 // } 250 // 251 // ``` 252 // <!--End PulumiCodeChooser --> 253 // 254 // ### Amazon MQ (ActiveMQ) 255 // 256 // <!--Start PulumiCodeChooser --> 257 // ```go 258 // package main 259 // 260 // import ( 261 // 262 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 263 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 264 // 265 // ) 266 // 267 // func main() { 268 // pulumi.Run(func(ctx *pulumi.Context) error { 269 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 270 // BatchSize: pulumi.Int(10), 271 // EventSourceArn: pulumi.Any(exampleAwsMqBroker.Arn), 272 // Enabled: pulumi.Bool(true), 273 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 274 // Queues: pulumi.String("example"), 275 // SourceAccessConfigurations: lambda.EventSourceMappingSourceAccessConfigurationArray{ 276 // &lambda.EventSourceMappingSourceAccessConfigurationArgs{ 277 // Type: pulumi.String("BASIC_AUTH"), 278 // Uri: pulumi.Any(exampleAwsSecretsmanagerSecretVersion.Arn), 279 // }, 280 // }, 281 // }) 282 // if err != nil { 283 // return err 284 // } 285 // return nil 286 // }) 287 // } 288 // 289 // ``` 290 // <!--End PulumiCodeChooser --> 291 // 292 // ### Amazon MQ (RabbitMQ) 293 // 294 // <!--Start PulumiCodeChooser --> 295 // ```go 296 // package main 297 // 298 // import ( 299 // 300 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 301 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 302 // 303 // ) 304 // 305 // func main() { 306 // pulumi.Run(func(ctx *pulumi.Context) error { 307 // _, err := lambda.NewEventSourceMapping(ctx, "example", &lambda.EventSourceMappingArgs{ 308 // BatchSize: pulumi.Int(1), 309 // EventSourceArn: pulumi.Any(exampleAwsMqBroker.Arn), 310 // Enabled: pulumi.Bool(true), 311 // FunctionName: pulumi.Any(exampleAwsLambdaFunction.Arn), 312 // Queues: pulumi.String("example"), 313 // SourceAccessConfigurations: lambda.EventSourceMappingSourceAccessConfigurationArray{ 314 // &lambda.EventSourceMappingSourceAccessConfigurationArgs{ 315 // Type: pulumi.String("VIRTUAL_HOST"), 316 // Uri: pulumi.String("/example"), 317 // }, 318 // &lambda.EventSourceMappingSourceAccessConfigurationArgs{ 319 // Type: pulumi.String("BASIC_AUTH"), 320 // Uri: pulumi.Any(exampleAwsSecretsmanagerSecretVersion.Arn), 321 // }, 322 // }, 323 // }) 324 // if err != nil { 325 // return err 326 // } 327 // return nil 328 // }) 329 // } 330 // 331 // ``` 332 // <!--End PulumiCodeChooser --> 333 // 334 // ## Import 335 // 336 // Using `pulumi import`, import Lambda event source mappings using the `UUID` (event source mapping identifier). For example: 337 // 338 // ```sh 339 // $ pulumi import aws:lambda/eventSourceMapping:EventSourceMapping event_source_mapping 12345kxodurf3443 340 // ``` 341 type EventSourceMapping struct { 342 pulumi.CustomResourceState 343 344 // Additional configuration block for Amazon Managed Kafka sources. Incompatible with "selfManagedEventSource" and "selfManagedKafkaEventSourceConfig". Detailed below. 345 AmazonManagedKafkaEventSourceConfig EventSourceMappingAmazonManagedKafkaEventSourceConfigOutput `pulumi:"amazonManagedKafkaEventSourceConfig"` 346 // The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. 347 BatchSize pulumi.IntPtrOutput `pulumi:"batchSize"` 348 // - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. 349 BisectBatchOnFunctionError pulumi.BoolPtrOutput `pulumi:"bisectBatchOnFunctionError"` 350 // - (Optional) An Amazon SQS queue, Amazon SNS topic or Amazon S3 bucket (only available for Kafka sources) destination for failed records. Only available for stream sources (DynamoDB and Kinesis) and Kafka sources (Amazon MSK and Self-managed Apache Kafka). Detailed below. 351 DestinationConfig EventSourceMappingDestinationConfigPtrOutput `pulumi:"destinationConfig"` 352 // - (Optional) Configuration settings for a DocumentDB event source. Detailed below. 353 DocumentDbEventSourceConfig EventSourceMappingDocumentDbEventSourceConfigPtrOutput `pulumi:"documentDbEventSourceConfig"` 354 // Determines if the mapping will be enabled on creation. Defaults to `true`. 355 Enabled pulumi.BoolPtrOutput `pulumi:"enabled"` 356 // The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. 357 EventSourceArn pulumi.StringPtrOutput `pulumi:"eventSourceArn"` 358 // The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. 359 FilterCriteria EventSourceMappingFilterCriteriaPtrOutput `pulumi:"filterCriteria"` 360 // The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from `functionName` above.) 361 FunctionArn pulumi.StringOutput `pulumi:"functionArn"` 362 // The name or the ARN of the Lambda function that will be subscribing to events. 363 FunctionName pulumi.StringOutput `pulumi:"functionName"` 364 // A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. 365 FunctionResponseTypes pulumi.StringArrayOutput `pulumi:"functionResponseTypes"` 366 // The date this resource was last modified. 367 LastModified pulumi.StringOutput `pulumi:"lastModified"` 368 // The result of the last AWS Lambda invocation of your Lambda function. 369 LastProcessingResult pulumi.StringOutput `pulumi:"lastProcessingResult"` 370 // The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. 371 MaximumBatchingWindowInSeconds pulumi.IntPtrOutput `pulumi:"maximumBatchingWindowInSeconds"` 372 // - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). 373 MaximumRecordAgeInSeconds pulumi.IntOutput `pulumi:"maximumRecordAgeInSeconds"` 374 // - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. 375 MaximumRetryAttempts pulumi.IntOutput `pulumi:"maximumRetryAttempts"` 376 // - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. 377 ParallelizationFactor pulumi.IntOutput `pulumi:"parallelizationFactor"` 378 // The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. 379 Queues pulumi.StringPtrOutput `pulumi:"queues"` 380 // Scaling configuration of the event source. Only available for SQS queues. Detailed below. 381 ScalingConfig EventSourceMappingScalingConfigPtrOutput `pulumi:"scalingConfig"` 382 // - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. 383 SelfManagedEventSource EventSourceMappingSelfManagedEventSourcePtrOutput `pulumi:"selfManagedEventSource"` 384 // Additional configuration block for Self Managed Kafka sources. Incompatible with "eventSourceArn" and "amazonManagedKafkaEventSourceConfig". Detailed below. 385 SelfManagedKafkaEventSourceConfig EventSourceMappingSelfManagedKafkaEventSourceConfigOutput `pulumi:"selfManagedKafkaEventSourceConfig"` 386 // For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. 387 SourceAccessConfigurations EventSourceMappingSourceAccessConfigurationArrayOutput `pulumi:"sourceAccessConfigurations"` 388 // The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). 389 StartingPosition pulumi.StringPtrOutput `pulumi:"startingPosition"` 390 // A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. 391 StartingPositionTimestamp pulumi.StringPtrOutput `pulumi:"startingPositionTimestamp"` 392 // The state of the event source mapping. 393 State pulumi.StringOutput `pulumi:"state"` 394 // The reason the event source mapping is in its current state. 395 StateTransitionReason pulumi.StringOutput `pulumi:"stateTransitionReason"` 396 // The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. 397 Topics pulumi.StringArrayOutput `pulumi:"topics"` 398 // The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). 399 TumblingWindowInSeconds pulumi.IntPtrOutput `pulumi:"tumblingWindowInSeconds"` 400 // The UUID of the created event source mapping. 401 Uuid pulumi.StringOutput `pulumi:"uuid"` 402 } 403 404 // NewEventSourceMapping registers a new resource with the given unique name, arguments, and options. 405 func NewEventSourceMapping(ctx *pulumi.Context, 406 name string, args *EventSourceMappingArgs, opts ...pulumi.ResourceOption) (*EventSourceMapping, error) { 407 if args == nil { 408 return nil, errors.New("missing one or more required arguments") 409 } 410 411 if args.FunctionName == nil { 412 return nil, errors.New("invalid value for required argument 'FunctionName'") 413 } 414 opts = internal.PkgResourceDefaultOpts(opts) 415 var resource EventSourceMapping 416 err := ctx.RegisterResource("aws:lambda/eventSourceMapping:EventSourceMapping", name, args, &resource, opts...) 417 if err != nil { 418 return nil, err 419 } 420 return &resource, nil 421 } 422 423 // GetEventSourceMapping gets an existing EventSourceMapping resource's state with the given name, ID, and optional 424 // state properties that are used to uniquely qualify the lookup (nil if not required). 425 func GetEventSourceMapping(ctx *pulumi.Context, 426 name string, id pulumi.IDInput, state *EventSourceMappingState, opts ...pulumi.ResourceOption) (*EventSourceMapping, error) { 427 var resource EventSourceMapping 428 err := ctx.ReadResource("aws:lambda/eventSourceMapping:EventSourceMapping", name, id, state, &resource, opts...) 429 if err != nil { 430 return nil, err 431 } 432 return &resource, nil 433 } 434 435 // Input properties used for looking up and filtering EventSourceMapping resources. 436 type eventSourceMappingState struct { 437 // Additional configuration block for Amazon Managed Kafka sources. Incompatible with "selfManagedEventSource" and "selfManagedKafkaEventSourceConfig". Detailed below. 438 AmazonManagedKafkaEventSourceConfig *EventSourceMappingAmazonManagedKafkaEventSourceConfig `pulumi:"amazonManagedKafkaEventSourceConfig"` 439 // The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. 440 BatchSize *int `pulumi:"batchSize"` 441 // - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. 442 BisectBatchOnFunctionError *bool `pulumi:"bisectBatchOnFunctionError"` 443 // - (Optional) An Amazon SQS queue, Amazon SNS topic or Amazon S3 bucket (only available for Kafka sources) destination for failed records. Only available for stream sources (DynamoDB and Kinesis) and Kafka sources (Amazon MSK and Self-managed Apache Kafka). Detailed below. 444 DestinationConfig *EventSourceMappingDestinationConfig `pulumi:"destinationConfig"` 445 // - (Optional) Configuration settings for a DocumentDB event source. Detailed below. 446 DocumentDbEventSourceConfig *EventSourceMappingDocumentDbEventSourceConfig `pulumi:"documentDbEventSourceConfig"` 447 // Determines if the mapping will be enabled on creation. Defaults to `true`. 448 Enabled *bool `pulumi:"enabled"` 449 // The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. 450 EventSourceArn *string `pulumi:"eventSourceArn"` 451 // The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. 452 FilterCriteria *EventSourceMappingFilterCriteria `pulumi:"filterCriteria"` 453 // The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from `functionName` above.) 454 FunctionArn *string `pulumi:"functionArn"` 455 // The name or the ARN of the Lambda function that will be subscribing to events. 456 FunctionName *string `pulumi:"functionName"` 457 // A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. 458 FunctionResponseTypes []string `pulumi:"functionResponseTypes"` 459 // The date this resource was last modified. 460 LastModified *string `pulumi:"lastModified"` 461 // The result of the last AWS Lambda invocation of your Lambda function. 462 LastProcessingResult *string `pulumi:"lastProcessingResult"` 463 // The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. 464 MaximumBatchingWindowInSeconds *int `pulumi:"maximumBatchingWindowInSeconds"` 465 // - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). 466 MaximumRecordAgeInSeconds *int `pulumi:"maximumRecordAgeInSeconds"` 467 // - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. 468 MaximumRetryAttempts *int `pulumi:"maximumRetryAttempts"` 469 // - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. 470 ParallelizationFactor *int `pulumi:"parallelizationFactor"` 471 // The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. 472 Queues *string `pulumi:"queues"` 473 // Scaling configuration of the event source. Only available for SQS queues. Detailed below. 474 ScalingConfig *EventSourceMappingScalingConfig `pulumi:"scalingConfig"` 475 // - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. 476 SelfManagedEventSource *EventSourceMappingSelfManagedEventSource `pulumi:"selfManagedEventSource"` 477 // Additional configuration block for Self Managed Kafka sources. Incompatible with "eventSourceArn" and "amazonManagedKafkaEventSourceConfig". Detailed below. 478 SelfManagedKafkaEventSourceConfig *EventSourceMappingSelfManagedKafkaEventSourceConfig `pulumi:"selfManagedKafkaEventSourceConfig"` 479 // For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. 480 SourceAccessConfigurations []EventSourceMappingSourceAccessConfiguration `pulumi:"sourceAccessConfigurations"` 481 // The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). 482 StartingPosition *string `pulumi:"startingPosition"` 483 // A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. 484 StartingPositionTimestamp *string `pulumi:"startingPositionTimestamp"` 485 // The state of the event source mapping. 486 State *string `pulumi:"state"` 487 // The reason the event source mapping is in its current state. 488 StateTransitionReason *string `pulumi:"stateTransitionReason"` 489 // The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. 490 Topics []string `pulumi:"topics"` 491 // The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). 492 TumblingWindowInSeconds *int `pulumi:"tumblingWindowInSeconds"` 493 // The UUID of the created event source mapping. 494 Uuid *string `pulumi:"uuid"` 495 } 496 497 type EventSourceMappingState struct { 498 // Additional configuration block for Amazon Managed Kafka sources. Incompatible with "selfManagedEventSource" and "selfManagedKafkaEventSourceConfig". Detailed below. 499 AmazonManagedKafkaEventSourceConfig EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrInput 500 // The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. 501 BatchSize pulumi.IntPtrInput 502 // - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. 503 BisectBatchOnFunctionError pulumi.BoolPtrInput 504 // - (Optional) An Amazon SQS queue, Amazon SNS topic or Amazon S3 bucket (only available for Kafka sources) destination for failed records. Only available for stream sources (DynamoDB and Kinesis) and Kafka sources (Amazon MSK and Self-managed Apache Kafka). Detailed below. 505 DestinationConfig EventSourceMappingDestinationConfigPtrInput 506 // - (Optional) Configuration settings for a DocumentDB event source. Detailed below. 507 DocumentDbEventSourceConfig EventSourceMappingDocumentDbEventSourceConfigPtrInput 508 // Determines if the mapping will be enabled on creation. Defaults to `true`. 509 Enabled pulumi.BoolPtrInput 510 // The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. 511 EventSourceArn pulumi.StringPtrInput 512 // The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. 513 FilterCriteria EventSourceMappingFilterCriteriaPtrInput 514 // The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from `functionName` above.) 515 FunctionArn pulumi.StringPtrInput 516 // The name or the ARN of the Lambda function that will be subscribing to events. 517 FunctionName pulumi.StringPtrInput 518 // A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. 519 FunctionResponseTypes pulumi.StringArrayInput 520 // The date this resource was last modified. 521 LastModified pulumi.StringPtrInput 522 // The result of the last AWS Lambda invocation of your Lambda function. 523 LastProcessingResult pulumi.StringPtrInput 524 // The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. 525 MaximumBatchingWindowInSeconds pulumi.IntPtrInput 526 // - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). 527 MaximumRecordAgeInSeconds pulumi.IntPtrInput 528 // - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. 529 MaximumRetryAttempts pulumi.IntPtrInput 530 // - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. 531 ParallelizationFactor pulumi.IntPtrInput 532 // The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. 533 Queues pulumi.StringPtrInput 534 // Scaling configuration of the event source. Only available for SQS queues. Detailed below. 535 ScalingConfig EventSourceMappingScalingConfigPtrInput 536 // - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. 537 SelfManagedEventSource EventSourceMappingSelfManagedEventSourcePtrInput 538 // Additional configuration block for Self Managed Kafka sources. Incompatible with "eventSourceArn" and "amazonManagedKafkaEventSourceConfig". Detailed below. 539 SelfManagedKafkaEventSourceConfig EventSourceMappingSelfManagedKafkaEventSourceConfigPtrInput 540 // For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. 541 SourceAccessConfigurations EventSourceMappingSourceAccessConfigurationArrayInput 542 // The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). 543 StartingPosition pulumi.StringPtrInput 544 // A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. 545 StartingPositionTimestamp pulumi.StringPtrInput 546 // The state of the event source mapping. 547 State pulumi.StringPtrInput 548 // The reason the event source mapping is in its current state. 549 StateTransitionReason pulumi.StringPtrInput 550 // The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. 551 Topics pulumi.StringArrayInput 552 // The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). 553 TumblingWindowInSeconds pulumi.IntPtrInput 554 // The UUID of the created event source mapping. 555 Uuid pulumi.StringPtrInput 556 } 557 558 func (EventSourceMappingState) ElementType() reflect.Type { 559 return reflect.TypeOf((*eventSourceMappingState)(nil)).Elem() 560 } 561 562 type eventSourceMappingArgs struct { 563 // Additional configuration block for Amazon Managed Kafka sources. Incompatible with "selfManagedEventSource" and "selfManagedKafkaEventSourceConfig". Detailed below. 564 AmazonManagedKafkaEventSourceConfig *EventSourceMappingAmazonManagedKafkaEventSourceConfig `pulumi:"amazonManagedKafkaEventSourceConfig"` 565 // The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. 566 BatchSize *int `pulumi:"batchSize"` 567 // - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. 568 BisectBatchOnFunctionError *bool `pulumi:"bisectBatchOnFunctionError"` 569 // - (Optional) An Amazon SQS queue, Amazon SNS topic or Amazon S3 bucket (only available for Kafka sources) destination for failed records. Only available for stream sources (DynamoDB and Kinesis) and Kafka sources (Amazon MSK and Self-managed Apache Kafka). Detailed below. 570 DestinationConfig *EventSourceMappingDestinationConfig `pulumi:"destinationConfig"` 571 // - (Optional) Configuration settings for a DocumentDB event source. Detailed below. 572 DocumentDbEventSourceConfig *EventSourceMappingDocumentDbEventSourceConfig `pulumi:"documentDbEventSourceConfig"` 573 // Determines if the mapping will be enabled on creation. Defaults to `true`. 574 Enabled *bool `pulumi:"enabled"` 575 // The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. 576 EventSourceArn *string `pulumi:"eventSourceArn"` 577 // The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. 578 FilterCriteria *EventSourceMappingFilterCriteria `pulumi:"filterCriteria"` 579 // The name or the ARN of the Lambda function that will be subscribing to events. 580 FunctionName string `pulumi:"functionName"` 581 // A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. 582 FunctionResponseTypes []string `pulumi:"functionResponseTypes"` 583 // The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. 584 MaximumBatchingWindowInSeconds *int `pulumi:"maximumBatchingWindowInSeconds"` 585 // - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). 586 MaximumRecordAgeInSeconds *int `pulumi:"maximumRecordAgeInSeconds"` 587 // - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. 588 MaximumRetryAttempts *int `pulumi:"maximumRetryAttempts"` 589 // - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. 590 ParallelizationFactor *int `pulumi:"parallelizationFactor"` 591 // The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. 592 Queues *string `pulumi:"queues"` 593 // Scaling configuration of the event source. Only available for SQS queues. Detailed below. 594 ScalingConfig *EventSourceMappingScalingConfig `pulumi:"scalingConfig"` 595 // - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. 596 SelfManagedEventSource *EventSourceMappingSelfManagedEventSource `pulumi:"selfManagedEventSource"` 597 // Additional configuration block for Self Managed Kafka sources. Incompatible with "eventSourceArn" and "amazonManagedKafkaEventSourceConfig". Detailed below. 598 SelfManagedKafkaEventSourceConfig *EventSourceMappingSelfManagedKafkaEventSourceConfig `pulumi:"selfManagedKafkaEventSourceConfig"` 599 // For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. 600 SourceAccessConfigurations []EventSourceMappingSourceAccessConfiguration `pulumi:"sourceAccessConfigurations"` 601 // The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). 602 StartingPosition *string `pulumi:"startingPosition"` 603 // A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. 604 StartingPositionTimestamp *string `pulumi:"startingPositionTimestamp"` 605 // The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. 606 Topics []string `pulumi:"topics"` 607 // The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). 608 TumblingWindowInSeconds *int `pulumi:"tumblingWindowInSeconds"` 609 } 610 611 // The set of arguments for constructing a EventSourceMapping resource. 612 type EventSourceMappingArgs struct { 613 // Additional configuration block for Amazon Managed Kafka sources. Incompatible with "selfManagedEventSource" and "selfManagedKafkaEventSourceConfig". Detailed below. 614 AmazonManagedKafkaEventSourceConfig EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrInput 615 // The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. 616 BatchSize pulumi.IntPtrInput 617 // - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. 618 BisectBatchOnFunctionError pulumi.BoolPtrInput 619 // - (Optional) An Amazon SQS queue, Amazon SNS topic or Amazon S3 bucket (only available for Kafka sources) destination for failed records. Only available for stream sources (DynamoDB and Kinesis) and Kafka sources (Amazon MSK and Self-managed Apache Kafka). Detailed below. 620 DestinationConfig EventSourceMappingDestinationConfigPtrInput 621 // - (Optional) Configuration settings for a DocumentDB event source. Detailed below. 622 DocumentDbEventSourceConfig EventSourceMappingDocumentDbEventSourceConfigPtrInput 623 // Determines if the mapping will be enabled on creation. Defaults to `true`. 624 Enabled pulumi.BoolPtrInput 625 // The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. 626 EventSourceArn pulumi.StringPtrInput 627 // The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. 628 FilterCriteria EventSourceMappingFilterCriteriaPtrInput 629 // The name or the ARN of the Lambda function that will be subscribing to events. 630 FunctionName pulumi.StringInput 631 // A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. 632 FunctionResponseTypes pulumi.StringArrayInput 633 // The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. 634 MaximumBatchingWindowInSeconds pulumi.IntPtrInput 635 // - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). 636 MaximumRecordAgeInSeconds pulumi.IntPtrInput 637 // - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. 638 MaximumRetryAttempts pulumi.IntPtrInput 639 // - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. 640 ParallelizationFactor pulumi.IntPtrInput 641 // The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. 642 Queues pulumi.StringPtrInput 643 // Scaling configuration of the event source. Only available for SQS queues. Detailed below. 644 ScalingConfig EventSourceMappingScalingConfigPtrInput 645 // - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. 646 SelfManagedEventSource EventSourceMappingSelfManagedEventSourcePtrInput 647 // Additional configuration block for Self Managed Kafka sources. Incompatible with "eventSourceArn" and "amazonManagedKafkaEventSourceConfig". Detailed below. 648 SelfManagedKafkaEventSourceConfig EventSourceMappingSelfManagedKafkaEventSourceConfigPtrInput 649 // For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. 650 SourceAccessConfigurations EventSourceMappingSourceAccessConfigurationArrayInput 651 // The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). 652 StartingPosition pulumi.StringPtrInput 653 // A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. 654 StartingPositionTimestamp pulumi.StringPtrInput 655 // The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. 656 Topics pulumi.StringArrayInput 657 // The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). 658 TumblingWindowInSeconds pulumi.IntPtrInput 659 } 660 661 func (EventSourceMappingArgs) ElementType() reflect.Type { 662 return reflect.TypeOf((*eventSourceMappingArgs)(nil)).Elem() 663 } 664 665 type EventSourceMappingInput interface { 666 pulumi.Input 667 668 ToEventSourceMappingOutput() EventSourceMappingOutput 669 ToEventSourceMappingOutputWithContext(ctx context.Context) EventSourceMappingOutput 670 } 671 672 func (*EventSourceMapping) ElementType() reflect.Type { 673 return reflect.TypeOf((**EventSourceMapping)(nil)).Elem() 674 } 675 676 func (i *EventSourceMapping) ToEventSourceMappingOutput() EventSourceMappingOutput { 677 return i.ToEventSourceMappingOutputWithContext(context.Background()) 678 } 679 680 func (i *EventSourceMapping) ToEventSourceMappingOutputWithContext(ctx context.Context) EventSourceMappingOutput { 681 return pulumi.ToOutputWithContext(ctx, i).(EventSourceMappingOutput) 682 } 683 684 // EventSourceMappingArrayInput is an input type that accepts EventSourceMappingArray and EventSourceMappingArrayOutput values. 685 // You can construct a concrete instance of `EventSourceMappingArrayInput` via: 686 // 687 // EventSourceMappingArray{ EventSourceMappingArgs{...} } 688 type EventSourceMappingArrayInput interface { 689 pulumi.Input 690 691 ToEventSourceMappingArrayOutput() EventSourceMappingArrayOutput 692 ToEventSourceMappingArrayOutputWithContext(context.Context) EventSourceMappingArrayOutput 693 } 694 695 type EventSourceMappingArray []EventSourceMappingInput 696 697 func (EventSourceMappingArray) ElementType() reflect.Type { 698 return reflect.TypeOf((*[]*EventSourceMapping)(nil)).Elem() 699 } 700 701 func (i EventSourceMappingArray) ToEventSourceMappingArrayOutput() EventSourceMappingArrayOutput { 702 return i.ToEventSourceMappingArrayOutputWithContext(context.Background()) 703 } 704 705 func (i EventSourceMappingArray) ToEventSourceMappingArrayOutputWithContext(ctx context.Context) EventSourceMappingArrayOutput { 706 return pulumi.ToOutputWithContext(ctx, i).(EventSourceMappingArrayOutput) 707 } 708 709 // EventSourceMappingMapInput is an input type that accepts EventSourceMappingMap and EventSourceMappingMapOutput values. 710 // You can construct a concrete instance of `EventSourceMappingMapInput` via: 711 // 712 // EventSourceMappingMap{ "key": EventSourceMappingArgs{...} } 713 type EventSourceMappingMapInput interface { 714 pulumi.Input 715 716 ToEventSourceMappingMapOutput() EventSourceMappingMapOutput 717 ToEventSourceMappingMapOutputWithContext(context.Context) EventSourceMappingMapOutput 718 } 719 720 type EventSourceMappingMap map[string]EventSourceMappingInput 721 722 func (EventSourceMappingMap) ElementType() reflect.Type { 723 return reflect.TypeOf((*map[string]*EventSourceMapping)(nil)).Elem() 724 } 725 726 func (i EventSourceMappingMap) ToEventSourceMappingMapOutput() EventSourceMappingMapOutput { 727 return i.ToEventSourceMappingMapOutputWithContext(context.Background()) 728 } 729 730 func (i EventSourceMappingMap) ToEventSourceMappingMapOutputWithContext(ctx context.Context) EventSourceMappingMapOutput { 731 return pulumi.ToOutputWithContext(ctx, i).(EventSourceMappingMapOutput) 732 } 733 734 type EventSourceMappingOutput struct{ *pulumi.OutputState } 735 736 func (EventSourceMappingOutput) ElementType() reflect.Type { 737 return reflect.TypeOf((**EventSourceMapping)(nil)).Elem() 738 } 739 740 func (o EventSourceMappingOutput) ToEventSourceMappingOutput() EventSourceMappingOutput { 741 return o 742 } 743 744 func (o EventSourceMappingOutput) ToEventSourceMappingOutputWithContext(ctx context.Context) EventSourceMappingOutput { 745 return o 746 } 747 748 // Additional configuration block for Amazon Managed Kafka sources. Incompatible with "selfManagedEventSource" and "selfManagedKafkaEventSourceConfig". Detailed below. 749 func (o EventSourceMappingOutput) AmazonManagedKafkaEventSourceConfig() EventSourceMappingAmazonManagedKafkaEventSourceConfigOutput { 750 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingAmazonManagedKafkaEventSourceConfigOutput { 751 return v.AmazonManagedKafkaEventSourceConfig 752 }).(EventSourceMappingAmazonManagedKafkaEventSourceConfigOutput) 753 } 754 755 // The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. 756 func (o EventSourceMappingOutput) BatchSize() pulumi.IntPtrOutput { 757 return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.BatchSize }).(pulumi.IntPtrOutput) 758 } 759 760 // - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. 761 func (o EventSourceMappingOutput) BisectBatchOnFunctionError() pulumi.BoolPtrOutput { 762 return o.ApplyT(func(v *EventSourceMapping) pulumi.BoolPtrOutput { return v.BisectBatchOnFunctionError }).(pulumi.BoolPtrOutput) 763 } 764 765 // - (Optional) An Amazon SQS queue, Amazon SNS topic or Amazon S3 bucket (only available for Kafka sources) destination for failed records. Only available for stream sources (DynamoDB and Kinesis) and Kafka sources (Amazon MSK and Self-managed Apache Kafka). Detailed below. 766 func (o EventSourceMappingOutput) DestinationConfig() EventSourceMappingDestinationConfigPtrOutput { 767 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingDestinationConfigPtrOutput { return v.DestinationConfig }).(EventSourceMappingDestinationConfigPtrOutput) 768 } 769 770 // - (Optional) Configuration settings for a DocumentDB event source. Detailed below. 771 func (o EventSourceMappingOutput) DocumentDbEventSourceConfig() EventSourceMappingDocumentDbEventSourceConfigPtrOutput { 772 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingDocumentDbEventSourceConfigPtrOutput { 773 return v.DocumentDbEventSourceConfig 774 }).(EventSourceMappingDocumentDbEventSourceConfigPtrOutput) 775 } 776 777 // Determines if the mapping will be enabled on creation. Defaults to `true`. 778 func (o EventSourceMappingOutput) Enabled() pulumi.BoolPtrOutput { 779 return o.ApplyT(func(v *EventSourceMapping) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput) 780 } 781 782 // The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. 783 func (o EventSourceMappingOutput) EventSourceArn() pulumi.StringPtrOutput { 784 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringPtrOutput { return v.EventSourceArn }).(pulumi.StringPtrOutput) 785 } 786 787 // The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. 788 func (o EventSourceMappingOutput) FilterCriteria() EventSourceMappingFilterCriteriaPtrOutput { 789 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingFilterCriteriaPtrOutput { return v.FilterCriteria }).(EventSourceMappingFilterCriteriaPtrOutput) 790 } 791 792 // The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from `functionName` above.) 793 func (o EventSourceMappingOutput) FunctionArn() pulumi.StringOutput { 794 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.FunctionArn }).(pulumi.StringOutput) 795 } 796 797 // The name or the ARN of the Lambda function that will be subscribing to events. 798 func (o EventSourceMappingOutput) FunctionName() pulumi.StringOutput { 799 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.FunctionName }).(pulumi.StringOutput) 800 } 801 802 // A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. 803 func (o EventSourceMappingOutput) FunctionResponseTypes() pulumi.StringArrayOutput { 804 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringArrayOutput { return v.FunctionResponseTypes }).(pulumi.StringArrayOutput) 805 } 806 807 // The date this resource was last modified. 808 func (o EventSourceMappingOutput) LastModified() pulumi.StringOutput { 809 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.LastModified }).(pulumi.StringOutput) 810 } 811 812 // The result of the last AWS Lambda invocation of your Lambda function. 813 func (o EventSourceMappingOutput) LastProcessingResult() pulumi.StringOutput { 814 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.LastProcessingResult }).(pulumi.StringOutput) 815 } 816 817 // The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. 818 func (o EventSourceMappingOutput) MaximumBatchingWindowInSeconds() pulumi.IntPtrOutput { 819 return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.MaximumBatchingWindowInSeconds }).(pulumi.IntPtrOutput) 820 } 821 822 // - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). 823 func (o EventSourceMappingOutput) MaximumRecordAgeInSeconds() pulumi.IntOutput { 824 return o.ApplyT(func(v *EventSourceMapping) pulumi.IntOutput { return v.MaximumRecordAgeInSeconds }).(pulumi.IntOutput) 825 } 826 827 // - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. 828 func (o EventSourceMappingOutput) MaximumRetryAttempts() pulumi.IntOutput { 829 return o.ApplyT(func(v *EventSourceMapping) pulumi.IntOutput { return v.MaximumRetryAttempts }).(pulumi.IntOutput) 830 } 831 832 // - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. 833 func (o EventSourceMappingOutput) ParallelizationFactor() pulumi.IntOutput { 834 return o.ApplyT(func(v *EventSourceMapping) pulumi.IntOutput { return v.ParallelizationFactor }).(pulumi.IntOutput) 835 } 836 837 // The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. The list must contain exactly one queue name. 838 func (o EventSourceMappingOutput) Queues() pulumi.StringPtrOutput { 839 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringPtrOutput { return v.Queues }).(pulumi.StringPtrOutput) 840 } 841 842 // Scaling configuration of the event source. Only available for SQS queues. Detailed below. 843 func (o EventSourceMappingOutput) ScalingConfig() EventSourceMappingScalingConfigPtrOutput { 844 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingScalingConfigPtrOutput { return v.ScalingConfig }).(EventSourceMappingScalingConfigPtrOutput) 845 } 846 847 // - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. 848 func (o EventSourceMappingOutput) SelfManagedEventSource() EventSourceMappingSelfManagedEventSourcePtrOutput { 849 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingSelfManagedEventSourcePtrOutput { 850 return v.SelfManagedEventSource 851 }).(EventSourceMappingSelfManagedEventSourcePtrOutput) 852 } 853 854 // Additional configuration block for Self Managed Kafka sources. Incompatible with "eventSourceArn" and "amazonManagedKafkaEventSourceConfig". Detailed below. 855 func (o EventSourceMappingOutput) SelfManagedKafkaEventSourceConfig() EventSourceMappingSelfManagedKafkaEventSourceConfigOutput { 856 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingSelfManagedKafkaEventSourceConfigOutput { 857 return v.SelfManagedKafkaEventSourceConfig 858 }).(EventSourceMappingSelfManagedKafkaEventSourceConfigOutput) 859 } 860 861 // For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. 862 func (o EventSourceMappingOutput) SourceAccessConfigurations() EventSourceMappingSourceAccessConfigurationArrayOutput { 863 return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingSourceAccessConfigurationArrayOutput { 864 return v.SourceAccessConfigurations 865 }).(EventSourceMappingSourceAccessConfigurationArrayOutput) 866 } 867 868 // The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). 869 func (o EventSourceMappingOutput) StartingPosition() pulumi.StringPtrOutput { 870 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringPtrOutput { return v.StartingPosition }).(pulumi.StringPtrOutput) 871 } 872 873 // A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. 874 func (o EventSourceMappingOutput) StartingPositionTimestamp() pulumi.StringPtrOutput { 875 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringPtrOutput { return v.StartingPositionTimestamp }).(pulumi.StringPtrOutput) 876 } 877 878 // The state of the event source mapping. 879 func (o EventSourceMappingOutput) State() pulumi.StringOutput { 880 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.State }).(pulumi.StringOutput) 881 } 882 883 // The reason the event source mapping is in its current state. 884 func (o EventSourceMappingOutput) StateTransitionReason() pulumi.StringOutput { 885 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.StateTransitionReason }).(pulumi.StringOutput) 886 } 887 888 // The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. 889 func (o EventSourceMappingOutput) Topics() pulumi.StringArrayOutput { 890 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringArrayOutput { return v.Topics }).(pulumi.StringArrayOutput) 891 } 892 893 // The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). 894 func (o EventSourceMappingOutput) TumblingWindowInSeconds() pulumi.IntPtrOutput { 895 return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.TumblingWindowInSeconds }).(pulumi.IntPtrOutput) 896 } 897 898 // The UUID of the created event source mapping. 899 func (o EventSourceMappingOutput) Uuid() pulumi.StringOutput { 900 return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.Uuid }).(pulumi.StringOutput) 901 } 902 903 type EventSourceMappingArrayOutput struct{ *pulumi.OutputState } 904 905 func (EventSourceMappingArrayOutput) ElementType() reflect.Type { 906 return reflect.TypeOf((*[]*EventSourceMapping)(nil)).Elem() 907 } 908 909 func (o EventSourceMappingArrayOutput) ToEventSourceMappingArrayOutput() EventSourceMappingArrayOutput { 910 return o 911 } 912 913 func (o EventSourceMappingArrayOutput) ToEventSourceMappingArrayOutputWithContext(ctx context.Context) EventSourceMappingArrayOutput { 914 return o 915 } 916 917 func (o EventSourceMappingArrayOutput) Index(i pulumi.IntInput) EventSourceMappingOutput { 918 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EventSourceMapping { 919 return vs[0].([]*EventSourceMapping)[vs[1].(int)] 920 }).(EventSourceMappingOutput) 921 } 922 923 type EventSourceMappingMapOutput struct{ *pulumi.OutputState } 924 925 func (EventSourceMappingMapOutput) ElementType() reflect.Type { 926 return reflect.TypeOf((*map[string]*EventSourceMapping)(nil)).Elem() 927 } 928 929 func (o EventSourceMappingMapOutput) ToEventSourceMappingMapOutput() EventSourceMappingMapOutput { 930 return o 931 } 932 933 func (o EventSourceMappingMapOutput) ToEventSourceMappingMapOutputWithContext(ctx context.Context) EventSourceMappingMapOutput { 934 return o 935 } 936 937 func (o EventSourceMappingMapOutput) MapIndex(k pulumi.StringInput) EventSourceMappingOutput { 938 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EventSourceMapping { 939 return vs[0].(map[string]*EventSourceMapping)[vs[1].(string)] 940 }).(EventSourceMappingOutput) 941 } 942 943 func init() { 944 pulumi.RegisterInputType(reflect.TypeOf((*EventSourceMappingInput)(nil)).Elem(), &EventSourceMapping{}) 945 pulumi.RegisterInputType(reflect.TypeOf((*EventSourceMappingArrayInput)(nil)).Elem(), EventSourceMappingArray{}) 946 pulumi.RegisterInputType(reflect.TypeOf((*EventSourceMappingMapInput)(nil)).Elem(), EventSourceMappingMap{}) 947 pulumi.RegisterOutputType(EventSourceMappingOutput{}) 948 pulumi.RegisterOutputType(EventSourceMappingArrayOutput{}) 949 pulumi.RegisterOutputType(EventSourceMappingMapOutput{}) 950 }