AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

getFunction

Provides information about a Lambda Function.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var functionName = config.Require("functionName");
        var existing = Output.Create(Aws.Lambda.GetFunction.InvokeAsync(new Aws.Lambda.GetFunctionArgs
        {
            FunctionName = functionName,
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lambda"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		functionName := cfg.Require("functionName")
		_, err := lambda.LookupFunction(ctx, &lambda.LookupFunctionArgs{
			FunctionName: functionName,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var functionName = config.get("functionName");
        final var existing = Output.of(LambdaFunctions.getFunction(GetFunctionArgs.builder()
            .functionName(functionName)
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

config = pulumi.Config()
function_name = config.require("functionName")
existing = aws.lambda.get_function(function_name=function_name)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const functionName = config.require("functionName");
const existing = aws.lambda.getFunction({
    functionName: functionName,
});
configuration:
  functionName:
    type: string
variables:
  existing:
    Fn::Invoke:
      Function: aws:lambda:getFunction
      Arguments:
        functionName: ${functionName}

Using getFunction

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getFunction(args: GetFunctionArgs, opts?: InvokeOptions): Promise<GetFunctionResult>
function getFunctionOutput(args: GetFunctionOutputArgs, opts?: InvokeOptions): Output<GetFunctionResult>
def get_function(function_name: Optional[str] = None,
                 qualifier: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetFunctionResult
def get_function_output(function_name: Optional[pulumi.Input[str]] = None,
                 qualifier: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetFunctionResult]
func LookupFunction(ctx *Context, args *LookupFunctionArgs, opts ...InvokeOption) (*LookupFunctionResult, error)
func LookupFunctionOutput(ctx *Context, args *LookupFunctionOutputArgs, opts ...InvokeOption) LookupFunctionResultOutput

> Note: This function is named LookupFunction in the Go SDK.

public static class GetFunction 
{
    public static Task<GetFunctionResult> InvokeAsync(GetFunctionArgs args, InvokeOptions? opts = null)
    public static Output<GetFunctionResult> Invoke(GetFunctionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFunctionResult> getFunction(GetFunctionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:lambda/getFunction:getFunction
  Arguments:
    # Arguments dictionary

The following arguments are supported:

FunctionName string

Name of the lambda function.

Qualifier string

Alias name or version number of the lambda functionE.g., $LATEST, my-alias, or 1

Tags Dictionary<string, string>
FunctionName string

Name of the lambda function.

Qualifier string

Alias name or version number of the lambda functionE.g., $LATEST, my-alias, or 1

Tags map[string]string
functionName String

Name of the lambda function.

qualifier String

Alias name or version number of the lambda functionE.g., $LATEST, my-alias, or 1

tags Map<String,String>
functionName string

Name of the lambda function.

qualifier string

Alias name or version number of the lambda functionE.g., $LATEST, my-alias, or 1

tags {[key: string]: string}
function_name str

Name of the lambda function.

qualifier str

Alias name or version number of the lambda functionE.g., $LATEST, my-alias, or 1

tags Mapping[str, str]
functionName String

Name of the lambda function.

qualifier String

Alias name or version number of the lambda functionE.g., $LATEST, my-alias, or 1

tags Map<String>

getFunction Result

The following output properties are available:

Architectures List<string>

The instruction set architecture for the Lambda function.

Arn string

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

CodeSigningConfigArn string

Amazon Resource Name (ARN) for a Code Signing Configuration.

DeadLetterConfig GetFunctionDeadLetterConfig

Configure the function's dead letter queue.

Description string

Description of what your Lambda Function does.

Environment GetFunctionEnvironment

The Lambda environment's configuration settings.

EphemeralStorages List<GetFunctionEphemeralStorage>

The amount of Ephemeral storage(/tmp) allocated for the Lambda Function.

FileSystemConfigs List<GetFunctionFileSystemConfig>

The connection settings for an Amazon EFS file system.

FunctionName string
Handler string

The function entrypoint in your code.

Id string

The provider-assigned unique ID for this managed resource.

ImageUri string

The URI of the container image.

InvokeArn string

The ARN to be used for invoking Lambda Function from API Gateway.

KmsKeyArn string

The ARN for the KMS encryption key.

LastModified string

The date this resource was last modified.

Layers List<string>

A list of Lambda Layer ARNs attached to your Lambda Function.

MemorySize int

Amount of memory in MB your Lambda Function can use at runtime.

QualifiedArn string

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

ReservedConcurrentExecutions int

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

Role string

IAM role attached to the Lambda Function.

Runtime string

The runtime environment for the Lambda function.

SigningJobArn string

The Amazon Resource Name (ARN) of a signing job.

SigningProfileVersionArn string

The Amazon Resource Name (ARN) for a signing profile version.

SourceCodeHash string

Base64-encoded representation of raw SHA-256 sum of the zip file.

SourceCodeSize int

The size in bytes of the function .zip file.

Tags Dictionary<string, string>
Timeout int

The function execution time at which Lambda should terminate the function.

TracingConfig GetFunctionTracingConfig

Tracing settings of the function.

Version string

The version of the Lambda function.

VpcConfig GetFunctionVpcConfig

VPC configuration associated with your Lambda function.

Qualifier string
Architectures []string

The instruction set architecture for the Lambda function.

Arn string

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

CodeSigningConfigArn string

Amazon Resource Name (ARN) for a Code Signing Configuration.

DeadLetterConfig GetFunctionDeadLetterConfig

Configure the function's dead letter queue.

Description string

Description of what your Lambda Function does.

Environment GetFunctionEnvironment

The Lambda environment's configuration settings.

EphemeralStorages []GetFunctionEphemeralStorage

The amount of Ephemeral storage(/tmp) allocated for the Lambda Function.

FileSystemConfigs []GetFunctionFileSystemConfig

The connection settings for an Amazon EFS file system.

FunctionName string
Handler string

The function entrypoint in your code.

Id string

The provider-assigned unique ID for this managed resource.

ImageUri string

The URI of the container image.

InvokeArn string

The ARN to be used for invoking Lambda Function from API Gateway.

KmsKeyArn string

The ARN for the KMS encryption key.

LastModified string

The date this resource was last modified.

Layers []string

A list of Lambda Layer ARNs attached to your Lambda Function.

MemorySize int

Amount of memory in MB your Lambda Function can use at runtime.

QualifiedArn string

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

ReservedConcurrentExecutions int

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

Role string

IAM role attached to the Lambda Function.

Runtime string

The runtime environment for the Lambda function.

SigningJobArn string

The Amazon Resource Name (ARN) of a signing job.

SigningProfileVersionArn string

The Amazon Resource Name (ARN) for a signing profile version.

SourceCodeHash string

Base64-encoded representation of raw SHA-256 sum of the zip file.

SourceCodeSize int

The size in bytes of the function .zip file.

Tags map[string]string
Timeout int

The function execution time at which Lambda should terminate the function.

TracingConfig GetFunctionTracingConfig

Tracing settings of the function.

Version string

The version of the Lambda function.

VpcConfig GetFunctionVpcConfig

VPC configuration associated with your Lambda function.

Qualifier string
architectures List<String>

The instruction set architecture for the Lambda function.

arn String

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

codeSigningConfigArn String

Amazon Resource Name (ARN) for a Code Signing Configuration.

deadLetterConfig GetFunctionDeadLetterConfig

Configure the function's dead letter queue.

description String

Description of what your Lambda Function does.

environment GetFunctionEnvironment

The Lambda environment's configuration settings.

ephemeralStorages List<GetFunctionEphemeralStorage>

The amount of Ephemeral storage(/tmp) allocated for the Lambda Function.

fileSystemConfigs List<GetFunctionFileSystemConfig>

The connection settings for an Amazon EFS file system.

functionName String
handler String

The function entrypoint in your code.

id String

The provider-assigned unique ID for this managed resource.

imageUri String

The URI of the container image.

invokeArn String

The ARN to be used for invoking Lambda Function from API Gateway.

kmsKeyArn String

The ARN for the KMS encryption key.

lastModified String

The date this resource was last modified.

layers List<String>

A list of Lambda Layer ARNs attached to your Lambda Function.

memorySize Integer

Amount of memory in MB your Lambda Function can use at runtime.

qualifiedArn String

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

reservedConcurrentExecutions Integer

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

role String

IAM role attached to the Lambda Function.

runtime String

The runtime environment for the Lambda function.

signingJobArn String

The Amazon Resource Name (ARN) of a signing job.

signingProfileVersionArn String

The Amazon Resource Name (ARN) for a signing profile version.

sourceCodeHash String

Base64-encoded representation of raw SHA-256 sum of the zip file.

sourceCodeSize Integer

The size in bytes of the function .zip file.

tags Map<String,String>
timeout Integer

The function execution time at which Lambda should terminate the function.

tracingConfig GetFunctionTracingConfig

Tracing settings of the function.

version String

The version of the Lambda function.

vpcConfig GetFunctionVpcConfig

VPC configuration associated with your Lambda function.

qualifier String
architectures string[]

The instruction set architecture for the Lambda function.

arn string

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

codeSigningConfigArn string

Amazon Resource Name (ARN) for a Code Signing Configuration.

deadLetterConfig GetFunctionDeadLetterConfig

Configure the function's dead letter queue.

description string

Description of what your Lambda Function does.

environment GetFunctionEnvironment

The Lambda environment's configuration settings.

ephemeralStorages GetFunctionEphemeralStorage[]

The amount of Ephemeral storage(/tmp) allocated for the Lambda Function.

fileSystemConfigs GetFunctionFileSystemConfig[]

The connection settings for an Amazon EFS file system.

functionName string
handler string

The function entrypoint in your code.

id string

The provider-assigned unique ID for this managed resource.

imageUri string

The URI of the container image.

invokeArn string

The ARN to be used for invoking Lambda Function from API Gateway.

kmsKeyArn string

The ARN for the KMS encryption key.

lastModified string

The date this resource was last modified.

layers string[]

A list of Lambda Layer ARNs attached to your Lambda Function.

memorySize number

Amount of memory in MB your Lambda Function can use at runtime.

qualifiedArn string

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

reservedConcurrentExecutions number

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

role string

IAM role attached to the Lambda Function.

runtime string

The runtime environment for the Lambda function.

signingJobArn string

The Amazon Resource Name (ARN) of a signing job.

signingProfileVersionArn string

The Amazon Resource Name (ARN) for a signing profile version.

sourceCodeHash string

Base64-encoded representation of raw SHA-256 sum of the zip file.

sourceCodeSize number

The size in bytes of the function .zip file.

tags {[key: string]: string}
timeout number

The function execution time at which Lambda should terminate the function.

tracingConfig GetFunctionTracingConfig

Tracing settings of the function.

version string

The version of the Lambda function.

vpcConfig GetFunctionVpcConfig

VPC configuration associated with your Lambda function.

qualifier string
architectures Sequence[str]

The instruction set architecture for the Lambda function.

arn str

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

code_signing_config_arn str

Amazon Resource Name (ARN) for a Code Signing Configuration.

dead_letter_config GetFunctionDeadLetterConfig

Configure the function's dead letter queue.

description str

Description of what your Lambda Function does.

environment GetFunctionEnvironment

The Lambda environment's configuration settings.

ephemeral_storages GetFunctionEphemeralStorage]

The amount of Ephemeral storage(/tmp) allocated for the Lambda Function.

file_system_configs GetFunctionFileSystemConfig]

The connection settings for an Amazon EFS file system.

function_name str
handler str

The function entrypoint in your code.

id str

The provider-assigned unique ID for this managed resource.

image_uri str

The URI of the container image.

invoke_arn str

The ARN to be used for invoking Lambda Function from API Gateway.

kms_key_arn str

The ARN for the KMS encryption key.

last_modified str

The date this resource was last modified.

layers Sequence[str]

A list of Lambda Layer ARNs attached to your Lambda Function.

memory_size int

Amount of memory in MB your Lambda Function can use at runtime.

qualified_arn str

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

reserved_concurrent_executions int

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

role str

IAM role attached to the Lambda Function.

runtime str

The runtime environment for the Lambda function.

signing_job_arn str

The Amazon Resource Name (ARN) of a signing job.

signing_profile_version_arn str

The Amazon Resource Name (ARN) for a signing profile version.

source_code_hash str

Base64-encoded representation of raw SHA-256 sum of the zip file.

source_code_size int

The size in bytes of the function .zip file.

tags Mapping[str, str]
timeout int

The function execution time at which Lambda should terminate the function.

tracing_config GetFunctionTracingConfig

Tracing settings of the function.

version str

The version of the Lambda function.

vpc_config GetFunctionVpcConfig

VPC configuration associated with your Lambda function.

qualifier str
architectures List<String>

The instruction set architecture for the Lambda function.

arn String

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

codeSigningConfigArn String

Amazon Resource Name (ARN) for a Code Signing Configuration.

deadLetterConfig Property Map

Configure the function's dead letter queue.

description String

Description of what your Lambda Function does.

environment Property Map

The Lambda environment's configuration settings.

ephemeralStorages List<Property Map>

The amount of Ephemeral storage(/tmp) allocated for the Lambda Function.

fileSystemConfigs List<Property Map>

The connection settings for an Amazon EFS file system.

functionName String
handler String

The function entrypoint in your code.

id String

The provider-assigned unique ID for this managed resource.

imageUri String

The URI of the container image.

invokeArn String

The ARN to be used for invoking Lambda Function from API Gateway.

kmsKeyArn String

The ARN for the KMS encryption key.

lastModified String

The date this resource was last modified.

layers List<String>

A list of Lambda Layer ARNs attached to your Lambda Function.

memorySize Number

Amount of memory in MB your Lambda Function can use at runtime.

qualifiedArn String

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

reservedConcurrentExecutions Number

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

role String

IAM role attached to the Lambda Function.

runtime String

The runtime environment for the Lambda function.

signingJobArn String

The Amazon Resource Name (ARN) of a signing job.

signingProfileVersionArn String

The Amazon Resource Name (ARN) for a signing profile version.

sourceCodeHash String

Base64-encoded representation of raw SHA-256 sum of the zip file.

sourceCodeSize Number

The size in bytes of the function .zip file.

tags Map<String>
timeout Number

The function execution time at which Lambda should terminate the function.

tracingConfig Property Map

Tracing settings of the function.

version String

The version of the Lambda function.

vpcConfig Property Map

VPC configuration associated with your Lambda function.

qualifier String

Supporting Types

GetFunctionDeadLetterConfig

TargetArn string
TargetArn string
targetArn String
targetArn string
targetArn String

GetFunctionEnvironment

Variables Dictionary<string, string>
Variables map[string]string
variables Map<String,String>
variables {[key: string]: string}
variables Mapping[str, str]
variables Map<String>

GetFunctionEphemeralStorage

Size int
Size int
size Integer
size number
size int
size Number

GetFunctionFileSystemConfig

Arn string

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

LocalMountPath string
Arn string

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

LocalMountPath string
arn String

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

localMountPath String
arn string

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

localMountPath string
arn str

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

local_mount_path str
arn String

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualified_arn.

localMountPath String

GetFunctionTracingConfig

Mode string
Mode string
mode String
mode string
mode str
mode String

GetFunctionVpcConfig

SecurityGroupIds List<string>
SubnetIds List<string>
VpcId string
SecurityGroupIds []string
SubnetIds []string
VpcId string
securityGroupIds List<String>
subnetIds List<String>
vpcId String
securityGroupIds string[]
subnetIds string[]
vpcId string
security_group_ids Sequence[str]
subnet_ids Sequence[str]
vpc_id str
securityGroupIds List<String>
subnetIds List<String>
vpcId String

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.