class CfnFunctionPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.Lambda.Mixins.CfnFunctionPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awslambda/mixins#CfnFunctionPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.lambda.mixins.CfnFunctionPropsMixin |
Python | aws_cdk.mixins_preview.aws_lambda.mixins.CfnFunctionPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_lambda » mixins » CfnFunctionPropsMixin |
Implements
IMixin
Extends
Mixin
The AWS::Lambda::Function resource creates a Lambda function.
To create a function, you need a deployment package and an execution role . 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 Logs for log streaming and AWS X-Ray for request tracing.
You set the package type to Image if the deployment package is a container image . For these functions, include the URI of the container image in the Amazon ECR registry in the ImageUri property of the Code property . You do not need to specify the handler and runtime properties.
You set the package type to Zip if the deployment package is a .zip file archive . For these functions, specify the Amazon S3 location of your .zip file in the Code property. Alternatively, for Node.js and Python functions, you can define your function inline in the ZipFile property of the Code property . In both cases, you must also specify the handler and runtime properties.
You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with UpdateFunctionCode , Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.
When you update a AWS::Lambda::Function resource, CloudFormation calls the UpdateFunctionConfiguration and UpdateFunctionCode Lambda APIs under the hood. Because these calls happen sequentially, and invocations can happen between these calls, your function may encounter errors in the time between the calls. For example, if you remove an environment variable, and the code that references that environment variable in the same CloudFormation update, you may see invocation errors related to a missing environment variable. To work around this, you can invoke your function against a version or alias by default, rather than the $LATEST version.
Note that you configure provisioned concurrency on a AWS::Lambda::Version or a AWS::Lambda::Alias .
For a complete introduction to Lambda functions, see What is Lambda? in the Lambda developer guide.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as lambda_mixins } from '@aws-cdk/mixins-preview/aws-lambda';
const cfnFunctionPropsMixin = new lambda_mixins.CfnFunctionPropsMixin({
architectures: ['architectures'],
capacityProviderConfig: {
lambdaManagedInstancesCapacityProviderConfig: {
capacityProviderArn: 'capacityProviderArn',
executionEnvironmentMemoryGiBPerVCpu: 123,
perExecutionEnvironmentMaxConcurrency: 123,
},
},
code: {
imageUri: 'imageUri',
s3Bucket: 's3Bucket',
s3Key: 's3Key',
s3ObjectVersion: 's3ObjectVersion',
sourceKmsKeyArn: 'sourceKmsKeyArn',
zipFile: 'zipFile',
},
codeSigningConfigArn: 'codeSigningConfigArn',
deadLetterConfig: {
targetArn: 'targetArn',
},
description: 'description',
durableConfig: {
executionTimeout: 123,
retentionPeriodInDays: 123,
},
environment: {
variables: {
variablesKey: 'variables',
},
},
ephemeralStorage: {
size: 123,
},
fileSystemConfigs: [{
arn: 'arn',
localMountPath: 'localMountPath',
}],
functionName: 'functionName',
functionScalingConfig: {
maxExecutionEnvironments: 123,
minExecutionEnvironments: 123,
},
handler: 'handler',
imageConfig: {
command: ['command'],
entryPoint: ['entryPoint'],
workingDirectory: 'workingDirectory',
},
kmsKeyArn: 'kmsKeyArn',
layers: ['layers'],
loggingConfig: {
applicationLogLevel: 'applicationLogLevel',
logFormat: 'logFormat',
logGroup: 'logGroup',
systemLogLevel: 'systemLogLevel',
},
memorySize: 123,
packageType: 'packageType',
publishToLatestPublished: false,
recursiveLoop: 'recursiveLoop',
reservedConcurrentExecutions: 123,
role: 'role',
runtime: 'runtime',
runtimeManagementConfig: {
runtimeVersionArn: 'runtimeVersionArn',
updateRuntimeOn: 'updateRuntimeOn',
},
snapStart: {
applyOn: 'applyOn',
},
tags: [{
key: 'key',
value: 'value',
}],
tenancyConfig: {
tenantIsolationMode: 'tenantIsolationMode',
},
timeout: 123,
tracingConfig: {
mode: 'mode',
},
vpcConfig: {
ipv6AllowedForDualStack: false,
securityGroupIds: ['securityGroupIds'],
subnetIds: ['subnetIds'],
},
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnFunctionPropsMixin(props: CfnFunctionMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Function Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::Lambda::Function.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): void
Parameters
- construct
IConstruct
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript