@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.452Z") @Stability(value=Stable) public interface FunctionProps extends software.amazon.jsii.JsiiSerializable, FunctionOptions
import software.amazon.awscdk.services.lambda.*;
Function fn = Function.Builder.create(this, "MyFunc")
.runtime(Runtime.NODEJS_14_X)
.handler("index.handler")
.code(Code.fromInline("exports.handler = handler.toString()"))
.build();
Rule rule = Rule.Builder.create(this, "rule")
.eventPattern(EventPattern.builder()
.source(List.of("aws.ec2"))
.build())
.build();
Queue queue = new Queue(this, "Queue");
rule.addTarget(LambdaFunction.Builder.create(fn)
.deadLetterQueue(queue) // Optional: add a dead letter queue
.maxEventAge(Duration.hours(2)) // Optional: set the maxEventAge retry policy
.retryAttempts(2)
.build());
| Modifier and Type | Interface and Description |
|---|---|
static class |
FunctionProps.Builder
A builder for
FunctionProps |
static class |
FunctionProps.Jsii$Proxy
An implementation for
FunctionProps |
| Modifier and Type | Method and Description |
|---|---|
static FunctionProps.Builder |
builder() |
Code |
getCode()
The source code of your Lambda function.
|
String |
getHandler()
The name of the method within your code that Lambda calls to execute your function.
|
Runtime |
getRuntime()
The runtime environment for the Lambda function that you are uploading.
|
getAllowAllOutbound, getAllowPublicSubnet, getArchitecture, getCodeSigningConfig, getCurrentVersionOptions, getDeadLetterQueue, getDeadLetterQueueEnabled, getDeadLetterTopic, getDescription, getEnvironment, getEnvironmentEncryption, getEphemeralStorageSize, getEvents, getFilesystem, getFunctionName, getInitialPolicy, getInsightsVersion, getLayers, getLogRetention, getLogRetentionRetryOptions, getLogRetentionRole, getMemorySize, getProfiling, getProfilingGroup, getReservedConcurrentExecutions, getRole, getSecurityGroups, getTimeout, getTracing, getVpc, getVpcSubnetsgetMaxEventAge, getOnFailure, getOnSuccess, getRetryAttempts@Stability(value=Stable) @NotNull Code getCode()
You can point to a file in an Amazon Simple Storage Service (Amazon S3) bucket or specify your source code as inline text.
@Stability(value=Stable) @NotNull String getHandler()
The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html.
Use Handler.FROM_IMAGE when defining a function from a Docker image.
NOTE: If you specify your source code as inline text by specifying the ZipFile property within the Code property, specify index.function_name as the handler.
@Stability(value=Stable) @NotNull Runtime getRuntime()
For valid values, see the Runtime property in the AWS Lambda Developer Guide.
Use Runtime.FROM_IMAGE when defining a function from a Docker image.
@Stability(value=Stable) static FunctionProps.Builder builder()
builder in interface EventInvokeConfigOptionsbuilder in interface FunctionOptionsFunctionProps.Builder of FunctionPropsCopyright © 2022. All rights reserved.