All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pepperize.cdk.lambda_deno.DenoFunction Maven / Gradle / Ivy

package com.pepperize.cdk.lambda_deno;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.63.0 (build 7c24e36)", date = "2022-07-27T17:18:13.142Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.lambda_deno.$Module.class, fqn = "@pepperize/cdk-lambda-deno.DenoFunction")
public class DenoFunction extends software.amazon.awscdk.services.lambda.Function {

    protected DenoFunction(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected DenoFunction(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param props This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public DenoFunction(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull com.pepperize.cdk.lambda_deno.DenoFunctionProps 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"), java.util.Objects.requireNonNull(props, "props is required") });
    }

    /**
     * A fluent builder for {@link com.pepperize.cdk.lambda_deno.DenoFunction}.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    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.Stable)
        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 final com.pepperize.cdk.lambda_deno.DenoFunctionProps.Builder props;

        private Builder(final software.constructs.Construct scope, final java.lang.String id) {
            this.scope = scope;
            this.id = id;
            this.props = new com.pepperize.cdk.lambda_deno.DenoFunctionProps.Builder();
        }

        /**
         * 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; } /** * 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. *

* 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; } /** * 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 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 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 layers) { this.props.layers(layers); 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; } /** * 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; } /** * 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 securityGroups) { this.props.securityGroups(securityGroups); 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. *

* 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. *

* 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 *

* @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; } /** * @return {@code this} * @param code This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder code(final software.amazon.awscdk.services.lambda.Code code) { this.props.code(code); return this; } /** * @return {@code this} * @param handler This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder handler(final java.lang.String handler) { this.props.handler(handler); return this; } /** * @return {@code this} * @param version This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder version(final com.pepperize.cdk.lambda_deno.DenoVersion version) { this.props.version(version); return this; } /** * @returns a newly built instance of {@link com.pepperize.cdk.lambda_deno.DenoFunction}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public com.pepperize.cdk.lambda_deno.DenoFunction build() { return new com.pepperize.cdk.lambda_deno.DenoFunction( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy