-
Notifications
You must be signed in to change notification settings - Fork 17
/
eventSourceMapping.go
519 lines (471 loc) · 36.4 KB
/
eventSourceMapping.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package lambda
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The “AWS::Lambda::EventSourceMapping“ resource creates a mapping between an event source and an LAMlong function. LAM 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.
// + [Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping)
// + [Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping)
// + [Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource)
// + [Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping)
// + [Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)
// + [Configuring Self-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html)
// + [Configuring Amazon DocumentDB as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)
type EventSourceMapping struct {
pulumi.CustomResourceState
// Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
AmazonManagedKafkaEventSourceConfig EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrOutput `pulumi:"amazonManagedKafkaEventSourceConfig"`
AwsId pulumi.StringOutput `pulumi:"awsId"`
// The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. 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.
BatchSize pulumi.IntPtrOutput `pulumi:"batchSize"`
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
BisectBatchOnFunctionError pulumi.BoolPtrOutput `pulumi:"bisectBatchOnFunctionError"`
// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
DestinationConfig EventSourceMappingDestinationConfigPtrOutput `pulumi:"destinationConfig"`
// Specific configuration settings for a DocumentDB event source.
DocumentDbEventSourceConfig EventSourceMappingDocumentDbEventSourceConfigPtrOutput `pulumi:"documentDbEventSourceConfig"`
// When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
// Default: True
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// The Amazon Resource Name (ARN) of the event source.
// + *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](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
// + *Amazon MQ* – The ARN of the broker.
// + *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
EventSourceArn pulumi.StringPtrOutput `pulumi:"eventSourceArn"`
// An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
FilterCriteria EventSourceMappingFilterCriteriaPtrOutput `pulumi:"filterCriteria"`
// The name or ARN of the Lambda function.
// **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.
FunctionName pulumi.StringOutput `pulumi:"functionName"`
// (Streams and SQS) A list of current response type enums applied to the event source mapping.
// Valid Values: ``ReportBatchItemFailures``
FunctionResponseTypes EventSourceMappingFunctionResponseTypesItemArrayOutput `pulumi:"functionResponseTypes"`
// The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
// *Default (, , event sources)*: 0
// *Default (, Kafka, , event sources)*: 500 ms
// *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
MaximumBatchingWindowInSeconds pulumi.IntPtrOutput `pulumi:"maximumBatchingWindowInSeconds"`
// (Kinesis and DynamoDB Streams only) Discard records older than the specified age. 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
MaximumRecordAgeInSeconds pulumi.IntPtrOutput `pulumi:"maximumRecordAgeInSeconds"`
// (Kinesis and DynamoDB Streams only) 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.
MaximumRetryAttempts pulumi.IntPtrOutput `pulumi:"maximumRetryAttempts"`
// (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
ParallelizationFactor pulumi.IntPtrOutput `pulumi:"parallelizationFactor"`
// (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
Queues pulumi.StringArrayOutput `pulumi:"queues"`
// (Amazon SQS only) The scaling configuration for the event source. For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
ScalingConfig EventSourceMappingScalingConfigPtrOutput `pulumi:"scalingConfig"`
// The self-managed Apache Kafka cluster for your event source.
SelfManagedEventSource EventSourceMappingSelfManagedEventSourcePtrOutput `pulumi:"selfManagedEventSource"`
// Specific configuration settings for a self-managed Apache Kafka event source.
SelfManagedKafkaEventSourceConfig EventSourceMappingSelfManagedKafkaEventSourceConfigPtrOutput `pulumi:"selfManagedKafkaEventSourceConfig"`
// An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
SourceAccessConfigurations EventSourceMappingSourceAccessConfigurationArrayOutput `pulumi:"sourceAccessConfigurations"`
// 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.
StartingPosition pulumi.StringPtrOutput `pulumi:"startingPosition"`
// With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.
StartingPositionTimestamp pulumi.Float64PtrOutput `pulumi:"startingPositionTimestamp"`
// The name of the Kafka topic.
Topics pulumi.StringArrayOutput `pulumi:"topics"`
// (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.
TumblingWindowInSeconds pulumi.IntPtrOutput `pulumi:"tumblingWindowInSeconds"`
}
// NewEventSourceMapping registers a new resource with the given unique name, arguments, and options.
func NewEventSourceMapping(ctx *pulumi.Context,
name string, args *EventSourceMappingArgs, opts ...pulumi.ResourceOption) (*EventSourceMapping, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FunctionName == nil {
return nil, errors.New("invalid value for required argument 'FunctionName'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"amazonManagedKafkaEventSourceConfig",
"eventSourceArn",
"selfManagedEventSource",
"selfManagedKafkaEventSourceConfig",
"startingPosition",
"startingPositionTimestamp",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource EventSourceMapping
err := ctx.RegisterResource("aws-native:lambda:EventSourceMapping", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEventSourceMapping gets an existing EventSourceMapping resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEventSourceMapping(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EventSourceMappingState, opts ...pulumi.ResourceOption) (*EventSourceMapping, error) {
var resource EventSourceMapping
err := ctx.ReadResource("aws-native:lambda:EventSourceMapping", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EventSourceMapping resources.
type eventSourceMappingState struct {
}
type EventSourceMappingState struct {
}
func (EventSourceMappingState) ElementType() reflect.Type {
return reflect.TypeOf((*eventSourceMappingState)(nil)).Elem()
}
type eventSourceMappingArgs struct {
// Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
AmazonManagedKafkaEventSourceConfig *EventSourceMappingAmazonManagedKafkaEventSourceConfig `pulumi:"amazonManagedKafkaEventSourceConfig"`
// The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. 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.
BatchSize *int `pulumi:"batchSize"`
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
BisectBatchOnFunctionError *bool `pulumi:"bisectBatchOnFunctionError"`
// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
DestinationConfig *EventSourceMappingDestinationConfig `pulumi:"destinationConfig"`
// Specific configuration settings for a DocumentDB event source.
DocumentDbEventSourceConfig *EventSourceMappingDocumentDbEventSourceConfig `pulumi:"documentDbEventSourceConfig"`
// When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
// Default: True
Enabled *bool `pulumi:"enabled"`
// The Amazon Resource Name (ARN) of the event source.
// + *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](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
// + *Amazon MQ* – The ARN of the broker.
// + *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
EventSourceArn *string `pulumi:"eventSourceArn"`
// An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
FilterCriteria *EventSourceMappingFilterCriteria `pulumi:"filterCriteria"`
// The name or ARN of the Lambda function.
// **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.
FunctionName string `pulumi:"functionName"`
// (Streams and SQS) A list of current response type enums applied to the event source mapping.
// Valid Values: ``ReportBatchItemFailures``
FunctionResponseTypes []EventSourceMappingFunctionResponseTypesItem `pulumi:"functionResponseTypes"`
// The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
// *Default (, , event sources)*: 0
// *Default (, Kafka, , event sources)*: 500 ms
// *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
MaximumBatchingWindowInSeconds *int `pulumi:"maximumBatchingWindowInSeconds"`
// (Kinesis and DynamoDB Streams only) Discard records older than the specified age. 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
MaximumRecordAgeInSeconds *int `pulumi:"maximumRecordAgeInSeconds"`
// (Kinesis and DynamoDB Streams only) 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.
MaximumRetryAttempts *int `pulumi:"maximumRetryAttempts"`
// (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
ParallelizationFactor *int `pulumi:"parallelizationFactor"`
// (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
Queues []string `pulumi:"queues"`
// (Amazon SQS only) The scaling configuration for the event source. For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
ScalingConfig *EventSourceMappingScalingConfig `pulumi:"scalingConfig"`
// The self-managed Apache Kafka cluster for your event source.
SelfManagedEventSource *EventSourceMappingSelfManagedEventSource `pulumi:"selfManagedEventSource"`
// Specific configuration settings for a self-managed Apache Kafka event source.
SelfManagedKafkaEventSourceConfig *EventSourceMappingSelfManagedKafkaEventSourceConfig `pulumi:"selfManagedKafkaEventSourceConfig"`
// An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
SourceAccessConfigurations []EventSourceMappingSourceAccessConfiguration `pulumi:"sourceAccessConfigurations"`
// 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.
StartingPosition *string `pulumi:"startingPosition"`
// With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.
StartingPositionTimestamp *float64 `pulumi:"startingPositionTimestamp"`
// The name of the Kafka topic.
Topics []string `pulumi:"topics"`
// (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.
TumblingWindowInSeconds *int `pulumi:"tumblingWindowInSeconds"`
}
// The set of arguments for constructing a EventSourceMapping resource.
type EventSourceMappingArgs struct {
// Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
AmazonManagedKafkaEventSourceConfig EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrInput
// The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. 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.
BatchSize pulumi.IntPtrInput
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
BisectBatchOnFunctionError pulumi.BoolPtrInput
// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
DestinationConfig EventSourceMappingDestinationConfigPtrInput
// Specific configuration settings for a DocumentDB event source.
DocumentDbEventSourceConfig EventSourceMappingDocumentDbEventSourceConfigPtrInput
// When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
// Default: True
Enabled pulumi.BoolPtrInput
// The Amazon Resource Name (ARN) of the event source.
// + *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](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
// + *Amazon MQ* – The ARN of the broker.
// + *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
EventSourceArn pulumi.StringPtrInput
// An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
FilterCriteria EventSourceMappingFilterCriteriaPtrInput
// The name or ARN of the Lambda function.
// **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.
FunctionName pulumi.StringInput
// (Streams and SQS) A list of current response type enums applied to the event source mapping.
// Valid Values: ``ReportBatchItemFailures``
FunctionResponseTypes EventSourceMappingFunctionResponseTypesItemArrayInput
// The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
// *Default (, , event sources)*: 0
// *Default (, Kafka, , event sources)*: 500 ms
// *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
MaximumBatchingWindowInSeconds pulumi.IntPtrInput
// (Kinesis and DynamoDB Streams only) Discard records older than the specified age. 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
MaximumRecordAgeInSeconds pulumi.IntPtrInput
// (Kinesis and DynamoDB Streams only) 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.
MaximumRetryAttempts pulumi.IntPtrInput
// (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
ParallelizationFactor pulumi.IntPtrInput
// (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
Queues pulumi.StringArrayInput
// (Amazon SQS only) The scaling configuration for the event source. For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
ScalingConfig EventSourceMappingScalingConfigPtrInput
// The self-managed Apache Kafka cluster for your event source.
SelfManagedEventSource EventSourceMappingSelfManagedEventSourcePtrInput
// Specific configuration settings for a self-managed Apache Kafka event source.
SelfManagedKafkaEventSourceConfig EventSourceMappingSelfManagedKafkaEventSourceConfigPtrInput
// An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
SourceAccessConfigurations EventSourceMappingSourceAccessConfigurationArrayInput
// 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.
StartingPosition pulumi.StringPtrInput
// With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.
StartingPositionTimestamp pulumi.Float64PtrInput
// The name of the Kafka topic.
Topics pulumi.StringArrayInput
// (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.
TumblingWindowInSeconds pulumi.IntPtrInput
}
func (EventSourceMappingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*eventSourceMappingArgs)(nil)).Elem()
}
type EventSourceMappingInput interface {
pulumi.Input
ToEventSourceMappingOutput() EventSourceMappingOutput
ToEventSourceMappingOutputWithContext(ctx context.Context) EventSourceMappingOutput
}
func (*EventSourceMapping) ElementType() reflect.Type {
return reflect.TypeOf((**EventSourceMapping)(nil)).Elem()
}
func (i *EventSourceMapping) ToEventSourceMappingOutput() EventSourceMappingOutput {
return i.ToEventSourceMappingOutputWithContext(context.Background())
}
func (i *EventSourceMapping) ToEventSourceMappingOutputWithContext(ctx context.Context) EventSourceMappingOutput {
return pulumi.ToOutputWithContext(ctx, i).(EventSourceMappingOutput)
}
type EventSourceMappingOutput struct{ *pulumi.OutputState }
func (EventSourceMappingOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EventSourceMapping)(nil)).Elem()
}
func (o EventSourceMappingOutput) ToEventSourceMappingOutput() EventSourceMappingOutput {
return o
}
func (o EventSourceMappingOutput) ToEventSourceMappingOutputWithContext(ctx context.Context) EventSourceMappingOutput {
return o
}
// Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
func (o EventSourceMappingOutput) AmazonManagedKafkaEventSourceConfig() EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrOutput {
return v.AmazonManagedKafkaEventSourceConfig
}).(EventSourceMappingAmazonManagedKafkaEventSourceConfigPtrOutput)
}
func (o EventSourceMappingOutput) AwsId() pulumi.StringOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.AwsId }).(pulumi.StringOutput)
}
// The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. 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.
func (o EventSourceMappingOutput) BatchSize() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.BatchSize }).(pulumi.IntPtrOutput)
}
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
func (o EventSourceMappingOutput) BisectBatchOnFunctionError() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.BoolPtrOutput { return v.BisectBatchOnFunctionError }).(pulumi.BoolPtrOutput)
}
// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
func (o EventSourceMappingOutput) DestinationConfig() EventSourceMappingDestinationConfigPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingDestinationConfigPtrOutput { return v.DestinationConfig }).(EventSourceMappingDestinationConfigPtrOutput)
}
// Specific configuration settings for a DocumentDB event source.
func (o EventSourceMappingOutput) DocumentDbEventSourceConfig() EventSourceMappingDocumentDbEventSourceConfigPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingDocumentDbEventSourceConfigPtrOutput {
return v.DocumentDbEventSourceConfig
}).(EventSourceMappingDocumentDbEventSourceConfigPtrOutput)
}
// When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
//
// Default: True
func (o EventSourceMappingOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// The Amazon Resource Name (ARN) of the event source.
// - *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](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
// - *Amazon MQ* – The ARN of the broker.
// - *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
func (o EventSourceMappingOutput) EventSourceArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.StringPtrOutput { return v.EventSourceArn }).(pulumi.StringPtrOutput)
}
// An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
func (o EventSourceMappingOutput) FilterCriteria() EventSourceMappingFilterCriteriaPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingFilterCriteriaPtrOutput { return v.FilterCriteria }).(EventSourceMappingFilterCriteriaPtrOutput)
}
// The name or ARN of the Lambda function.
//
// **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.
func (o EventSourceMappingOutput) FunctionName() pulumi.StringOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.StringOutput { return v.FunctionName }).(pulumi.StringOutput)
}
// (Streams and SQS) A list of current response type enums applied to the event source mapping.
//
// Valid Values: ``ReportBatchItemFailures``
func (o EventSourceMappingOutput) FunctionResponseTypes() EventSourceMappingFunctionResponseTypesItemArrayOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingFunctionResponseTypesItemArrayOutput {
return v.FunctionResponseTypes
}).(EventSourceMappingFunctionResponseTypesItemArrayOutput)
}
// The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
//
// *Default (, , event sources)*: 0
// *Default (, Kafka, , event sources)*: 500 ms
// *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
func (o EventSourceMappingOutput) MaximumBatchingWindowInSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.MaximumBatchingWindowInSeconds }).(pulumi.IntPtrOutput)
}
// (Kinesis and DynamoDB Streams only) Discard records older than the specified age. 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
func (o EventSourceMappingOutput) MaximumRecordAgeInSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.MaximumRecordAgeInSeconds }).(pulumi.IntPtrOutput)
}
// (Kinesis and DynamoDB Streams only) 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.
func (o EventSourceMappingOutput) MaximumRetryAttempts() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.MaximumRetryAttempts }).(pulumi.IntPtrOutput)
}
// (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
func (o EventSourceMappingOutput) ParallelizationFactor() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.ParallelizationFactor }).(pulumi.IntPtrOutput)
}
// (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
func (o EventSourceMappingOutput) Queues() pulumi.StringArrayOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.StringArrayOutput { return v.Queues }).(pulumi.StringArrayOutput)
}
// (Amazon SQS only) The scaling configuration for the event source. For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
func (o EventSourceMappingOutput) ScalingConfig() EventSourceMappingScalingConfigPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingScalingConfigPtrOutput { return v.ScalingConfig }).(EventSourceMappingScalingConfigPtrOutput)
}
// The self-managed Apache Kafka cluster for your event source.
func (o EventSourceMappingOutput) SelfManagedEventSource() EventSourceMappingSelfManagedEventSourcePtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingSelfManagedEventSourcePtrOutput {
return v.SelfManagedEventSource
}).(EventSourceMappingSelfManagedEventSourcePtrOutput)
}
// Specific configuration settings for a self-managed Apache Kafka event source.
func (o EventSourceMappingOutput) SelfManagedKafkaEventSourceConfig() EventSourceMappingSelfManagedKafkaEventSourceConfigPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingSelfManagedKafkaEventSourceConfigPtrOutput {
return v.SelfManagedKafkaEventSourceConfig
}).(EventSourceMappingSelfManagedKafkaEventSourceConfigPtrOutput)
}
// An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
func (o EventSourceMappingOutput) SourceAccessConfigurations() EventSourceMappingSourceAccessConfigurationArrayOutput {
return o.ApplyT(func(v *EventSourceMapping) EventSourceMappingSourceAccessConfigurationArrayOutput {
return v.SourceAccessConfigurations
}).(EventSourceMappingSourceAccessConfigurationArrayOutput)
}
// 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.
func (o EventSourceMappingOutput) StartingPosition() pulumi.StringPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.StringPtrOutput { return v.StartingPosition }).(pulumi.StringPtrOutput)
}
// With “StartingPosition“ set to “AT_TIMESTAMP“, the time from which to start reading, in Unix time seconds. “StartingPositionTimestamp“ cannot be in the future.
func (o EventSourceMappingOutput) StartingPositionTimestamp() pulumi.Float64PtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.Float64PtrOutput { return v.StartingPositionTimestamp }).(pulumi.Float64PtrOutput)
}
// The name of the Kafka topic.
func (o EventSourceMappingOutput) Topics() pulumi.StringArrayOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.StringArrayOutput { return v.Topics }).(pulumi.StringArrayOutput)
}
// (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.
func (o EventSourceMappingOutput) TumblingWindowInSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventSourceMapping) pulumi.IntPtrOutput { return v.TumblingWindowInSeconds }).(pulumi.IntPtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EventSourceMappingInput)(nil)).Elem(), &EventSourceMapping{})
pulumi.RegisterOutputType(EventSourceMappingOutput{})
}