generated from hashicorp/terraform-provider-scaffolding
/
event_source_mapping_singular_data_source_gen.go
652 lines (639 loc) · 39.5 KB
/
event_source_mapping_singular_data_source_gen.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
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package lambda
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_lambda_event_source_mapping", eventSourceMappingDataSource)
}
// eventSourceMappingDataSource returns the Terraform awscc_lambda_event_source_mapping data source.
// This Terraform data source corresponds to the CloudFormation AWS::Lambda::EventSourceMapping resource.
func eventSourceMappingDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AmazonManagedKafkaEventSourceConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.",
// "properties": {
// "ConsumerGroupId": {
// "description": "The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id).",
// "maxLength": 200,
// "minLength": 1,
// "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
// "type": "string"
// }
// },
// "type": "object"
// }
"amazon_managed_kafka_event_source_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ConsumerGroupId
"consumer_group_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id).",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: BatchSize
// CloudFormation resource type schema:
//
// {
// "description": "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).\n + *Amazon Kinesis* ? Default 100. Max 10,000.\n + *Amazon DynamoDB Streams* ? Default 100. Max 10,000.\n + *Amazon Simple Queue Service* ? Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.\n + *Amazon Managed Streaming for Apache Kafka* ? Default 100. Max 10,000.\n + *Self-managed Apache Kafka* ? Default 100. Max 10,000.\n + *Amazon MQ (ActiveMQ and RabbitMQ)* ? Default 100. Max 10,000.\n + *DocumentDB* ? Default 100. Max 10,000.",
// "maximum": 10000,
// "minimum": 1,
// "type": "integer"
// }
"batch_size": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "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).\n + *Amazon Kinesis* ? Default 100. Max 10,000.\n + *Amazon DynamoDB Streams* ? Default 100. Max 10,000.\n + *Amazon Simple Queue Service* ? Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.\n + *Amazon Managed Streaming for Apache Kafka* ? Default 100. Max 10,000.\n + *Self-managed Apache Kafka* ? Default 100. Max 10,000.\n + *Amazon MQ (ActiveMQ and RabbitMQ)* ? Default 100. Max 10,000.\n + *DocumentDB* ? Default 100. Max 10,000.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: BisectBatchOnFunctionError
// CloudFormation resource type schema:
//
// {
// "description": "(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.",
// "type": "boolean"
// }
"bisect_batch_on_function_error": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DestinationConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "(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.",
// "properties": {
// "OnFailure": {
// "additionalProperties": false,
// "description": "The destination configuration for failed invocations.",
// "properties": {
// "Destination": {
// "description": "The Amazon Resource Name (ARN) of the destination resource.\n To retain records of [asynchronous invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations), you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.\n To retain records of failed invocations from [Kinesis and DynamoDB event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#event-source-mapping-destinations), you can configure an Amazon SNS topic or Amazon SQS queue as the destination.\n To retain records of failed invocations from [self-managed Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-smaa-onfailure-destination) or [Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-onfailure-destination), you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.",
// "maxLength": 1024,
// "minLength": 12,
// "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?(-iso)?(-isob)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
// "type": "string"
// }
// },
// "type": "object"
// }
// },
// "type": "object"
// }
"destination_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: OnFailure
"on_failure": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Destination
"destination": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the destination resource.\n To retain records of [asynchronous invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations), you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.\n To retain records of failed invocations from [Kinesis and DynamoDB event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#event-source-mapping-destinations), you can configure an Amazon SNS topic or Amazon SQS queue as the destination.\n To retain records of failed invocations from [self-managed Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-smaa-onfailure-destination) or [Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-onfailure-destination), you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The destination configuration for failed invocations.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "(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.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DocumentDBEventSourceConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Specific configuration settings for a DocumentDB event source.",
// "properties": {
// "CollectionName": {
// "description": "The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.",
// "maxLength": 57,
// "minLength": 1,
// "type": "string"
// },
// "DatabaseName": {
// "description": "The name of the database to consume within the DocumentDB cluster.",
// "maxLength": 63,
// "minLength": 1,
// "type": "string"
// },
// "FullDocument": {
// "description": "Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.",
// "enum": [
// "UpdateLookup",
// "Default"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"document_db_event_source_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: CollectionName
"collection_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DatabaseName
"database_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the database to consume within the DocumentDB cluster.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FullDocument
"full_document": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Specific configuration settings for a DocumentDB event source.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Enabled
// CloudFormation resource type schema:
//
// {
// "description": "When true, the event source mapping is active. When false, Lambda pauses polling and invocation.\n Default: True",
// "type": "boolean"
// }
"enabled": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "When true, the event source mapping is active. When false, Lambda pauses polling and invocation.\n Default: True",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: EventSourceArn
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of the event source.\n + *Amazon Kinesis* ? The ARN of the data stream or a stream consumer.\n + *Amazon DynamoDB Streams* ? The ARN of the stream.\n + *Amazon Simple Queue Service* ? The ARN of the queue.\n + *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)).\n + *Amazon MQ* ? The ARN of the broker.\n + *Amazon DocumentDB* ? The ARN of the DocumentDB change stream.",
// "maxLength": 1024,
// "minLength": 12,
// "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?(-iso)?(-isob)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)",
// "type": "string"
// }
"event_source_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the event source.\n + *Amazon Kinesis* ? The ARN of the data stream or a stream consumer.\n + *Amazon DynamoDB Streams* ? The ARN of the stream.\n + *Amazon Simple Queue Service* ? The ARN of the queue.\n + *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)).\n + *Amazon MQ* ? The ARN of the broker.\n + *Amazon DocumentDB* ? The ARN of the DocumentDB change stream.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FilterCriteria
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "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).",
// "properties": {
// "Filters": {
// "description": "A list of filters.",
// "items": {
// "additionalProperties": false,
// "description": "A structure within a ``FilterCriteria`` object that defines an event filtering pattern.",
// "properties": {
// "Pattern": {
// "description": "A filter pattern. For more information on the syntax of a filter pattern, see [Filter rule syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax).",
// "maxLength": 4096,
// "minLength": 0,
// "pattern": ".*",
// "type": "string"
// }
// },
// "type": "object"
// },
// "maxItems": 20,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
// },
// "type": "object"
// }
"filter_criteria": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Filters
"filters": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Pattern
"pattern": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "A filter pattern. For more information on the syntax of a filter pattern, see [Filter rule syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax).",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "A list of filters.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "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).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FunctionName
// CloudFormation resource type schema:
//
// {
// "description": "The name or ARN of the Lambda function.\n **Name formats**\n + *Function name* ? ``MyFunction``.\n + *Function ARN* ? ``arn:aws:lambda:us-west-2:123456789012:function:MyFunction``.\n + *Version or Alias ARN* ? ``arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD``.\n + *Partial ARN* ? ``123456789012:function:MyFunction``.\n \n The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.",
// "maxLength": 140,
// "minLength": 1,
// "pattern": "(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?(-iso)?(-isob)?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?",
// "type": "string"
// }
"function_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name or ARN of the Lambda function.\n **Name formats**\n + *Function name* ? ``MyFunction``.\n + *Function ARN* ? ``arn:aws:lambda:us-west-2:123456789012:function:MyFunction``.\n + *Version or Alias ARN* ? ``arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD``.\n + *Partial ARN* ? ``123456789012:function:MyFunction``.\n \n The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FunctionResponseTypes
// CloudFormation resource type schema:
//
// {
// "description": "(Streams and SQS) A list of current response type enums applied to the event source mapping.\n Valid Values: ``ReportBatchItemFailures``",
// "items": {
// "enum": [
// "ReportBatchItemFailures"
// ],
// "type": "string"
// },
// "maxLength": 1,
// "minLength": 0,
// "type": "array",
// "uniqueItems": true
// }
"function_response_types": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "(Streams and SQS) A list of current response type enums applied to the event source mapping.\n Valid Values: ``ReportBatchItemFailures``",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Id
// CloudFormation resource type schema:
//
// {
// "description": "",
// "maxLength": 36,
// "minLength": 36,
// "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}",
// "type": "string"
// }
"event_source_mapping_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaximumBatchingWindowInSeconds
// CloudFormation resource type schema:
//
// {
// "description": "The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.\n *Default (, , event sources)*: 0\n *Default (, Kafka, , event sources)*: 500 ms\n *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.",
// "maximum": 300,
// "minimum": 0,
// "type": "integer"
// }
"maximum_batching_window_in_seconds": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.\n *Default (, , event sources)*: 0\n *Default (, Kafka, , event sources)*: 500 ms\n *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaximumRecordAgeInSeconds
// CloudFormation resource type schema:
//
// {
// "description": "(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.\n 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",
// "maximum": 604800,
// "minimum": -1,
// "type": "integer"
// }
"maximum_record_age_in_seconds": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "(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.\n 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",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MaximumRetryAttempts
// CloudFormation resource type schema:
//
// {
// "description": "(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.",
// "maximum": 10000,
// "minimum": -1,
// "type": "integer"
// }
"maximum_retry_attempts": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "(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.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ParallelizationFactor
// CloudFormation resource type schema:
//
// {
// "description": "(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.",
// "maximum": 10,
// "minimum": 1,
// "type": "integer"
// }
"parallelization_factor": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Queues
// CloudFormation resource type schema:
//
// {
// "description": "(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.",
// "items": {
// "maxLength": 1000,
// "minLength": 1,
// "pattern": "[\\s\\S]*",
// "type": "string"
// },
// "maxItems": 1,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
"queues": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ScalingConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "(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).",
// "properties": {
// "MaximumConcurrency": {
// "description": "Limits the number of concurrent instances that the SQS event source can invoke.",
// "maximum": 1000,
// "minimum": 2,
// "type": "integer"
// }
// },
// "type": "object"
// }
"scaling_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: MaximumConcurrency
"maximum_concurrency": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "Limits the number of concurrent instances that the SQS event source can invoke.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "(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).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SelfManagedEventSource
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The self-managed Apache Kafka cluster for your event source.",
// "properties": {
// "Endpoints": {
// "additionalProperties": false,
// "description": "The list of bootstrap servers for your Kafka brokers in the following format: ``\"KafkaBootstrapServers\": [\"abc.xyz.com:xxxx\",\"abc2.xyz.com:xxxx\"]``.",
// "properties": {
// "KafkaBootstrapServers": {
// "description": "The list of bootstrap servers for your Kafka brokers in the following format: ``\"KafkaBootstrapServers\": [\"abc.xyz.com:xxxx\",\"abc2.xyz.com:xxxx\"]``.",
// "items": {
// "description": "The URL of a Kafka server.",
// "maxLength": 300,
// "minLength": 1,
// "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]):[0-9]{1,5}",
// "type": "string"
// },
// "maxItems": 10,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
// },
// "type": "object"
// }
// },
// "type": "object"
// }
"self_managed_event_source": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Endpoints
"endpoints": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: KafkaBootstrapServers
"kafka_bootstrap_servers": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The list of bootstrap servers for your Kafka brokers in the following format: ``\"KafkaBootstrapServers\": [\"abc.xyz.com:xxxx\",\"abc2.xyz.com:xxxx\"]``.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The list of bootstrap servers for your Kafka brokers in the following format: ``\"KafkaBootstrapServers\": [\"abc.xyz.com:xxxx\",\"abc2.xyz.com:xxxx\"]``.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The self-managed Apache Kafka cluster for your event source.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SelfManagedKafkaEventSourceConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Specific configuration settings for a self-managed Apache Kafka event source.",
// "properties": {
// "ConsumerGroupId": {
// "description": "The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id).",
// "maxLength": 200,
// "minLength": 1,
// "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
// "type": "string"
// }
// },
// "type": "object"
// }
"self_managed_kafka_event_source_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ConsumerGroupId
"consumer_group_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id).",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Specific configuration settings for a self-managed Apache Kafka event source.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SourceAccessConfigurations
// CloudFormation resource type schema:
//
// {
// "description": "An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.",
// "items": {
// "additionalProperties": false,
// "description": "An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.",
// "properties": {
// "Type": {
// "description": "The type of authentication protocol, VPC components, or virtual host for your event source. For example: ``\"Type\":\"SASL_SCRAM_512_AUTH\"``.\n + ``BASIC_AUTH`` ? (Amazon MQ) The ASMlong secret that stores your broker credentials.\n + ``BASIC_AUTH`` ? (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers.\n + ``VPC_SUBNET`` ? (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster.\n + ``VPC_SECURITY_GROUP`` ? (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers.\n + ``SASL_SCRAM_256_AUTH`` ? (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.\n + ``SASL_SCRAM_512_AUTH`` ? (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.\n + ``VIRTUAL_HOST`` ?- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call.\n + ``CLIENT_CERTIFICATE_TLS_AUTH`` ? (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.\n + ``SERVER_ROOT_CA_CERTIFICATE`` ? (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.",
// "enum": [
// "BASIC_AUTH",
// "VPC_SUBNET",
// "VPC_SECURITY_GROUP",
// "SASL_SCRAM_512_AUTH",
// "SASL_SCRAM_256_AUTH",
// "VIRTUAL_HOST",
// "CLIENT_CERTIFICATE_TLS_AUTH",
// "SERVER_ROOT_CA_CERTIFICATE"
// ],
// "type": "string"
// },
// "URI": {
// "description": "The value for your chosen configuration in ``Type``. For example: ``\"URI\": \"arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName\"``.",
// "maxLength": 200,
// "minLength": 1,
// "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*",
// "type": "string"
// }
// },
// "type": "object"
// },
// "maxItems": 22,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
"source_access_configurations": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Type
"type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The type of authentication protocol, VPC components, or virtual host for your event source. For example: ``\"Type\":\"SASL_SCRAM_512_AUTH\"``.\n + ``BASIC_AUTH`` ? (Amazon MQ) The ASMlong secret that stores your broker credentials.\n + ``BASIC_AUTH`` ? (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers.\n + ``VPC_SUBNET`` ? (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster.\n + ``VPC_SECURITY_GROUP`` ? (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers.\n + ``SASL_SCRAM_256_AUTH`` ? (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.\n + ``SASL_SCRAM_512_AUTH`` ? (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.\n + ``VIRTUAL_HOST`` ?- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call.\n + ``CLIENT_CERTIFICATE_TLS_AUTH`` ? (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.\n + ``SERVER_ROOT_CA_CERTIFICATE`` ? (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: URI
"uri": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The value for your chosen configuration in ``Type``. For example: ``\"URI\": \"arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName\"``.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StartingPosition
// CloudFormation resource type schema:
//
// {
// "description": "The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.\n + *LATEST* - Read only new records.\n + *TRIM_HORIZON* - Process all available records.\n + *AT_TIMESTAMP* - Specify a time from which to start reading records.",
// "maxLength": 12,
// "minLength": 6,
// "pattern": "(LATEST|TRIM_HORIZON|AT_TIMESTAMP)+",
// "type": "string"
// }
"starting_position": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.\n + *LATEST* - Read only new records.\n + *TRIM_HORIZON* - Process all available records.\n + *AT_TIMESTAMP* - Specify a time from which to start reading records.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StartingPositionTimestamp
// CloudFormation resource type schema:
//
// {
// "description": "With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.",
// "type": "number"
// }
"starting_position_timestamp": schema.Float64Attribute{ /*START ATTRIBUTE*/
Description: "With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Topics
// CloudFormation resource type schema:
//
// {
// "description": "The name of the Kafka topic.",
// "items": {
// "maxLength": 249,
// "minLength": 1,
// "pattern": "^[^.]([a-zA-Z0-9\\-_.]+)",
// "type": "string"
// },
// "maxItems": 1,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
"topics": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The name of the Kafka topic.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: TumblingWindowInSeconds
// CloudFormation resource type schema:
//
// {
// "description": "(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.",
// "maximum": 900,
// "minimum": 0,
// "type": "integer"
// }
"tumbling_window_in_seconds": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "(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.",
Computed: true,
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Required: true,
}
schema := schema.Schema{
Description: "Data Source schema for AWS::Lambda::EventSourceMapping",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::Lambda::EventSourceMapping").WithTerraformTypeName("awscc_lambda_event_source_mapping")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"amazon_managed_kafka_event_source_config": "AmazonManagedKafkaEventSourceConfig",
"batch_size": "BatchSize",
"bisect_batch_on_function_error": "BisectBatchOnFunctionError",
"collection_name": "CollectionName",
"consumer_group_id": "ConsumerGroupId",
"database_name": "DatabaseName",
"destination": "Destination",
"destination_config": "DestinationConfig",
"document_db_event_source_config": "DocumentDBEventSourceConfig",
"enabled": "Enabled",
"endpoints": "Endpoints",
"event_source_arn": "EventSourceArn",
"event_source_mapping_id": "Id",
"filter_criteria": "FilterCriteria",
"filters": "Filters",
"full_document": "FullDocument",
"function_name": "FunctionName",
"function_response_types": "FunctionResponseTypes",
"kafka_bootstrap_servers": "KafkaBootstrapServers",
"maximum_batching_window_in_seconds": "MaximumBatchingWindowInSeconds",
"maximum_concurrency": "MaximumConcurrency",
"maximum_record_age_in_seconds": "MaximumRecordAgeInSeconds",
"maximum_retry_attempts": "MaximumRetryAttempts",
"on_failure": "OnFailure",
"parallelization_factor": "ParallelizationFactor",
"pattern": "Pattern",
"queues": "Queues",
"scaling_config": "ScalingConfig",
"self_managed_event_source": "SelfManagedEventSource",
"self_managed_kafka_event_source_config": "SelfManagedKafkaEventSourceConfig",
"source_access_configurations": "SourceAccessConfigurations",
"starting_position": "StartingPosition",
"starting_position_timestamp": "StartingPositionTimestamp",
"topics": "Topics",
"tumbling_window_in_seconds": "TumblingWindowInSeconds",
"type": "Type",
"uri": "URI",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}