io.github.cdklabs.awslambdarust.RustFunction Maven / Gradle / Ivy
package io.github.cdklabs.awslambdarust;
/**
* (experimental) A Rust Lambda function.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-10T00:47:35.780Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.awslambdarust.$Module.class, fqn = "@cdklabs/aws-lambda-rust.RustFunction")
public class RustFunction extends software.amazon.awscdk.services.lambda.Function {
protected RustFunction(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected RustFunction(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public RustFunction(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable io.github.cdklabs.awslambdarust.RustFunctionProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public RustFunction(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.awslambdarust.RustFunction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private io.github.cdklabs.awslambdarust.RustFunctionProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* The maximum age of a request that Lambda sends to a function for processing.
*
* Minimum: 60 seconds
* Maximum: 6 hours
*
* Default: Duration.hours(6)
*
* @return {@code this}
* @param maxEventAge The maximum age of a request that Lambda sends to a function for processing. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder maxEventAge(final software.amazon.awscdk.Duration maxEventAge) {
this.props().maxEventAge(maxEventAge);
return this;
}
/**
* The destination for failed invocations.
*
* Default: - no destination
*
* @return {@code this}
* @param onFailure The destination for failed invocations. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder onFailure(final software.amazon.awscdk.services.lambda.IDestination onFailure) {
this.props().onFailure(onFailure);
return this;
}
/**
* The destination for successful invocations.
*
* Default: - no destination
*
* @return {@code this}
* @param onSuccess The destination for successful invocations. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder onSuccess(final software.amazon.awscdk.services.lambda.IDestination onSuccess) {
this.props().onSuccess(onSuccess);
return this;
}
/**
* The maximum number of times to retry when the function returns an error.
*
* Minimum: 0
* Maximum: 2
*
* Default: 2
*
* @return {@code this}
* @param retryAttempts The maximum number of times to retry when the function returns an error. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder retryAttempts(final java.lang.Number retryAttempts) {
this.props().retryAttempts(retryAttempts);
return this;
}
/**
* Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation.
*
* Default: - No ADOT instrumentation
*
* @return {@code this}
* @see https://aws-otel.github.io/docs/getting-started/lambda
* @param adotInstrumentation Specify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder adotInstrumentation(final software.amazon.awscdk.services.lambda.AdotInstrumentationConfig adotInstrumentation) {
this.props().adotInstrumentation(adotInstrumentation);
return this;
}
/**
* 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.
*
* Do not specify this property if the securityGroups
or securityGroup
property is set.
* Instead, configure allowAllOutbound
directly on the security group.
*
* Default: true
*
* @return {@code this}
* @param allowAllOutbound Whether to allow the Lambda to send all network traffic. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder allowAllOutbound(final java.lang.Boolean allowAllOutbound) {
this.props().allowAllOutbound(allowAllOutbound);
return this;
}
/**
* 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.
*
* Default: false
*
* @return {@code this}
* @see https://stackoverflow.com/questions/52992085/why-cant-an-aws-lambda-function-inside-a-public-subnet-in-a-vpc-connect-to-the/52994841#52994841
* @param allowPublicSubnet Lambda Functions in a public subnet can NOT access the internet. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder allowPublicSubnet(final java.lang.Boolean allowPublicSubnet) {
this.props().allowPublicSubnet(allowPublicSubnet);
return this;
}
/**
* Sets the application log level for the function.
*
* Default: INFO
*
* @return {@code this}
* @param applicationLogLevel Sets the application log level for the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder applicationLogLevel(final java.lang.String applicationLogLevel) {
this.props().applicationLogLevel(applicationLogLevel);
return this;
}
/**
* The system architectures compatible with this lambda function.
*
* Default: Architecture.X86_64
*
* @return {@code this}
* @param architecture The system architectures compatible with this lambda function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder architecture(final software.amazon.awscdk.services.lambda.Architecture architecture) {
this.props().architecture(architecture);
return this;
}
/**
* Code signing config associated with this function.
*
* Default: - Not Sign the Code
*
* @return {@code this}
* @param codeSigningConfig Code signing config associated with this function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder codeSigningConfig(final software.amazon.awscdk.services.lambda.ICodeSigningConfig codeSigningConfig) {
this.props().codeSigningConfig(codeSigningConfig);
return this;
}
/**
* Options for the lambda.Version
resource automatically created by the fn.currentVersion
method.
*
* Default: - default options as described in `VersionOptions`
*
* @return {@code this}
* @param currentVersionOptions Options for the lambda.Version
resource automatically created by the fn.currentVersion
method. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder currentVersionOptions(final software.amazon.awscdk.services.lambda.VersionOptions currentVersionOptions) {
this.props().currentVersionOptions(currentVersionOptions);
return this;
}
/**
* The SQS queue to use if DLQ is enabled.
*
* If SNS topic is desired, specify deadLetterTopic
property instead.
*
* Default: - SQS queue with 14 day retention period if `deadLetterQueueEnabled` is `true`
*
* @return {@code this}
* @param deadLetterQueue The SQS queue to use if DLQ is enabled. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deadLetterQueue(final software.amazon.awscdk.services.sqs.IQueue deadLetterQueue) {
this.props().deadLetterQueue(deadLetterQueue);
return this;
}
/**
* Enabled DLQ.
*
* 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.
*
* @return {@code this}
* @param deadLetterQueueEnabled Enabled DLQ. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deadLetterQueueEnabled(final java.lang.Boolean deadLetterQueueEnabled) {
this.props().deadLetterQueueEnabled(deadLetterQueueEnabled);
return this;
}
/**
* 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.
*
* Default: - no SNS topic
*
* @return {@code this}
* @param deadLetterTopic The SNS topic to use as a DLQ. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deadLetterTopic(final software.amazon.awscdk.services.sns.ITopic deadLetterTopic) {
this.props().deadLetterTopic(deadLetterTopic);
return this;
}
/**
* A description of the function.
*
* Default: - No description.
*
* @return {@code this}
* @param description A description of the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder description(final java.lang.String description) {
this.props().description(description);
return this;
}
/**
* 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.
*
* Default: - No environment variables.
*
* @return {@code this}
* @param environment Key-value pairs that Lambda caches and makes available for your Lambda functions. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder environment(final java.util.Map environment) {
this.props().environment(environment);
return this;
}
/**
* The AWS KMS key that's used to encrypt your function's environment variables.
*
* Default: - AWS Lambda creates and uses an AWS managed customer master key (CMK).
*
* @return {@code this}
* @param environmentEncryption The AWS KMS key that's used to encrypt your function's environment variables. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder environmentEncryption(final software.amazon.awscdk.services.kms.IKey environmentEncryption) {
this.props().environmentEncryption(environmentEncryption);
return this;
}
/**
* The size of the function’s /tmp directory in MiB.
*
* Default: 512 MiB
*
* @return {@code this}
* @param ephemeralStorageSize The size of the function’s /tmp directory in MiB. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ephemeralStorageSize(final software.amazon.awscdk.Size ephemeralStorageSize) {
this.props().ephemeralStorageSize(ephemeralStorageSize);
return this;
}
/**
* Event sources for this function.
*
* You can also add event sources using addEventSource
.
*
* Default: - No event sources.
*
* @return {@code this}
* @param events Event sources for this function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder events(final java.util.List extends software.amazon.awscdk.services.lambda.IEventSource> events) {
this.props().events(events);
return this;
}
/**
* The filesystem configuration for the lambda function.
*
* Default: - will not mount any filesystem
*
* @return {@code this}
* @param filesystem The filesystem configuration for the lambda function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder filesystem(final software.amazon.awscdk.services.lambda.FileSystem filesystem) {
this.props().filesystem(filesystem);
return this;
}
/**
* A name for the function.
*
* Default: - AWS CloudFormation generates a unique physical ID and uses that
* ID for the function's name. For more information, see Name Type.
*
* @return {@code this}
* @param functionName A name for the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder functionName(final java.lang.String functionName) {
this.props().functionName(functionName);
return this;
}
/**
* Initial policy statements to add to the created Lambda Role.
*
* You can call addToRolePolicy
to the created lambda to add statements post creation.
*
* Default: - No policy statements are added to the created Lambda role.
*
* @return {@code this}
* @param initialPolicy Initial policy statements to add to the created Lambda Role. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder initialPolicy(final java.util.List extends software.amazon.awscdk.services.iam.PolicyStatement> initialPolicy) {
this.props().initialPolicy(initialPolicy);
return this;
}
/**
* Specify the version of CloudWatch Lambda insights to use for monitoring.
*
* Default: - No Lambda Insights
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-docker.html
* @param insightsVersion Specify the version of CloudWatch Lambda insights to use for monitoring. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder insightsVersion(final software.amazon.awscdk.services.lambda.LambdaInsightsVersion insightsVersion) {
this.props().insightsVersion(insightsVersion);
return this;
}
/**
* 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.
*
* Default: - No layers.
*
* @return {@code this}
* @param layers A list of layers to add to the function's execution environment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder layers(final java.util.List extends software.amazon.awscdk.services.lambda.ILayerVersion> layers) {
this.props().layers(layers);
return this;
}
/**
* Sets the logFormat for the function.
*
* Default: Text format
*
* @return {@code this}
* @param logFormat Sets the logFormat for the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logFormat(final java.lang.String logFormat) {
this.props().logFormat(logFormat);
return this;
}
/**
* Sets the log group name for the function.
*
* Default: `/aws/lambda/${this.functionName}` default log group name created by Lambda
*
* @return {@code this}
* @param logGroup Sets the log group name for the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logGroup(final software.amazon.awscdk.services.logs.ILogGroup logGroup) {
this.props().logGroup(logGroup);
return this;
}
/**
* 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
.
*
* Default: logs.RetentionDays.INFINITE
*
* @return {@code this}
* @param logRetention The number of days log events are kept in CloudWatch Logs. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logRetention(final software.amazon.awscdk.services.logs.RetentionDays logRetention) {
this.props().logRetention(logRetention);
return this;
}
/**
* 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.
*
* Default: - Default AWS SDK retry options.
*
* @return {@code this}
* @param logRetentionRetryOptions When log retention is specified, a custom resource attempts to create the CloudWatch log group. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logRetentionRetryOptions(final software.amazon.awscdk.services.lambda.LogRetentionRetryOptions logRetentionRetryOptions) {
this.props().logRetentionRetryOptions(logRetentionRetryOptions);
return this;
}
/**
* The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
*
* Default: - A new role is created.
*
* @return {@code this}
* @param logRetentionRole The IAM role for the Lambda function associated with the custom resource that sets the retention policy. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logRetentionRole(final software.amazon.awscdk.services.iam.IRole logRetentionRole) {
this.props().logRetentionRole(logRetentionRole);
return this;
}
/**
* 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.
*
* Default: 128
*
* @return {@code this}
* @param memorySize The amount of memory, in MB, that is allocated to your Lambda function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder memorySize(final java.lang.Number memorySize) {
this.props().memorySize(memorySize);
return this;
}
/**
* Specify the configuration of Parameters and Secrets Extension.
*
* Default: - No Parameters and Secrets Extension
*
* @return {@code this}
* @see https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html
* @param paramsAndSecrets Specify the configuration of Parameters and Secrets Extension. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder paramsAndSecrets(final software.amazon.awscdk.services.lambda.ParamsAndSecretsLayerVersion paramsAndSecrets) {
this.props().paramsAndSecrets(paramsAndSecrets);
return this;
}
/**
* Enable profiling.
*
* Default: - No profiling.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
* @param profiling Enable profiling. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder profiling(final java.lang.Boolean profiling) {
this.props().profiling(profiling);
return this;
}
/**
* Profiling Group.
*
* Default: - A new profiling group will be created if `profiling` is set.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
* @param profilingGroup Profiling Group. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder profilingGroup(final software.amazon.awscdk.services.codeguruprofiler.IProfilingGroup profilingGroup) {
this.props().profilingGroup(profilingGroup);
return this;
}
/**
* The maximum of concurrent executions you want to reserve for the function.
*
* Default: - No specific limit - account limit.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html
* @param reservedConcurrentExecutions The maximum of concurrent executions you want to reserve for the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder reservedConcurrentExecutions(final java.lang.Number reservedConcurrentExecutions) {
this.props().reservedConcurrentExecutions(reservedConcurrentExecutions);
return this;
}
/**
* 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".
*
* Default: - A unique role will be generated for this lambda function.
* Both supplied and generated roles can always be changed by calling `addToRolePolicy`.
*
* @return {@code this}
* @param role Lambda execution role. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder role(final software.amazon.awscdk.services.iam.IRole role) {
this.props().role(role);
return this;
}
/**
* Sets the runtime management configuration for a function's version.
*
* Default: Auto
*
* @return {@code this}
* @param runtimeManagementMode Sets the runtime management configuration for a function's version. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder runtimeManagementMode(final software.amazon.awscdk.services.lambda.RuntimeManagementMode runtimeManagementMode) {
this.props().runtimeManagementMode(runtimeManagementMode);
return this;
}
/**
* The list of security groups to associate with the Lambda's network interfaces.
*
* 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.
*
* @return {@code this}
* @param securityGroups The list of security groups to associate with the Lambda's network interfaces. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder securityGroups(final java.util.List extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups) {
this.props().securityGroups(securityGroups);
return this;
}
/**
* Enable SnapStart for Lambda Function.
*
* SnapStart is currently supported only for Java 11, 17 runtime
*
* Default: - No snapstart
*
* @return {@code this}
* @param snapStart Enable SnapStart for Lambda Function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder snapStart(final software.amazon.awscdk.services.lambda.SnapStartConf snapStart) {
this.props().snapStart(snapStart);
return this;
}
/**
* Sets the system log level for the function.
*
* Default: INFO
*
* @return {@code this}
* @param systemLogLevel Sets the system log level for the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder systemLogLevel(final java.lang.String systemLogLevel) {
this.props().systemLogLevel(systemLogLevel);
return this;
}
/**
* 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.
*
* Default: Duration.seconds(3)
*
* @return {@code this}
* @param timeout The function execution time (in seconds) after which Lambda terminates the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder timeout(final software.amazon.awscdk.Duration timeout) {
this.props().timeout(timeout);
return this;
}
/**
* Enable AWS X-Ray Tracing for Lambda Function.
*
* Default: Tracing.Disabled
*
* @return {@code this}
* @param tracing Enable AWS X-Ray Tracing for Lambda Function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder tracing(final software.amazon.awscdk.services.lambda.Tracing tracing) {
this.props().tracing(tracing);
return this;
}
/**
* 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.
*
* Default: - Function is not placed within a VPC.
*
* @return {@code this}
* @param vpc VPC network to place Lambda network interfaces. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpc(final software.amazon.awscdk.services.ec2.IVpc vpc) {
this.props().vpc(vpc);
return this;
}
/**
* 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
).
*
* Default: - the Vpc default strategy if not specified
*
* @return {@code this}
* @param vpcSubnets Where to place the network interfaces within the VPC. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpcSubnets(final software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets) {
this.props().vpcSubnets(vpcSubnets);
return this;
}
/**
* (experimental) The name of the binary to build, in case that it's different that the package's name.
*
* Default: Build all binaries
*
* @return {@code this}
* @param binaryName The name of the binary to build, in case that it's different that the package's name. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder binaryName(final java.lang.String binaryName) {
this.props().binaryName(binaryName);
return this;
}
/**
* (experimental) Bundling options.
*
* Default: - use default bundling options: all
* binaries and packages are bundled.
*
* @return {@code this}
* @param bundling Bundling options. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bundling(final io.github.cdklabs.awslambdarust.BundlingOptions bundling) {
this.props().bundling(bundling);
return this;
}
/**
* (experimental) Path to the entry Cargo.toml file.
*
* Default: - Derived from the name of the defining file and the construct's id.
* If the `RustsFunction` is defined in `stack.ts` with `my-binary` as id
* (`new RustFunction(this, 'my-binary')`), the construct will look at `stack.my-binary/Cargo.toml`
*
* @return {@code this}
* @param entry Path to the entry Cargo.toml file. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder entry(final java.lang.String entry) {
this.props().entry(entry);
return this;
}
/**
* (experimental) The path to the directory containing project Manifest file.
*
* Default: - the directory containing the `depsLockFilePath`
*
* @return {@code this}
* @param projectRoot The path to the directory containing project Manifest file. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder projectRoot(final java.lang.String projectRoot) {
this.props().projectRoot(projectRoot);
return this;
}
/**
* (experimental) The runtime environment.
*
* Only OS-only runtimes are supported.
*
* Default: `Runtime.PROVIDED_AL2023`
*
* @return {@code this}
* @param runtime The runtime environment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder runtime(final software.amazon.awscdk.services.lambda.Runtime runtime) {
this.props().runtime(runtime);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.awslambdarust.RustFunction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.awslambdarust.RustFunction build() {
return new io.github.cdklabs.awslambdarust.RustFunction(
this.scope,
this.id,
this.props != null ? this.props.build() : null
);
}
private io.github.cdklabs.awslambdarust.RustFunctionProps.Builder props() {
if (this.props == null) {
this.props = new io.github.cdklabs.awslambdarust.RustFunctionProps.Builder();
}
return this.props;
}
}
}