The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Paws::Lambda::CreateFunction - Arguments for method CreateFunction on Paws::Lambda

DESCRIPTION

This class represents the parameters used for calling the method CreateFunction on the AWS Lambda service. Use the attributes of this class as arguments to method CreateFunction.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateFunction.

SYNOPSIS

    my $lambda = Paws->service('Lambda');
  # To create a function
  # The following example creates a function with a deployment package in Amazon
  # S3 and enables X-Ray tracing and environment variable encryption.
    my $FunctionConfiguration = $lambda->CreateFunction(
      'Code' => {
        'S3Bucket' => 'my-bucket-1xpuxmplzrlbh',
        'S3Key'    => 'function.zip'
      },
      'Description' => 'Process image objects from Amazon S3.',
      'Environment' => {
        'Variables' => {
          'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
          'PREFIX' => 'inbound'
        }
      },
      'FunctionName' => 'my-function',
      'Handler'      => 'index.handler',
      'KMSKeyArn'    =>
'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
      'MemorySize' => 256,
      'Publish'    => 1,
      'Role'       => 'arn:aws:iam::123456789012:role/lambda-role',
      'Runtime'    => 'nodejs12.x',
      'Tags'       => {
        'DEPARTMENT' => 'Assets'
      },
      'Timeout'       => 15,
      'TracingConfig' => {
        'Mode' => 'Active'
      }
    );

    # Results:
    my $CodeSha256       = $FunctionConfiguration->CodeSha256;
    my $CodeSize         = $FunctionConfiguration->CodeSize;
    my $Description      = $FunctionConfiguration->Description;
    my $Environment      = $FunctionConfiguration->Environment;
    my $FunctionArn      = $FunctionConfiguration->FunctionArn;
    my $FunctionName     = $FunctionConfiguration->FunctionName;
    my $Handler          = $FunctionConfiguration->Handler;
    my $KMSKeyArn        = $FunctionConfiguration->KMSKeyArn;
    my $LastModified     = $FunctionConfiguration->LastModified;
    my $LastUpdateStatus = $FunctionConfiguration->LastUpdateStatus;
    my $MemorySize       = $FunctionConfiguration->MemorySize;
    my $RevisionId       = $FunctionConfiguration->RevisionId;
    my $Role             = $FunctionConfiguration->Role;
    my $Runtime          = $FunctionConfiguration->Runtime;
    my $State            = $FunctionConfiguration->State;
    my $Timeout          = $FunctionConfiguration->Timeout;
    my $TracingConfig    = $FunctionConfiguration->TracingConfig;
    my $Version          = $FunctionConfiguration->Version;

    # Returns a L<Paws::Lambda::FunctionConfiguration> object.

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. For the AWS API documentation, see https://docs.aws.amazon.com/goto/WebAPI/lambda/CreateFunction

ATTRIBUTES

REQUIRED Code => Paws::Lambda::FunctionCode

The code for the function.

CodeSigningConfigArn => Str

To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.

DeadLetterConfig => Paws::Lambda::DeadLetterConfig

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead Letter Queues (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq).

Description => Str

A description of the function.

Environment => Paws::Lambda::Environment

Environment variables that are accessible from function code during execution.

FileSystemConfigs => ArrayRef[Paws::Lambda::FileSystemConfig]

Connection settings for an Amazon EFS file system.

REQUIRED FunctionName => Str

The name of the Lambda function.

Name formats

  • Function name - my-function.

  • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN - 123456789012:function:my-function.

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Handler => Str

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model (https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html).

ImageConfig => Paws::Lambda::ImageConfig

Container image configuration values (https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile.

KMSKeyArn => Str

The ARN of the Amazon Web Services Key Management Service (KMS) key that's used to encrypt your function's environment variables. If it's not provided, Lambda uses a default service key.

Layers => ArrayRef[Str|Undef]

A list of function layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version.

MemorySize => Int

The amount of memory available to the function (https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.

PackageType => Str

The type of deployment package. Set to Image for container image and set Zip for ZIP archive.

Valid values are: "Zip", "Image"

Publish => Bool

Set to true to publish the first version of the function during creation.

REQUIRED Role => Str

The Amazon Resource Name (ARN) of the function's execution role.

Runtime => Str

The identifier of the function's runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).

Valid values are: "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2"

Tags => Paws::Lambda::Tags

A list of tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function.

Timeout => Int

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For additional information, see Lambda execution environment (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html).

TracingConfig => Paws::Lambda::TracingConfig

Set Mode to Active to sample and trace a subset of incoming requests with X-Ray (https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html).

VpcConfig => Paws::Lambda::VpcConfig

For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can only access resources and the internet through that VPC. For more information, see VPC Settings (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html).

SEE ALSO

This class forms part of Paws, documenting arguments for method CreateFunction in Paws::Lambda

BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues