@Stability(value=Stable) public static final class TriggerFunctionProps.Builder extends Object implements software.amazon.jsii.Builder<TriggerFunctionProps>
TriggerFunctionProps| Constructor and Description |
|---|
Builder() |
@Stability(value=Stable) public TriggerFunctionProps.Builder code(Code code)
FunctionProps.getCode()code - The source code of your Lambda function. This parameter is required.
You can point to a file in an
Amazon Simple Storage Service (Amazon S3) bucket or specify your source
code as inline text.this@Stability(value=Stable) public TriggerFunctionProps.Builder handler(String handler)
FunctionProps.getHandler()handler - The name of the method within your code that Lambda calls to execute your function. This parameter is required.
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.
this@Stability(value=Stable) public TriggerFunctionProps.Builder runtime(Runtime runtime)
FunctionProps.getRuntime()runtime - The runtime environment for the Lambda function that you are uploading. This parameter is required.
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.
this@Stability(value=Stable) public TriggerFunctionProps.Builder allowAllOutbound(Boolean allowAllOutbound)
FunctionOptions.getAllowAllOutbound()allowAllOutbound - Whether to allow the Lambda to send all network traffic.
If set to false, you must individually add traffic rules to allow the
Lambda to connect to network targets.this@Stability(value=Stable) public TriggerFunctionProps.Builder allowPublicSubnet(Boolean allowPublicSubnet)
FunctionOptions.getAllowPublicSubnet()allowPublicSubnet - Lambda Functions in a public subnet can NOT access the internet.
Use this property to acknowledge this limitation and still place the function in a public subnet.this@Stability(value=Stable) public TriggerFunctionProps.Builder architecture(Architecture architecture)
FunctionOptions.getArchitecture()architecture - The system architectures compatible with this lambda function.this@Stability(value=Stable) public TriggerFunctionProps.Builder codeSigningConfig(ICodeSigningConfig codeSigningConfig)
FunctionOptions.getCodeSigningConfig()codeSigningConfig - Code signing config associated with this function.this@Stability(value=Stable) public TriggerFunctionProps.Builder currentVersionOptions(VersionOptions currentVersionOptions)
FunctionOptions.getCurrentVersionOptions()currentVersionOptions - Options for the `lambda.Version` resource automatically created by the `fn.currentVersion` method.this@Stability(value=Stable) public TriggerFunctionProps.Builder deadLetterQueue(IQueue deadLetterQueue)
FunctionOptions.getDeadLetterQueue()deadLetterQueue - The SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify deadLetterTopic property instead.this@Stability(value=Stable) public TriggerFunctionProps.Builder deadLetterQueueEnabled(Boolean deadLetterQueueEnabled)
FunctionOptions.getDeadLetterQueueEnabled()deadLetterQueueEnabled - Enabled DLQ.
If deadLetterQueue is undefined,
an SQS queue with default options will be defined for your Function.this@Stability(value=Stable) public TriggerFunctionProps.Builder deadLetterTopic(ITopic deadLetterTopic)
FunctionOptions.getDeadLetterTopic()deadLetterTopic - The SNS topic to use as a DLQ.
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.this@Stability(value=Stable) public TriggerFunctionProps.Builder description(String description)
FunctionOptions.getDescription()description - A description of the function.this@Stability(value=Stable) public TriggerFunctionProps.Builder environment(Map<String,String> environment)
FunctionOptions.getEnvironment()environment - Key-value pairs that Lambda caches and makes available for your Lambda functions.
Use environment variables to apply configuration changes, such
as test and production environment configurations, without changing your
Lambda function source code.this@Stability(value=Stable) public TriggerFunctionProps.Builder environmentEncryption(IKey environmentEncryption)
FunctionOptions.getEnvironmentEncryption()environmentEncryption - The AWS KMS key that's used to encrypt your function's environment variables.this@Stability(value=Stable) public TriggerFunctionProps.Builder ephemeralStorageSize(Size ephemeralStorageSize)
FunctionOptions.getEphemeralStorageSize()ephemeralStorageSize - The size of the function’s /tmp directory in MiB.this@Stability(value=Stable) public TriggerFunctionProps.Builder events(List<? extends IEventSource> events)
FunctionOptions.getEvents()events - Event sources for this function.
You can also add event sources using addEventSource.this@Stability(value=Stable) public TriggerFunctionProps.Builder filesystem(FileSystem filesystem)
FunctionOptions.getFilesystem()filesystem - The filesystem configuration for the lambda function.this@Stability(value=Stable) public TriggerFunctionProps.Builder functionName(String functionName)
FunctionOptions.getFunctionName()functionName - A name for the function.this@Stability(value=Stable) public TriggerFunctionProps.Builder initialPolicy(List<? extends PolicyStatement> initialPolicy)
FunctionOptions.getInitialPolicy()initialPolicy - Initial policy statements to add to the created Lambda Role.
You can call addToRolePolicy to the created lambda to add statements post creation.this@Stability(value=Stable) public TriggerFunctionProps.Builder insightsVersion(LambdaInsightsVersion insightsVersion)
FunctionOptions.getInsightsVersion()insightsVersion - Specify the version of CloudWatch Lambda insights to use for monitoring.this@Stability(value=Stable) public TriggerFunctionProps.Builder layers(List<? extends ILayerVersion> layers)
FunctionOptions.getLayers()layers - A list of layers to add to the function's execution environment.
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.this@Stability(value=Stable) public TriggerFunctionProps.Builder logRetention(RetentionDays logRetention)
FunctionOptions.getLogRetention()logRetention - The number of days log events are kept in CloudWatch Logs.
When updating
this property, unsetting it doesn't remove the log retention policy. To
remove the retention policy, set the value to INFINITE.this@Stability(value=Stable) public TriggerFunctionProps.Builder logRetentionRetryOptions(LogRetentionRetryOptions logRetentionRetryOptions)
FunctionOptions.getLogRetentionRetryOptions()logRetentionRetryOptions - When log retention is specified, a custom resource attempts to create the CloudWatch log group.
These options control the retry policy when interacting with CloudWatch APIs.this@Stability(value=Stable) public TriggerFunctionProps.Builder logRetentionRole(IRole logRetentionRole)
FunctionOptions.getLogRetentionRole()logRetentionRole - The IAM role for the Lambda function associated with the custom resource that sets the retention policy.this@Stability(value=Stable) public TriggerFunctionProps.Builder memorySize(Number memorySize)
FunctionOptions.getMemorySize()memorySize - The amount of memory, in MB, that is allocated to your Lambda function.
Lambda uses this value to proportionally allocate the amount of CPU
power. For more information, see Resource Model in the AWS Lambda
Developer Guide.this@Stability(value=Stable) public TriggerFunctionProps.Builder profiling(Boolean profiling)
FunctionOptions.getProfiling()profiling - Enable profiling.this@Stability(value=Stable) public TriggerFunctionProps.Builder profilingGroup(IProfilingGroup profilingGroup)
FunctionOptions.getProfilingGroup()profilingGroup - Profiling Group.this@Stability(value=Stable) public TriggerFunctionProps.Builder reservedConcurrentExecutions(Number reservedConcurrentExecutions)
FunctionOptions.getReservedConcurrentExecutions()reservedConcurrentExecutions - The maximum of concurrent executions you want to reserve for the function.this@Stability(value=Stable) public TriggerFunctionProps.Builder role(IRole role)
FunctionOptions.getRole()role - Lambda execution 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".
this@Stability(value=Stable) public TriggerFunctionProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
FunctionOptions.getSecurityGroups()securityGroups - The list of security groups to associate with the Lambda's network interfaces.
Only used if 'vpc' is supplied.this@Stability(value=Stable) public TriggerFunctionProps.Builder timeout(Duration timeout)
FunctionOptions.getTimeout()timeout - The function execution time (in seconds) after which Lambda terminates the function.
Because the execution time affects cost, set this value
based on the function's expected execution time.this@Stability(value=Stable) public TriggerFunctionProps.Builder tracing(Tracing tracing)
FunctionOptions.getTracing()tracing - Enable AWS X-Ray Tracing for Lambda Function.this@Stability(value=Stable) public TriggerFunctionProps.Builder vpc(IVpc vpc)
FunctionOptions.getVpc()vpc - VPC network to place Lambda network interfaces.
Specify this if the Lambda function needs to access resources in a VPC.
This is required when vpcSubnets is specified.this@Stability(value=Stable) public TriggerFunctionProps.Builder vpcSubnets(SubnetSelection vpcSubnets)
FunctionOptions.getVpcSubnets()vpcSubnets - Where to place the network interfaces within the VPC.
This requires vpc to be specified in order for interfaces to actually be
placed in the subnets. If vpc is not specify, this will raise an error.
Note: Internet access for Lambda Functions requires a NAT Gateway, so picking
public subnets is not allowed (unless allowPublicSubnet is set to true).
this@Stability(value=Stable) public TriggerFunctionProps.Builder maxEventAge(Duration maxEventAge)
EventInvokeConfigOptions.getMaxEventAge()maxEventAge - The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds
Maximum: 6 hoursthis@Stability(value=Stable) public TriggerFunctionProps.Builder onFailure(IDestination onFailure)
EventInvokeConfigOptions.getOnFailure()onFailure - The destination for failed invocations.this@Stability(value=Stable) public TriggerFunctionProps.Builder onSuccess(IDestination onSuccess)
EventInvokeConfigOptions.getOnSuccess()onSuccess - The destination for successful invocations.this@Stability(value=Stable) public TriggerFunctionProps.Builder retryAttempts(Number retryAttempts)
EventInvokeConfigOptions.getRetryAttempts()retryAttempts - The maximum number of times to retry when the function returns an error.
Minimum: 0
Maximum: 2this@Stability(value=Stable) public TriggerFunctionProps.Builder executeAfter(List<? extends software.constructs.Construct> executeAfter)
TriggerOptions.getExecuteAfter()executeAfter - Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.
You can also use trigger.executeAfter() to add additional dependencies.this@Stability(value=Stable) public TriggerFunctionProps.Builder executeBefore(List<? extends software.constructs.Construct> executeBefore)
TriggerOptions.getExecuteBefore()executeBefore - Adds this trigger as a dependency on other constructs.
This means that this
trigger will get executed before the given construct(s).
You can also use trigger.executeBefore() to add additional dependants.
this@Stability(value=Stable) public TriggerFunctionProps.Builder executeOnHandlerChange(Boolean executeOnHandlerChange)
TriggerOptions.getExecuteOnHandlerChange()executeOnHandlerChange - Re-executes the trigger every time the handler changes.
This implies that the trigger is associated with the currentVersion of
the handler, which gets recreated every time the handler or its
configuration is updated.this@Stability(value=Stable) public TriggerFunctionProps build()
build in interface software.amazon.jsii.Builder<TriggerFunctionProps>TriggerFunctionPropsNullPointerException - if any required attribute was not providedCopyright © 2022. All rights reserved.