public static final class DockerImageFunction.Builder
extends java.lang.Object
DockerImageFunction
.Modifier and Type | Method and Description |
---|---|
DockerImageFunction.Builder |
allowAllOutbound(java.lang.Boolean allowAllOutbound)
Whether to allow the Lambda to send all network traffic.
|
DockerImageFunction.Builder |
allowPublicSubnet(java.lang.Boolean allowPublicSubnet)
Lambda Functions in a public subnet can NOT access the internet.
|
DockerImageFunction.Builder |
architecture(Architecture architecture)
The system architectures compatible with this lambda function.
|
DockerImageFunction.Builder |
architectures(java.util.List<? extends Architecture> architectures)
Deprecated.
use `architecture`
|
DockerImageFunction |
build() |
DockerImageFunction.Builder |
code(DockerImageCode code)
The source code of your Lambda function.
|
DockerImageFunction.Builder |
codeSigningConfig(ICodeSigningConfig codeSigningConfig)
Code signing config associated with this function.
|
static DockerImageFunction.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
DockerImageFunction.Builder |
currentVersionOptions(VersionOptions currentVersionOptions)
Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method.
|
DockerImageFunction.Builder |
deadLetterQueue(IQueue deadLetterQueue)
The SQS queue to use if DLQ is enabled.
|
DockerImageFunction.Builder |
deadLetterQueueEnabled(java.lang.Boolean deadLetterQueueEnabled)
Enabled DLQ.
|
DockerImageFunction.Builder |
deadLetterTopic(ITopic deadLetterTopic)
The SNS topic to use as a DLQ.
|
DockerImageFunction.Builder |
description(java.lang.String description)
A description of the function.
|
DockerImageFunction.Builder |
environment(java.util.Map<java.lang.String,java.lang.String> environment)
Key-value pairs that Lambda caches and makes available for your Lambda functions.
|
DockerImageFunction.Builder |
environmentEncryption(IKey environmentEncryption)
The AWS KMS key that's used to encrypt your function's environment variables.
|
DockerImageFunction.Builder |
ephemeralStorageSize(Size ephemeralStorageSize)
The size of the function’s /tmp directory in MiB.
|
DockerImageFunction.Builder |
events(java.util.List<? extends IEventSource> events)
Event sources for this function.
|
DockerImageFunction.Builder |
filesystem(FileSystem filesystem)
The filesystem configuration for the lambda function.
|
DockerImageFunction.Builder |
functionName(java.lang.String functionName)
A name for the function.
|
DockerImageFunction.Builder |
initialPolicy(java.util.List<? extends PolicyStatement> initialPolicy)
Initial policy statements to add to the created Lambda Role.
|
DockerImageFunction.Builder |
insightsVersion(LambdaInsightsVersion insightsVersion)
Specify the version of CloudWatch Lambda insights to use for monitoring.
|
DockerImageFunction.Builder |
layers(java.util.List<? extends ILayerVersion> layers)
A list of layers to add to the function's execution environment.
|
DockerImageFunction.Builder |
logRetention(RetentionDays logRetention)
The number of days log events are kept in CloudWatch Logs.
|
DockerImageFunction.Builder |
logRetentionRetryOptions(LogRetentionRetryOptions logRetentionRetryOptions)
When log retention is specified, a custom resource attempts to create the CloudWatch log group.
|
DockerImageFunction.Builder |
logRetentionRole(IRole logRetentionRole)
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
|
DockerImageFunction.Builder |
maxEventAge(Duration maxEventAge)
The maximum age of a request that Lambda sends to a function for processing.
|
DockerImageFunction.Builder |
memorySize(java.lang.Number memorySize)
The amount of memory, in MB, that is allocated to your Lambda function.
|
DockerImageFunction.Builder |
onFailure(IDestination onFailure)
The destination for failed invocations.
|
DockerImageFunction.Builder |
onSuccess(IDestination onSuccess)
The destination for successful invocations.
|
DockerImageFunction.Builder |
profiling(java.lang.Boolean profiling)
Enable profiling.
|
DockerImageFunction.Builder |
profilingGroup(IProfilingGroup profilingGroup)
Profiling Group.
|
DockerImageFunction.Builder |
reservedConcurrentExecutions(java.lang.Number reservedConcurrentExecutions)
The maximum of concurrent executions you want to reserve for the function.
|
DockerImageFunction.Builder |
retryAttempts(java.lang.Number retryAttempts)
The maximum number of times to retry when the function returns an error.
|
DockerImageFunction.Builder |
role(IRole role)
Lambda execution role.
|
DockerImageFunction.Builder |
securityGroup(ISecurityGroup securityGroup)
Deprecated.
- This property is deprecated, use securityGroups instead
|
DockerImageFunction.Builder |
securityGroups(java.util.List<? extends ISecurityGroup> securityGroups)
The list of security groups to associate with the Lambda's network interfaces.
|
DockerImageFunction.Builder |
timeout(Duration timeout)
The function execution time (in seconds) after which Lambda terminates the function.
|
DockerImageFunction.Builder |
tracing(Tracing tracing)
Enable AWS X-Ray Tracing for Lambda Function.
|
DockerImageFunction.Builder |
vpc(IVpc vpc)
VPC network to place Lambda network interfaces.
|
DockerImageFunction.Builder |
vpcSubnets(SubnetSelection vpcSubnets)
Where to place the network interfaces within the VPC.
|
public static DockerImageFunction.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.DockerImageFunction.Builder
.public DockerImageFunction.Builder maxEventAge(Duration maxEventAge)
Minimum: 60 seconds Maximum: 6 hours
Default: Duration.hours(6)
maxEventAge
- The maximum age of a request that Lambda sends to a function for processing. This parameter is required.this
public DockerImageFunction.Builder onFailure(IDestination onFailure)
Default: - no destination
onFailure
- The destination for failed invocations. This parameter is required.this
public DockerImageFunction.Builder onSuccess(IDestination onSuccess)
Default: - no destination
onSuccess
- The destination for successful invocations. This parameter is required.this
public DockerImageFunction.Builder retryAttempts(java.lang.Number retryAttempts)
Minimum: 0 Maximum: 2
Default: 2
retryAttempts
- The maximum number of times to retry when the function returns an error. This parameter is required.this
public DockerImageFunction.Builder allowAllOutbound(java.lang.Boolean allowAllOutbound)
If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.
Default: true
allowAllOutbound
- Whether to allow the Lambda to send all network traffic. This parameter is required.this
public DockerImageFunction.Builder allowPublicSubnet(java.lang.Boolean allowPublicSubnet)
Use this property to acknowledge this limitation and still place the function in a public subnet.
Default: false
allowPublicSubnet
- Lambda Functions in a public subnet can NOT access the internet. This parameter is required.this
public DockerImageFunction.Builder architecture(Architecture architecture)
Default: Architecture.X86_64
architecture
- The system architectures compatible with this lambda function. This parameter is required.this
@Deprecated public DockerImageFunction.Builder architectures(java.util.List<? extends Architecture> architectures)
Default: [Architecture.X86_64]
architectures
- DEPRECATED. This parameter is required.this
public DockerImageFunction.Builder codeSigningConfig(ICodeSigningConfig codeSigningConfig)
Default: - Not Sign the Code
codeSigningConfig
- Code signing config associated with this function. This parameter is required.this
public DockerImageFunction.Builder currentVersionOptions(VersionOptions currentVersionOptions)
Default: - default options as described in `VersionOptions`
currentVersionOptions
- Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method. This parameter is required.this
public DockerImageFunction.Builder deadLetterQueue(IQueue deadLetterQueue)
If SNS topic is desired, specify deadLetterTopic
property instead.
Default: - SQS queue with 14 day retention period if `deadLetterQueueEnabled` is `true`
deadLetterQueue
- The SQS queue to use if DLQ is enabled. This parameter is required.this
public DockerImageFunction.Builder deadLetterQueueEnabled(java.lang.Boolean deadLetterQueueEnabled)
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.
deadLetterQueueEnabled
- Enabled DLQ. This parameter is required.this
public DockerImageFunction.Builder deadLetterTopic(ITopic deadLetterTopic)
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
deadLetterTopic
- The SNS topic to use as a DLQ. This parameter is required.this
public DockerImageFunction.Builder description(java.lang.String description)
Default: - No description.
description
- A description of the function. This parameter is required.this
public DockerImageFunction.Builder environment(java.util.Map<java.lang.String,java.lang.String> environment)
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.
environment
- Key-value pairs that Lambda caches and makes available for your Lambda functions. This parameter is required.this
public DockerImageFunction.Builder environmentEncryption(IKey environmentEncryption)
Default: - AWS Lambda creates and uses an AWS managed customer master key (CMK).
environmentEncryption
- The AWS KMS key that's used to encrypt your function's environment variables. This parameter is required.this
public DockerImageFunction.Builder ephemeralStorageSize(Size ephemeralStorageSize)
Default: 512 MiB
ephemeralStorageSize
- The size of the function’s /tmp directory in MiB. This parameter is required.this
public DockerImageFunction.Builder events(java.util.List<? extends IEventSource> events)
You can also add event sources using addEventSource
.
Default: - No event sources.
events
- Event sources for this function. This parameter is required.this
public DockerImageFunction.Builder filesystem(FileSystem filesystem)
Default: - will not mount any filesystem
filesystem
- The filesystem configuration for the lambda function. This parameter is required.this
public DockerImageFunction.Builder functionName(java.lang.String functionName)
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.
functionName
- A name for the function. This parameter is required.this
public DockerImageFunction.Builder initialPolicy(java.util.List<? extends PolicyStatement> initialPolicy)
You can call addToRolePolicy
to the created lambda to add statements post creation.
Default: - No policy statements are added to the created Lambda role.
initialPolicy
- Initial policy statements to add to the created Lambda Role. This parameter is required.this
public DockerImageFunction.Builder insightsVersion(LambdaInsightsVersion insightsVersion)
Default: - No Lambda Insights
insightsVersion
- Specify the version of CloudWatch Lambda insights to use for monitoring. This parameter is required.this
public DockerImageFunction.Builder layers(java.util.List<? extends ILayerVersion> layers)
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.
layers
- A list of layers to add to the function's execution environment. This parameter is required.this
public DockerImageFunction.Builder logRetention(RetentionDays logRetention)
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
logRetention
- The number of days log events are kept in CloudWatch Logs. This parameter is required.this
public DockerImageFunction.Builder logRetentionRetryOptions(LogRetentionRetryOptions logRetentionRetryOptions)
These options control the retry policy when interacting with CloudWatch APIs.
Default: - Default AWS SDK retry options.
logRetentionRetryOptions
- When log retention is specified, a custom resource attempts to create the CloudWatch log group. This parameter is required.this
public DockerImageFunction.Builder logRetentionRole(IRole logRetentionRole)
Default: - A new role is created.
logRetentionRole
- The IAM role for the Lambda function associated with the custom resource that sets the retention policy. This parameter is required.this
public DockerImageFunction.Builder memorySize(java.lang.Number memorySize)
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
memorySize
- The amount of memory, in MB, that is allocated to your Lambda function. This parameter is required.this
public DockerImageFunction.Builder profiling(java.lang.Boolean profiling)
Default: - No profiling.
profiling
- Enable profiling. This parameter is required.this
public DockerImageFunction.Builder profilingGroup(IProfilingGroup profilingGroup)
Default: - A new profiling group will be created if `profiling` is set.
profilingGroup
- Profiling Group. This parameter is required.this
public DockerImageFunction.Builder reservedConcurrentExecutions(java.lang.Number reservedConcurrentExecutions)
Default: - No specific limit - account limit.
reservedConcurrentExecutions
- The maximum of concurrent executions you want to reserve for the function. This parameter is required.this
public DockerImageFunction.Builder role(IRole role)
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`.
role
- Lambda execution role. This parameter is required.this
@Deprecated public DockerImageFunction.Builder securityGroup(ISecurityGroup securityGroup)
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.
securityGroup
- What security group to associate with the Lambda's network interfaces. This property is being deprecated, consider using securityGroups instead. This parameter is required.this
public DockerImageFunction.Builder securityGroups(java.util.List<? extends ISecurityGroup> securityGroups)
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.
securityGroups
- The list of security groups to associate with the Lambda's network interfaces. This parameter is required.this
public DockerImageFunction.Builder timeout(Duration timeout)
Because the execution time affects cost, set this value based on the function's expected execution time.
Default: Duration.seconds(3)
timeout
- The function execution time (in seconds) after which Lambda terminates the function. This parameter is required.this
public DockerImageFunction.Builder tracing(Tracing tracing)
Default: Tracing.Disabled
tracing
- Enable AWS X-Ray Tracing for Lambda Function. This parameter is required.this
public DockerImageFunction.Builder vpc(IVpc vpc)
Specify this if the Lambda function needs to access resources in a VPC.
Default: - Function is not placed within a VPC.
vpc
- VPC network to place Lambda network interfaces. This parameter is required.this
public DockerImageFunction.Builder vpcSubnets(SubnetSelection vpcSubnets)
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
vpcSubnets
- Where to place the network interfaces within the VPC. This parameter is required.this
public DockerImageFunction.Builder code(DockerImageCode code)
You can point to a file in an Amazon Simple Storage Service (Amazon S3) bucket or specify your source code as inline text.
code
- The source code of your Lambda function. This parameter is required.this
public DockerImageFunction build()