generated from hashicorp/terraform-provider-scaffolding
/
function_singular_data_source_gen.go
870 lines (857 loc) · 46.1 KB
/
function_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
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
// 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_function", functionDataSource)
}
// functionDataSource returns the Terraform awscc_lambda_function data source.
// This Terraform data source corresponds to the CloudFormation AWS::Lambda::Function resource.
func functionDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Architectures
// CloudFormation resource type schema:
//
// {
// "description": "The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is ``x86_64``.",
// "items": {
// "enum": [
// "x86_64",
// "arm64"
// ],
// "type": "string"
// },
// "maxItems": 1,
// "minItems": 1,
// "type": "array",
// "uniqueItems": true
// }
"architectures": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is ``x86_64``.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Arn
// CloudFormation resource type schema:
//
// {
// "description": "",
// "type": "string"
// }
"arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Code
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The code for the function.",
// "properties": {
// "ImageUri": {
// "description": "URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry.",
// "type": "string"
// },
// "S3Bucket": {
// "description": "An Amazon S3 bucket in the same AWS-Region as your function. The bucket can be in a different AWS-account.",
// "maxLength": 63,
// "minLength": 3,
// "pattern": "",
// "type": "string"
// },
// "S3Key": {
// "description": "The Amazon S3 key of the deployment package.",
// "maxLength": 1024,
// "minLength": 1,
// "type": "string"
// },
// "S3ObjectVersion": {
// "description": "For versioned objects, the version of the deployment package object to use.",
// "maxLength": 1024,
// "minLength": 1,
// "type": "string"
// },
// "ZipFile": {
// "description": "(Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, CFN places it in a file named ``index`` and zips it to create a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html). This zip file cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index``. For example, ``index.handler``.\n For JSON, you must escape quotes and special characters such as newline (``\\n``) with a backslash.\n If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ([cfn-response](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html)) that simplifies sending responses. See [Using Lambda with CloudFormation](https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html) for details.",
// "type": "string"
// }
// },
// "type": "object"
// }
"code": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ImageUri
"image_uri": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: S3Bucket
"s3_bucket": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "An Amazon S3 bucket in the same AWS-Region as your function. The bucket can be in a different AWS-account.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: S3Key
"s3_key": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon S3 key of the deployment package.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: S3ObjectVersion
"s3_object_version": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "For versioned objects, the version of the deployment package object to use.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ZipFile
"zip_file": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "(Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, CFN places it in a file named ``index`` and zips it to create a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html). This zip file cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index``. For example, ``index.handler``.\n For JSON, you must escape quotes and special characters such as newline (``\\n``) with a backslash.\n If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ([cfn-response](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html)) that simplifies sending responses. See [Using Lambda with CloudFormation](https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html) for details.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The code for the function.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: CodeSigningConfigArn
// CloudFormation resource type schema:
//
// {
// "description": "To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.",
// "pattern": "arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:code-signing-config:csc-[a-z0-9]{17}",
// "type": "string"
// }
"code_signing_config_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DeadLetterConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see [Dead-letter queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq).",
// "properties": {
// "TargetArn": {
// "description": "The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.",
// "pattern": "^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$",
// "type": "string"
// }
// },
// "type": "object"
// }
"dead_letter_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: TargetArn
"target_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see [Dead-letter queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "A description of the function.",
// "maxLength": 256,
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "A description of the function.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Environment
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Environment variables that are accessible from function code during execution.",
// "properties": {
// "Variables": {
// "additionalProperties": false,
// "description": "Environment variable key-value pairs. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html).",
// "patternProperties": {
// "": {
// "type": "string"
// }
// },
// "type": "object"
// }
// },
// "type": "object"
// }
"environment": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Variables
"variables": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "Environment variable key-value pairs. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html).",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Environment variables that are accessible from function code during execution.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: EphemeralStorage
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The size of the function's ``/tmp`` directory in MB. The default value is 512, but it can be any whole number between 512 and 10,240 MB.",
// "properties": {
// "Size": {
// "description": "The size of the function's ``/tmp`` directory.",
// "maximum": 10240,
// "minimum": 512,
// "type": "integer"
// }
// },
// "required": [
// "Size"
// ],
// "type": "object"
// }
"ephemeral_storage": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Size
"size": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The size of the function's ``/tmp`` directory.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The size of the function's ``/tmp`` directory in MB. The default value is 512, but it can be any whole number between 512 and 10,240 MB.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FileSystemConfigs
// CloudFormation resource type schema:
//
// {
// "description": "Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) resource, you must also specify a ``DependsOn`` attribute to ensure that the mount target is created or updated before the function.\n For more information about using the ``DependsOn`` attribute, see [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html).",
// "items": {
// "additionalProperties": false,
// "description": "Details about the connection between a Lambda function and an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html).",
// "properties": {
// "Arn": {
// "description": "The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.",
// "maxLength": 200,
// "pattern": "^arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:access-point/fsap-[a-f0-9]{17}$",
// "type": "string"
// },
// "LocalMountPath": {
// "description": "The path where the function can access the file system, starting with ``/mnt/``.",
// "maxLength": 160,
// "pattern": "^/mnt/[a-zA-Z0-9-_.]+$",
// "type": "string"
// }
// },
// "required": [
// "Arn",
// "LocalMountPath"
// ],
// "type": "object"
// },
// "maxItems": 1,
// "type": "array"
// }
"file_system_configs": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Arn
"arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LocalMountPath
"local_mount_path": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The path where the function can access the file system, starting with ``/mnt/``.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) resource, you must also specify a ``DependsOn`` attribute to ensure that the mount target is created or updated before the function.\n For more information about using the ``DependsOn`` attribute, see [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: FunctionName
// CloudFormation resource type schema:
//
// {
// "description": "The name of the Lambda function, up to 64 characters in length. If you don't specify a name, CFN generates one.\n If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.",
// "minLength": 1,
// "type": "string"
// }
"function_name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the Lambda function, up to 64 characters in length. If you don't specify a name, CFN generates one.\n If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Handler
// CloudFormation resource type schema:
//
// {
// "description": "The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html).",
// "maxLength": 128,
// "pattern": "^[^\\s]+$",
// "type": "string"
// }
"handler": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ImageConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Configuration values that override the container image Dockerfile settings. For more information, see [Container image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms).",
// "properties": {
// "Command": {
// "description": "Specifies parameters that you want to pass in with ENTRYPOINT. You can specify a maximum of 1,500 parameters in the list.",
// "items": {
// "type": "string"
// },
// "maxItems": 1500,
// "type": "array",
// "uniqueItems": true
// },
// "EntryPoint": {
// "description": "Specifies the entry point to their application, which is typically the location of the runtime executable. You can specify a maximum of 1,500 string entries in the list.",
// "items": {
// "type": "string"
// },
// "maxItems": 1500,
// "type": "array",
// "uniqueItems": true
// },
// "WorkingDirectory": {
// "description": "Specifies the working directory. The length of the directory string cannot exceed 1,000 characters.",
// "type": "string"
// }
// },
// "type": "object"
// }
"image_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Command
"command": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "Specifies parameters that you want to pass in with ENTRYPOINT. You can specify a maximum of 1,500 parameters in the list.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: EntryPoint
"entry_point": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "Specifies the entry point to their application, which is typically the location of the runtime executable. You can specify a maximum of 1,500 string entries in the list.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: WorkingDirectory
"working_directory": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Specifies the working directory. The length of the directory string cannot exceed 1,000 characters.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Configuration values that override the container image Dockerfile settings. For more information, see [Container image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: KmsKeyArn
// CloudFormation resource type schema:
//
// {
// "description": "The ARN of the KMSlong (KMS) customer managed key that's used to encrypt your function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.",
// "pattern": "^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$",
// "type": "string"
// }
"kms_key_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ARN of the KMSlong (KMS) customer managed key that's used to encrypt your function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Layers
// CloudFormation resource type schema:
//
// {
// "description": "A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version.",
// "items": {
// "type": "string"
// },
// "type": "array",
// "uniqueItems": false
// }
"layers": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LoggingConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The function's Amazon CloudWatch Logs configuration settings.",
// "properties": {
// "ApplicationLogLevel": {
// "description": "Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where ``TRACE`` is the highest level and ``FATAL`` is the lowest.",
// "enum": [
// "TRACE",
// "DEBUG",
// "INFO",
// "WARN",
// "ERROR",
// "FATAL"
// ],
// "type": "string"
// },
// "LogFormat": {
// "description": "The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.",
// "enum": [
// "Text",
// "JSON"
// ],
// "type": "string"
// },
// "LogGroup": {
// "description": "The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named ``/aws/lambda/\u003cfunction name\u003e``. To use a different log group, enter an existing log group or enter a new log group name.",
// "maxLength": 512,
// "minLength": 1,
// "pattern": "[\\.\\-_/#A-Za-z0-9]+",
// "type": "string"
// },
// "SystemLogLevel": {
// "description": "Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where ``DEBUG`` is the highest level and ``WARN`` is the lowest.",
// "enum": [
// "DEBUG",
// "INFO",
// "WARN"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"logging_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ApplicationLogLevel
"application_log_level": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where ``TRACE`` is the highest level and ``FATAL`` is the lowest.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LogFormat
"log_format": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: LogGroup
"log_group": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named ``/aws/lambda/<function name>``. To use a different log group, enter an existing log group or enter a new log group name.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SystemLogLevel
"system_log_level": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where ``DEBUG`` is the highest level and ``WARN`` is the lowest.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The function's Amazon CloudWatch Logs configuration settings.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: MemorySize
// CloudFormation resource type schema:
//
// {
// "description": "The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. AWS raises these quotas automatically based on your usage. You can also request a quota increase.",
// "type": "integer"
// }
"memory_size": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. AWS raises these quotas automatically based on your usage. You can also request a quota increase.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: PackageType
// CloudFormation resource type schema:
//
// {
// "description": "The type of deployment package. Set to ``Image`` for container image and set ``Zip`` for .zip file archive.",
// "enum": [
// "Image",
// "Zip"
// ],
// "type": "string"
// }
"package_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The type of deployment package. Set to ``Image`` for container image and set ``Zip`` for .zip file archive.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ReservedConcurrentExecutions
// CloudFormation resource type schema:
//
// {
// "description": "The number of simultaneous executions to reserve for the function.",
// "minimum": 0,
// "type": "integer"
// }
"reserved_concurrent_executions": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The number of simultaneous executions to reserve for the function.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Role
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of the function's execution role.",
// "pattern": "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$",
// "type": "string"
// }
"role": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the function's execution role.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Runtime
// CloudFormation resource type schema:
//
// {
// "description": "The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). Runtime is required if the deployment package is a .zip file archive.\n The following list includes deprecated runtimes. For more information, see [Runtime deprecation policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy).",
// "type": "string"
// }
"runtime": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). Runtime is required if the deployment package is a .zip file archive.\n The following list includes deprecated runtimes. For more information, see [Runtime deprecation policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RuntimeManagementConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Sets the runtime management configuration for a function's version. For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html).",
// "properties": {
// "RuntimeVersionArn": {
// "description": "The ARN of the runtime version you want the function to use.\n This is only required if you're using the *Manual* runtime update mode.",
// "type": "string"
// },
// "UpdateRuntimeOn": {
// "description": "Specify the runtime update mode.\n + *Auto (default)* - Automatically update to the most recent and secure runtime version using a [Two-phase runtime version rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). This is the best choice for most customers to ensure they always benefit from runtime updates.\n + *FunctionUpdate* - LAM updates the runtime of you function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.\n + *Manual* - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback).\n \n *Valid Values*: ``Auto`` | ``FunctionUpdate`` | ``Manual``",
// "enum": [
// "Auto",
// "FunctionUpdate",
// "Manual"
// ],
// "type": "string"
// }
// },
// "required": [
// "UpdateRuntimeOn"
// ],
// "type": "object"
// }
"runtime_management_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: RuntimeVersionArn
"runtime_version_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ARN of the runtime version you want the function to use.\n This is only required if you're using the *Manual* runtime update mode.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: UpdateRuntimeOn
"update_runtime_on": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Specify the runtime update mode.\n + *Auto (default)* - Automatically update to the most recent and secure runtime version using a [Two-phase runtime version rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). This is the best choice for most customers to ensure they always benefit from runtime updates.\n + *FunctionUpdate* - LAM updates the runtime of you function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.\n + *Manual* - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback).\n \n *Valid Values*: ``Auto`` | ``FunctionUpdate`` | ``Manual``",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Sets the runtime management configuration for a function's version. For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnapStart
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.",
// "properties": {
// "ApplyOn": {
// "description": "Set ``ApplyOn`` to ``PublishedVersions`` to create a snapshot of the initialized execution environment when you publish a function version.",
// "enum": [
// "PublishedVersions",
// "None"
// ],
// "type": "string"
// }
// },
// "required": [
// "ApplyOn"
// ],
// "type": "object"
// }
"snap_start": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ApplyOn
"apply_on": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Set ``ApplyOn`` to ``PublishedVersions`` to create a snapshot of the initialized execution environment when you publish a function version.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SnapStartResponse
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.",
// "properties": {
// "ApplyOn": {
// "description": "When set to ``PublishedVersions``, Lambda creates a snapshot of the execution environment when you publish a function version.",
// "enum": [
// "PublishedVersions",
// "None"
// ],
// "type": "string"
// },
// "OptimizationStatus": {
// "description": "When you provide a [qualified Amazon Resource Name (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), this response element indicates whether SnapStart is activated for the specified function version.",
// "enum": [
// "On",
// "Off"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"snap_start_response": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: ApplyOn
"apply_on": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "When set to ``PublishedVersions``, Lambda creates a snapshot of the execution environment when you publish a function version.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: OptimizationStatus
"optimization_status": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "When you provide a [qualified Amazon Resource Name (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), this response element indicates whether SnapStart is activated for the specified function version.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "description": "A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "",
// "properties": {
// "Key": {
// "description": "",
// "maxLength": 128,
// "minLength": 1,
// "type": "string"
// },
// "Value": {
// "description": "",
// "maxLength": 256,
// "minLength": 0,
// "type": "string"
// }
// },
// "required": [
// "Key"
// ],
// "type": "object"
// },
// "type": "array",
// "uniqueItems": true
// }
"tags": schema.SetNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Key
"key": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Timeout
// CloudFormation resource type schema:
//
// {
// "description": "The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html).",
// "minimum": 1,
// "type": "integer"
// }
"timeout": schema.Int64Attribute{ /*START ATTRIBUTE*/
Description: "The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: TracingConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Set ``Mode`` to ``Active`` to sample and trace a subset of incoming requests with [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html).",
// "properties": {
// "Mode": {
// "description": "The tracing mode.",
// "enum": [
// "Active",
// "PassThrough"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"tracing_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Mode
"mode": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The tracing mode.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "Set ``Mode`` to ``Active`` to sample and trace a subset of incoming requests with [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html).",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: VpcConfig
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html).",
// "properties": {
// "Ipv6AllowedForDualStack": {
// "description": "Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.",
// "type": "boolean"
// },
// "SecurityGroupIds": {
// "description": "A list of VPC security group IDs.",
// "items": {
// "type": "string"
// },
// "maxItems": 5,
// "type": "array",
// "uniqueItems": false
// },
// "SubnetIds": {
// "description": "A list of VPC subnet IDs.",
// "items": {
// "type": "string"
// },
// "maxItems": 16,
// "type": "array",
// "uniqueItems": false
// }
// },
// "type": "object"
// }
"vpc_config": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Ipv6AllowedForDualStack
"ipv_6_allowed_for_dual_stack": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SecurityGroupIds
"security_group_ids": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of VPC security group IDs.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: SubnetIds
"subnet_ids": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "A list of VPC subnet IDs.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html).",
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::Function",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::Lambda::Function").WithTerraformTypeName("awscc_lambda_function")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"application_log_level": "ApplicationLogLevel",
"apply_on": "ApplyOn",
"architectures": "Architectures",
"arn": "Arn",
"code": "Code",
"code_signing_config_arn": "CodeSigningConfigArn",
"command": "Command",
"dead_letter_config": "DeadLetterConfig",
"description": "Description",
"entry_point": "EntryPoint",
"environment": "Environment",
"ephemeral_storage": "EphemeralStorage",
"file_system_configs": "FileSystemConfigs",
"function_name": "FunctionName",
"handler": "Handler",
"image_config": "ImageConfig",
"image_uri": "ImageUri",
"ipv_6_allowed_for_dual_stack": "Ipv6AllowedForDualStack",
"key": "Key",
"kms_key_arn": "KmsKeyArn",
"layers": "Layers",
"local_mount_path": "LocalMountPath",
"log_format": "LogFormat",
"log_group": "LogGroup",
"logging_config": "LoggingConfig",
"memory_size": "MemorySize",
"mode": "Mode",
"optimization_status": "OptimizationStatus",
"package_type": "PackageType",
"reserved_concurrent_executions": "ReservedConcurrentExecutions",
"role": "Role",
"runtime": "Runtime",
"runtime_management_config": "RuntimeManagementConfig",
"runtime_version_arn": "RuntimeVersionArn",
"s3_bucket": "S3Bucket",
"s3_key": "S3Key",
"s3_object_version": "S3ObjectVersion",
"security_group_ids": "SecurityGroupIds",
"size": "Size",
"snap_start": "SnapStart",
"snap_start_response": "SnapStartResponse",
"subnet_ids": "SubnetIds",
"system_log_level": "SystemLogLevel",
"tags": "Tags",
"target_arn": "TargetArn",
"timeout": "Timeout",
"tracing_config": "TracingConfig",
"update_runtime_on": "UpdateRuntimeOn",
"value": "Value",
"variables": "Variables",
"vpc_config": "VpcConfig",
"working_directory": "WorkingDirectory",
"zip_file": "ZipFile",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}