1. Registry
  2. Packages
  3. AWSx (Pulumi AWS Components)
  4. API Docs
  5. lambda
  6. WebFunction
Viewing docs for AWSx (Pulumi Components for AWS) v3.15.0
published on Friday, Nov 20, 2026 by Pulumi
awsx logo awsx logo AWSx (Pulumi Components for AWS)
Viewing docs for AWSx (Pulumi Components for AWS) v3.15.0
published on Friday, Nov 20, 2026 by Pulumi

    A Lambda Web Function and its current immutable revision.

    Create WebFunction Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new WebFunction(name: string, args: WebFunctionArgs, opts?: ComponentResourceOptions);
    @overload
    def WebFunction(resource_name: str,
                    args: WebFunctionArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def WebFunction(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    code: Optional[WebFunctionCodeArgs] = None,
                    runtime: Optional[WebFunctionRuntime] = None,
                    egress_network_connector_version_arn: Optional[str] = None,
                    environment_variables: Optional[Mapping[str, str]] = None,
                    execution_role_arn: Optional[str] = None,
                    function_name: Optional[str] = None,
                    max_concurrency_per_environment: Optional[float] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    timeout_seconds: Optional[float] = None)
    func NewWebFunction(ctx *Context, name string, args WebFunctionArgs, opts ...ResourceOption) (*WebFunction, error)
    public WebFunction(string name, WebFunctionArgs args, ComponentResourceOptions? opts = null)
    public WebFunction(String name, WebFunctionArgs args)
    public WebFunction(String name, WebFunctionArgs args, ComponentResourceOptions options)
    
    type: awsx:lambda:WebFunction
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "awsx_lambda_web_function" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args WebFunctionArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args WebFunctionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args WebFunctionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WebFunctionArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WebFunctionArgs
    The arguments to resource properties.
    options ComponentResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var webFunctionResource = new Awsx.Lambda.WebFunction("webFunctionResource", new()
    {
        Code = new Awsx.Lambda.Inputs.WebFunctionCodeArgs
        {
            Archive = new FileArchive("./path/to/archive"),
        },
        Runtime = Awsx.Lambda.WebFunctionRuntime.NodeJS24X,
        EgressNetworkConnectorVersionArn = "string",
        EnvironmentVariables = 
        {
            { "string", "string" },
        },
        ExecutionRoleArn = "string",
        FunctionName = "string",
        MaxConcurrencyPerEnvironment = 0.0,
        Tags = 
        {
            { "string", "string" },
        },
        TimeoutSeconds = 0.0,
    });
    
    example, err := lambda.NewWebFunction(ctx, "webFunctionResource", &lambda.WebFunctionArgs{
    	Code: &lambda.WebFunctionCodeArgs{
    		Archive: pulumi.NewFileArchive("./path/to/archive"),
    	},
    	Runtime:                          lambda.WebFunctionRuntimeNodeJS24X,
    	EgressNetworkConnectorVersionArn: pulumi.String("string"),
    	EnvironmentVariables: map[string]pulumi.String{
    		"string": pulumi.String("string"),
    	},
    	ExecutionRoleArn:             pulumi.String("string"),
    	FunctionName:                 pulumi.String("string"),
    	MaxConcurrencyPerEnvironment: pulumi.Float64(0),
    	Tags: map[string]pulumi.String{
    		"string": pulumi.String("string"),
    	},
    	TimeoutSeconds: pulumi.Float64(0),
    })
    
    resource "awsx_lambda_web_function" "webFunctionResource" {
      lifecycle {
        create_before_destroy = true
      }
      code = {
        archive = filearchive("./path/to/archive")
      }
      runtime                              = "nodejs24.x"
      egress_network_connector_version_arn = "string"
      environment_variables = {
        "string" = "string"
      }
      execution_role_arn              = "string"
      function_name                   = "string"
      max_concurrency_per_environment = 0
      tags = {
        "string" = "string"
      }
      timeout_seconds = 0
    }
    
    var webFunctionResource = new WebFunction("webFunctionResource", WebFunctionArgs.builder()
        .code(WebFunctionCodeArgs.builder()
            .archive(new FileArchive("./path/to/archive"))
            .build())
        .runtime(com.pulumi.awsx.lambda.enums.WebFunctionRuntime.NodeJS24X)
        .egressNetworkConnectorVersionArn("string")
        .environmentVariables(Map.of("string", "string"))
        .executionRoleArn("string")
        .functionName("string")
        .maxConcurrencyPerEnvironment(0.0)
        .tags(Map.of("string", "string"))
        .timeoutSeconds(0.0)
        .build());
    
    web_function_resource = awsx.lambda_.WebFunction("webFunctionResource",
        code={
            "archive": pulumi.FileArchive("./path/to/archive"),
        },
        runtime=awsx.lambda_.WebFunctionRuntime.NODE_JS24_X,
        egress_network_connector_version_arn="string",
        environment_variables={
            "string": "string",
        },
        execution_role_arn="string",
        function_name="string",
        max_concurrency_per_environment=float(0),
        tags={
            "string": "string",
        },
        timeout_seconds=float(0))
    
    const webFunctionResource = new awsx.lambda.WebFunction("webFunctionResource", {
        code: {
            archive: new pulumi.asset.FileArchive("./path/to/archive"),
        },
        runtime: awsx.lambda.WebFunctionRuntime.NodeJS24X,
        egressNetworkConnectorVersionArn: "string",
        environmentVariables: {
            string: "string",
        },
        executionRoleArn: "string",
        functionName: "string",
        maxConcurrencyPerEnvironment: 0,
        tags: {
            string: "string",
        },
        timeoutSeconds: 0,
    });
    
    type: awsx:lambda:WebFunction
    properties:
        code:
            archive:
                fn::fileArchive: ./path/to/archive
        egressNetworkConnectorVersionArn: string
        environmentVariables:
            string: string
        executionRoleArn: string
        functionName: string
        maxConcurrencyPerEnvironment: 0
        runtime: nodejs24.x
        tags:
            string: string
        timeoutSeconds: 0
    

    WebFunction Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The WebFunction resource accepts the following input properties:

    Code WebFunctionCode
    Application code to deploy.
    Runtime Pulumi.Awsx.Lambda.WebFunctionRuntime
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    EgressNetworkConnectorVersionArn string

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    EnvironmentVariables Dictionary<string, string>

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    ExecutionRoleArn string

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    FunctionName string

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    MaxConcurrencyPerEnvironment double

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    Tags Dictionary<string, string>

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    TimeoutSeconds double

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    Code WebFunctionCodeArgs
    Application code to deploy.
    Runtime WebFunctionRuntime
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    EgressNetworkConnectorVersionArn string

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    EnvironmentVariables map[string]string

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    ExecutionRoleArn string

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    FunctionName string

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    MaxConcurrencyPerEnvironment float64

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    Tags map[string]string

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    TimeoutSeconds float64

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    code object
    Application code to deploy.
    runtime "nodejs24.x" | "nodejs-latest"
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    egress_network_connector_version_arn string

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    environment_variables map(string)

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    execution_role_arn string

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    function_name string

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    max_concurrency_per_environment number

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    tags map(string)

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    timeout_seconds number

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    code WebFunctionCode
    Application code to deploy.
    runtime WebFunctionRuntime
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    egressNetworkConnectorVersionArn String

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    environmentVariables Map<String,String>

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    executionRoleArn String

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    functionName String

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    maxConcurrencyPerEnvironment Double

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    tags Map<String,String>

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    timeoutSeconds Double

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    code WebFunctionCode
    Application code to deploy.
    runtime WebFunctionRuntime
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    egressNetworkConnectorVersionArn string

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    environmentVariables {[key: string]: string}

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    executionRoleArn string

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    functionName string

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    maxConcurrencyPerEnvironment number

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    tags {[key: string]: string}

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    timeoutSeconds number

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    code WebFunctionCodeArgs
    Application code to deploy.
    runtime WebFunctionRuntime
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    egress_network_connector_version_arn str

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    environment_variables Mapping[str, str]

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    execution_role_arn str

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    function_name str

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    max_concurrency_per_environment float

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    tags Mapping[str, str]

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    timeout_seconds float

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    code Property Map
    Application code to deploy.
    runtime "nodejs24.x" | "nodejs-latest"
    Runtime for the revision. Node.js loads index.js at the package root unless AWS_LAMBDA_NODEJS_ENTRYPOINT names another file. The application must listen on the host and port supplied in AWS_LAMBDA_HTTP_ENDPOINT.
    egressNetworkConnectorVersionArn String

    Version-qualified ARN of an existing network connector for VPC egress. Revisions using a connector support only HomeRegion endpoints. Keep the connector available for as long as any retained revision uses it.

    Default - No network connector.

    environmentVariables Map<String>

    Environment values included in each immutable revision. Pulumi secrets retain their Pulumi secret tracking, but AWS receives the resolved values. This is not runtime secret retrieval and does not prevent authorized AWS users from reading the configuration.

    Default - No application environment variables.

    executionRoleArn String

    Execution role assumed by the application. A supplied role must be in the function's account, trust lambda.amazonaws.com, and grant any AWS API access the application needs. AWSX adds scoped permissions for the central log group and its .local companions.

    Default - AWSX creates a role with scoped CloudWatch Logs permissions. Add application permissions separately.

    functionName String

    Physical function name.

    Default - Automatically named by the AWS Native provider.

    maxConcurrencyPerEnvironment Number

    Maximum concurrent requests per execution environment. Must be an integer from 1 through 128.

    Default - AWS default of 64.

    tags Map<String>

    Tags applied to the function and AWSX-created supporting resources that accept tags.

    Default - No additional tags.

    timeoutSeconds Number

    Maximum duration of an HTTP request, in seconds. Must be an integer from 3 through 900.

    Default - AWS default of 30 seconds.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WebFunction resource produces the following output properties:

    FunctionArn string
    ARN of the function.
    LogGroup Pulumi.Aws.CloudWatch.LogGroup
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    RevisionArn string
    ARN of the current revision.
    RevisionId string
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.
    FunctionArn string
    ARN of the function.
    LogGroup LogGroup
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    RevisionArn string
    ARN of the current revision.
    RevisionId string
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.
    function_arn string
    ARN of the function.
    log_group aws_cloudwatch_log_group_log_group
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    revision_arn string
    ARN of the current revision.
    revision_id string
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.
    functionArn String
    ARN of the function.
    logGroup LogGroup
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    revisionArn String
    ARN of the current revision.
    revisionId String
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.
    functionArn string
    ARN of the function.
    logGroup pulumiAws.cloudwatch.LogGroup
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    revisionArn string
    ARN of the current revision.
    revisionId string
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.
    function_arn str
    ARN of the function.
    log_group pulumi_aws.cloudwatch.LogGroup
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    revision_arn str
    ARN of the current revision.
    revision_id str
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.
    functionArn String
    ARN of the function.
    logGroup aws:cloudwatch:LogGroup
    Central log group created in the home Region. This type is defined in the AWS Classic package.
    revisionArn String
    ARN of the current revision.
    revisionId String
    Identifier of the current revision. Pass it to an endpoint to route traffic explicitly.

    Supporting Types

    WebFunctionCode, WebFunctionCodeArgs

    Archive Archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.
    Archive pulumi.Archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.
    archive archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.
    archive Archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.
    archive pulumi.asset.Archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.
    archive pulumi.Archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.
    archive Archive
    Runnable application files, including dependencies. FileArchive accepts a directory or an existing archive.

    WebFunctionRuntime

    NameValueDescription
    NodeJS24Xnodejs24.xNode.js 24.x.
    NODEJS_LATESTnodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.
    NameValueDescription
    WebFunctionRuntimeNodeJS24Xnodejs24.xNode.js 24.x.
    WebFunctionRuntime_NODEJS_LATESTnodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.
    ValueDescription
    nodejs24.xNode.js 24.x.
    nodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.
    NameValueDescription
    NodeJS24Xnodejs24.xNode.js 24.x.
    NODEJS_LATESTnodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.
    NameValueDescription
    NodeJS24Xnodejs24.xNode.js 24.x.
    NODEJS_LATESTnodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.
    NameValueDescription
    NODE_JS24_Xnodejs24.xNode.js 24.x.
    NODEJ_S_LATESTnodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.
    ValueDescription
    nodejs24.xNode.js 24.x.
    nodejs-latestThe latest Node.js runtime selected by AWSX, currently Node.js 24.x. Upgrading AWSX can publish a new revision if this selection changes. Use a versioned runtime to pin it.

    Package Details

    Repository
    AWSx (Pulumi AWS Components) pulumi/pulumi-awsx
    License
    Apache-2.0
    awsx logo awsx logo AWSx (Pulumi Components for AWS)
    Viewing docs for AWSx (Pulumi Components for AWS) v3.15.0
    published on Friday, Nov 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial