Class DockerImageFunctionProps
Properties to configure a new DockerImageFunction construct.
Inheritance
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.AWS.Lambda.dll
Syntax (csharp)
public class DockerImageFunctionProps : Object, IDockerImageFunctionProps, IFunctionOptions, IEventInvokeConfigOptions
Syntax (vb)
Public Class DockerImageFunctionProps
Inherits Object
Implements IDockerImageFunctionProps, IFunctionOptions, IEventInvokeConfigOptions
Remarks
ExampleMetadata: infused
Examples
new DockerImageFunction(this, "AssetFunction", new DockerImageFunctionProps {
Code = DockerImageCode.FromImageAsset(Join(__dirname, "docker-handler"))
});
Synopsis
Constructors
DockerImageFunctionProps() |
Properties
AllowAllOutbound | Whether to allow the Lambda to send all network traffic. |
AllowPublicSubnet | Lambda Functions in a public subnet can NOT access the internet. |
Architecture | The system architectures compatible with this lambda function. |
Architectures | (deprecated) DEPRECATED. |
Code | The source code of your Lambda function. |
CodeSigningConfig | Code signing config associated with this function. |
CurrentVersionOptions | Options for the |
DeadLetterQueue | The SQS queue to use if DLQ is enabled. |
DeadLetterQueueEnabled | Enabled DLQ. |
DeadLetterTopic | The SNS topic to use as a DLQ. |
Description | A description of the function. |
Environment | Key-value pairs that Lambda caches and makes available for your Lambda functions. |
EnvironmentEncryption | The AWS KMS key that's used to encrypt your function's environment variables. |
EphemeralStorageSize | The size of the function’s /tmp directory in MiB. |
Events | Event sources for this function. |
Filesystem | The filesystem configuration for the lambda function. |
FunctionName | A name for the function. |
InitialPolicy | Initial policy statements to add to the created Lambda Role. |
InsightsVersion | Specify the version of CloudWatch Lambda insights to use for monitoring. |
Layers | A list of layers to add to the function's execution environment. |
LogRetention | The number of days log events are kept in CloudWatch Logs. |
LogRetentionRetryOptions | When log retention is specified, a custom resource attempts to create the CloudWatch log group. |
LogRetentionRole | The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
MaxEventAge | The maximum age of a request that Lambda sends to a function for processing. |
MemorySize | The amount of memory, in MB, that is allocated to your Lambda function. |
OnFailure | The destination for failed invocations. |
OnSuccess | The destination for successful invocations. |
Profiling | Enable profiling. |
ProfilingGroup | Profiling Group. |
ReservedConcurrentExecutions | The maximum of concurrent executions you want to reserve for the function. |
RetryAttempts | The maximum number of times to retry when the function returns an error. |
Role | Lambda execution role. |
SecurityGroup | (deprecated) What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead. |
SecurityGroups | The list of security groups to associate with the Lambda's network interfaces. |
Timeout | The function execution time (in seconds) after which Lambda terminates the function. |
Tracing | Enable AWS X-Ray Tracing for Lambda Function. |
Vpc | VPC network to place Lambda network interfaces. |
VpcSubnets | Where to place the network interfaces within the VPC. |
Constructors
DockerImageFunctionProps()
public DockerImageFunctionProps()
Properties
AllowAllOutbound
Whether to allow the Lambda to send all network traffic.
public Nullable<bool> AllowAllOutbound { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.
Default: true
AllowPublicSubnet
Lambda Functions in a public subnet can NOT access the internet.
public Nullable<bool> AllowPublicSubnet { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Use this property to acknowledge this limitation and still place the function in a public subnet.
Default: false
Architecture
The system architectures compatible with this lambda function.
public Architecture Architecture { get; set; }
Property Value
Remarks
Default: Architecture.X86_64
Architectures
(deprecated) DEPRECATED.
public Architecture[] Architectures { get; set; }
Property Value
Remarks
Default: [Architecture.X86_64]
Stability: Deprecated
Code
The source code of your Lambda function.
public DockerImageCode Code { get; set; }
Property Value
Remarks
You can point to a file in an Amazon Simple Storage Service (Amazon S3) bucket or specify your source code as inline text.
CodeSigningConfig
Code signing config associated with this function.
public ICodeSigningConfig CodeSigningConfig { get; set; }
Property Value
Remarks
Default: - Not Sign the Code
CurrentVersionOptions
Options for the lambda.Version
resource automatically created by the fn.currentVersion
method.
public IVersionOptions CurrentVersionOptions { get; set; }
Property Value
Remarks
Default: - default options as described in VersionOptions
DeadLetterQueue
The SQS queue to use if DLQ is enabled.
public IQueue DeadLetterQueue { get; set; }
Property Value
Remarks
If SNS topic is desired, specify deadLetterTopic
property instead.
Default: - SQS queue with 14 day retention period if deadLetterQueueEnabled
is true
DeadLetterQueueEnabled
Enabled DLQ.
public Nullable<bool> DeadLetterQueueEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If deadLetterQueue
is undefined,
an SQS queue with default options will be defined for your Function.
Default: - false unless deadLetterQueue
is set, which implies DLQ is enabled.
DeadLetterTopic
The SNS topic to use as a DLQ.
public ITopic DeadLetterTopic { get; set; }
Property Value
Remarks
Note that if deadLetterQueueEnabled
is set to true
, an SQS queue will be created
rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.
Default: - no SNS topic
Description
A description of the function.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: - No description.
Environment
Key-value pairs that Lambda caches and makes available for your Lambda functions.
public IDictionary<string, string> Environment { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code.
Default: - No environment variables.
EnvironmentEncryption
The AWS KMS key that's used to encrypt your function's environment variables.
public IKey EnvironmentEncryption { get; set; }
Property Value
Remarks
Default: - AWS Lambda creates and uses an AWS managed customer master key (CMK).
EphemeralStorageSize
The size of the function’s /tmp directory in MiB.
public Size EphemeralStorageSize { get; set; }
Property Value
Remarks
Default: 512 MiB
Events
Event sources for this function.
public IEventSource[] Events { get; set; }
Property Value
Remarks
You can also add event sources using addEventSource
.
Default: - No event sources.
Filesystem
The filesystem configuration for the lambda function.
public FileSystem Filesystem { get; set; }
Property Value
Remarks
Default: - will not mount any filesystem
FunctionName
A name for the function.
public string FunctionName { get; set; }
Property Value
System.String
Remarks
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.
InitialPolicy
Initial policy statements to add to the created Lambda Role.
public PolicyStatement[] InitialPolicy { get; set; }
Property Value
Remarks
You can call addToRolePolicy
to the created lambda to add statements post creation.
Default: - No policy statements are added to the created Lambda role.
InsightsVersion
Specify the version of CloudWatch Lambda insights to use for monitoring.
public LambdaInsightsVersion InsightsVersion { get; set; }
Property Value
Remarks
Default: - No Lambda Insights
Layers
A list of layers to add to the function's execution environment.
public ILayerVersion[] Layers { get; set; }
Property Value
Remarks
You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions.
Default: - No layers.
LogRetention
The number of days log events are kept in CloudWatch Logs.
public Nullable<RetentionDays> LogRetention { get; set; }
Property Value
System.Nullable<RetentionDays>
Remarks
When updating
this property, unsetting it doesn't remove the log retention policy. To
remove the retention policy, set the value to INFINITE
.
Default: logs.RetentionDays.INFINITE
LogRetentionRetryOptions
When log retention is specified, a custom resource attempts to create the CloudWatch log group.
public ILogRetentionRetryOptions LogRetentionRetryOptions { get; set; }
Property Value
Remarks
These options control the retry policy when interacting with CloudWatch APIs.
Default: - Default AWS SDK retry options.
LogRetentionRole
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
public IRole LogRetentionRole { get; set; }
Property Value
Remarks
Default: - A new role is created.
MaxEventAge
The maximum age of a request that Lambda sends to a function for processing.
public Duration MaxEventAge { get; set; }
Property Value
Remarks
Minimum: 60 seconds Maximum: 6 hours
Default: Duration.hours(6)
MemorySize
The amount of memory, in MB, that is allocated to your Lambda function.
public Nullable<double> MemorySize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide.
Default: 128
OnFailure
The destination for failed invocations.
public IDestination OnFailure { get; set; }
Property Value
Remarks
Default: - no destination
OnSuccess
The destination for successful invocations.
public IDestination OnSuccess { get; set; }
Property Value
Remarks
Default: - no destination
Profiling
Enable profiling.
public Nullable<bool> Profiling { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - No profiling.
See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
ProfilingGroup
Profiling Group.
public IProfilingGroup ProfilingGroup { get; set; }
Property Value
Remarks
Default: - A new profiling group will be created if profiling
is set.
See: https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
ReservedConcurrentExecutions
The maximum of concurrent executions you want to reserve for the function.
public Nullable<double> ReservedConcurrentExecutions { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - No specific limit - account limit.
See: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html
RetryAttempts
The maximum number of times to retry when the function returns an error.
public Nullable<double> RetryAttempts { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Minimum: 0 Maximum: 2
Default: 2
Role
Lambda execution role.
public IRole Role { get; set; }
Property Value
Remarks
This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal.
The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself.
The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole".
Default: - A unique role will be generated for this lambda function.
Both supplied and generated roles can always be changed by calling addToRolePolicy
.
SecurityGroup
(deprecated) What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead.
public ISecurityGroup SecurityGroup { get; set; }
Property Value
Remarks
Only used if 'vpc' is supplied.
Use securityGroups property instead. Function constructor will throw an error if both are specified.
Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroups prop, a dedicated security group will be created for this function.
Stability: Deprecated
SecurityGroups
The list of security groups to associate with the Lambda's network interfaces.
public ISecurityGroup[] SecurityGroups { get; set; }
Property Value
Remarks
Only used if 'vpc' is supplied.
Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
Timeout
The function execution time (in seconds) after which Lambda terminates the function.
public Duration Timeout { get; set; }
Property Value
Remarks
Because the execution time affects cost, set this value based on the function's expected execution time.
Default: Duration.seconds(3)
Tracing
Enable AWS X-Ray Tracing for Lambda Function.
public Nullable<Tracing> Tracing { get; set; }
Property Value
System.Nullable<Tracing>
Remarks
Default: Tracing.Disabled
Vpc
VPC network to place Lambda network interfaces.
public IVpc Vpc { get; set; }
Property Value
Remarks
Specify this if the Lambda function needs to access resources in a VPC.
Default: - Function is not placed within a VPC.
VpcSubnets
Where to place the network interfaces within the VPC.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
Only used if 'vpc' is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed.
Default: - the Vpc default strategy if not specified