AWS::Lambda::FunctionThe AWS::Lambda::Function resource creates a Lambda function. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html). The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Log...
31 configurable properties. 2 required. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
Code | Code | Required |
Role | string | Required |
Architectures | Array<string> | |
CapacityProviderConfig | CapacityProviderConfig | |
CodeSigningConfigArn | string | |
DeadLetterConfig | DeadLetterConfig | |
Description | string | |
DurableConfig | DurableConfig | |
Environment | Environment | |
EphemeralStorage | EphemeralStorage | |
FileSystemConfigs | Array<FileSystemConfig> | |
FunctionName | string | Create-only |
FunctionScalingConfig | FunctionScalingConfig | |
Handler | string | |
ImageConfig | ImageConfig | |
KmsKeyArn | string | |
Layers | Array<string> | |
LoggingConfig | LoggingConfig | |
MemorySize | integer | |
PackageType | string | Create-only |
PublishToLatestPublished | boolean | Write-only |
RecursiveLoop | string | |
ReservedConcurrentExecutions | integer | |
Runtime | string | |
RuntimeManagementConfig | RuntimeManagementConfig | |
SnapStart | SnapStart | Write-only |
Tags | Array<Tag> | |
TenancyConfig | TenancyConfig | Create-only |
Timeout | integer | |
TracingConfig | TracingConfig | |
VpcConfig | VpcConfig |
Values returned after the resource is created. Access these with Fn::GetAtt.
| Attribute | Type | Description |
|---|---|---|
Arn | string | - |
SnapStartResponse | SnapStartResponse | - |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::Lambda::Function
Resources:
MyResource:
Type: AWS::Lambda::Function
Properties:
Code: "value"
Role: "value"
Tags:
- Key: Environment
Value: Production
Description: !Ref "AWS::StackName"Permissions CloudFormation needs in your IAM role to manage this resource.
lambda:GetFunctionlambda:GetFunctionCodeSigningConfiglambda:GetFunctionRecursionConfiglambda:GetRuntimeManagementConfiglambda:GetFunctionScalingConfiglambda:CreateFunctionlambda:GetFunctionlambda:PutFunctionConcurrencyiam:PassRoles3:GetObjects3:GetObjectVersionec2:DescribeSecurityGroupsec2:DescribeSubnetslambda:DeleteFunctionConcurrencylambda:GetFunctionlambda:PutFunctionConcurrencylambda:TagResourcelambda:UntagResourcelambda:UpdateFunctionConfigurationlambda:UpdateFunctionCodeiam:PassRolelambda:ListFunctionslambda:DeleteFunctionlambda:GetFunctionec2:DescribeNetworkInterfacesEverything you need to know about Lambda on one page. HD quality, print-friendly.
Download Free InfographicFunctionNameThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
FunctionNamePackageTypeTenancyConfig