1. Packages
  2. AWS Classic
  3. API Docs
  4. lambda
  5. getFunction

Try AWS Native preview for resources not in the classic version.

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

aws.lambda.getFunction

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

    Provides information about a Lambda Function.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var functionName = config.Require("functionName");
        var existing = Aws.Lambda.GetFunction.Invoke(new()
        {
            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 com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lambda.LambdaFunctions;
    import com.pulumi.aws.lambda.inputs.GetFunctionArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    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 = 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. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version.

    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. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version.

    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. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version.

    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. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version.

    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. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version.

    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. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version.

    tags Map<String>

    getFunction Result

    The following output properties are available:

    Architectures List<string>

    Instruction set architecture for the Lambda function.

    Arn string

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

    CodeSigningConfigArn string

    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

    Lambda environment's configuration settings.

    EphemeralStorages List<GetFunctionEphemeralStorage>

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

    FileSystemConfigs List<GetFunctionFileSystemConfig>

    Connection settings for an Amazon EFS file system.

    FunctionName string
    Handler string

    Function entrypoint in your code.

    Id string

    The provider-assigned unique ID for this managed resource.

    ImageUri string

    URI of the container image.

    InvokeArn string

    ARN to be used for invoking Lambda Function from API Gateway. NOTE: Starting with v4.51.0 of the provider, this will not include the qualifier.

    KmsKeyArn string

    ARN for the KMS encryption key.

    LastModified string

    Date this resource was last modified.

    Layers List<string>

    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) ARN identifying your Lambda Function. See also arn.

    QualifiedInvokeArn string

    Qualified (:QUALIFIER or :VERSION suffix) ARN to be used for invoking Lambda Function from API Gateway. See also invoke_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

    Runtime environment for the Lambda function.

    SigningJobArn string

    ARN of a signing job.

    SigningProfileVersionArn string

    The ARN for a signing profile version.

    SourceCodeHash string

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

    SourceCodeSize int

    Size in bytes of the function .zip file.

    Tags Dictionary<string, string>
    Timeout int

    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 returned. If qualifier is not set, this will resolve to the most recent published version. If no published version of the function exists, version will resolve to $LATEST.

    VpcConfig GetFunctionVpcConfig

    VPC configuration associated with your Lambda function.

    Qualifier string
    Architectures []string

    Instruction set architecture for the Lambda function.

    Arn string

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

    CodeSigningConfigArn string

    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

    Lambda environment's configuration settings.

    EphemeralStorages []GetFunctionEphemeralStorage

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

    FileSystemConfigs []GetFunctionFileSystemConfig

    Connection settings for an Amazon EFS file system.

    FunctionName string
    Handler string

    Function entrypoint in your code.

    Id string

    The provider-assigned unique ID for this managed resource.

    ImageUri string

    URI of the container image.

    InvokeArn string

    ARN to be used for invoking Lambda Function from API Gateway. NOTE: Starting with v4.51.0 of the provider, this will not include the qualifier.

    KmsKeyArn string

    ARN for the KMS encryption key.

    LastModified string

    Date this resource was last modified.

    Layers []string

    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) ARN identifying your Lambda Function. See also arn.

    QualifiedInvokeArn string

    Qualified (:QUALIFIER or :VERSION suffix) ARN to be used for invoking Lambda Function from API Gateway. See also invoke_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

    Runtime environment for the Lambda function.

    SigningJobArn string

    ARN of a signing job.

    SigningProfileVersionArn string

    The ARN for a signing profile version.

    SourceCodeHash string

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

    SourceCodeSize int

    Size in bytes of the function .zip file.

    Tags map[string]string
    Timeout int

    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 returned. If qualifier is not set, this will resolve to the most recent published version. If no published version of the function exists, version will resolve to $LATEST.

    VpcConfig GetFunctionVpcConfig

    VPC configuration associated with your Lambda function.

    Qualifier string
    architectures List<String>

    Instruction set architecture for the Lambda function.

    arn String

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

    codeSigningConfigArn String

    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

    Lambda environment's configuration settings.

    ephemeralStorages List<GetFunctionEphemeralStorage>

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

    fileSystemConfigs List<GetFunctionFileSystemConfig>

    Connection settings for an Amazon EFS file system.

    functionName String
    handler String

    Function entrypoint in your code.

    id String

    The provider-assigned unique ID for this managed resource.

    imageUri String

    URI of the container image.

    invokeArn String

    ARN to be used for invoking Lambda Function from API Gateway. NOTE: Starting with v4.51.0 of the provider, this will not include the qualifier.

    kmsKeyArn String

    ARN for the KMS encryption key.

    lastModified String

    Date this resource was last modified.

    layers List<String>

    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) ARN identifying your Lambda Function. See also arn.

    qualifiedInvokeArn String

    Qualified (:QUALIFIER or :VERSION suffix) ARN to be used for invoking Lambda Function from API Gateway. See also invoke_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

    Runtime environment for the Lambda function.

    signingJobArn String

    ARN of a signing job.

    signingProfileVersionArn String

    The ARN for a signing profile version.

    sourceCodeHash String

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

    sourceCodeSize Integer

    Size in bytes of the function .zip file.

    tags Map<String,String>
    timeout Integer

    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 returned. If qualifier is not set, this will resolve to the most recent published version. If no published version of the function exists, version will resolve to $LATEST.

    vpcConfig GetFunctionVpcConfig

    VPC configuration associated with your Lambda function.

    qualifier String
    architectures string[]

    Instruction set architecture for the Lambda function.

    arn string

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

    codeSigningConfigArn string

    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

    Lambda environment's configuration settings.

    ephemeralStorages GetFunctionEphemeralStorage[]

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

    fileSystemConfigs GetFunctionFileSystemConfig[]

    Connection settings for an Amazon EFS file system.

    functionName string
    handler string

    Function entrypoint in your code.

    id string

    The provider-assigned unique ID for this managed resource.

    imageUri string

    URI of the container image.

    invokeArn string

    ARN to be used for invoking Lambda Function from API Gateway. NOTE: Starting with v4.51.0 of the provider, this will not include the qualifier.

    kmsKeyArn string

    ARN for the KMS encryption key.

    lastModified string

    Date this resource was last modified.

    layers string[]

    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) ARN identifying your Lambda Function. See also arn.

    qualifiedInvokeArn string

    Qualified (:QUALIFIER or :VERSION suffix) ARN to be used for invoking Lambda Function from API Gateway. See also invoke_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

    Runtime environment for the Lambda function.

    signingJobArn string

    ARN of a signing job.

    signingProfileVersionArn string

    The ARN for a signing profile version.

    sourceCodeHash string

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

    sourceCodeSize number

    Size in bytes of the function .zip file.

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

    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 returned. If qualifier is not set, this will resolve to the most recent published version. If no published version of the function exists, version will resolve to $LATEST.

    vpcConfig GetFunctionVpcConfig

    VPC configuration associated with your Lambda function.

    qualifier string
    architectures Sequence[str]

    Instruction set architecture for the Lambda function.

    arn str

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

    code_signing_config_arn str

    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

    Lambda environment's configuration settings.

    ephemeral_storages GetFunctionEphemeralStorage]

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

    file_system_configs GetFunctionFileSystemConfig]

    Connection settings for an Amazon EFS file system.

    function_name str
    handler str

    Function entrypoint in your code.

    id str

    The provider-assigned unique ID for this managed resource.

    image_uri str

    URI of the container image.

    invoke_arn str

    ARN to be used for invoking Lambda Function from API Gateway. NOTE: Starting with v4.51.0 of the provider, this will not include the qualifier.

    kms_key_arn str

    ARN for the KMS encryption key.

    last_modified str

    Date this resource was last modified.

    layers Sequence[str]

    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) ARN identifying your Lambda Function. See also arn.

    qualified_invoke_arn str

    Qualified (:QUALIFIER or :VERSION suffix) ARN to be used for invoking Lambda Function from API Gateway. See also invoke_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

    Runtime environment for the Lambda function.

    signing_job_arn str

    ARN of a signing job.

    signing_profile_version_arn str

    The 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

    Size in bytes of the function .zip file.

    tags Mapping[str, str]
    timeout int

    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 returned. If qualifier is not set, this will resolve to the most recent published version. If no published version of the function exists, version will resolve to $LATEST.

    vpc_config GetFunctionVpcConfig

    VPC configuration associated with your Lambda function.

    qualifier str
    architectures List<String>

    Instruction set architecture for the Lambda function.

    arn String

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

    codeSigningConfigArn String

    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

    Lambda environment's configuration settings.

    ephemeralStorages List<Property Map>

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

    fileSystemConfigs List<Property Map>

    Connection settings for an Amazon EFS file system.

    functionName String
    handler String

    Function entrypoint in your code.

    id String

    The provider-assigned unique ID for this managed resource.

    imageUri String

    URI of the container image.

    invokeArn String

    ARN to be used for invoking Lambda Function from API Gateway. NOTE: Starting with v4.51.0 of the provider, this will not include the qualifier.

    kmsKeyArn String

    ARN for the KMS encryption key.

    lastModified String

    Date this resource was last modified.

    layers List<String>

    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) ARN identifying your Lambda Function. See also arn.

    qualifiedInvokeArn String

    Qualified (:QUALIFIER or :VERSION suffix) ARN to be used for invoking Lambda Function from API Gateway. See also invoke_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

    Runtime environment for the Lambda function.

    signingJobArn String

    ARN of a signing job.

    signingProfileVersionArn String

    The ARN for a signing profile version.

    sourceCodeHash String

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

    sourceCodeSize Number

    Size in bytes of the function .zip file.

    tags Map<String>
    timeout Number

    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 returned. If qualifier is not set, this will resolve to the most recent published version. If no published version of the function exists, version will resolve to $LATEST.

    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) ARN identifying your Lambda Function. See also qualified_arn.

    LocalMountPath string
    Arn string

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

    LocalMountPath string
    arn String

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

    localMountPath String
    arn string

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

    localMountPath string
    arn str

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

    local_mount_path str
    arn String

    Unqualified (no :QUALIFIER or :VERSION suffix) 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
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi