AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

CreateFunctionInput

import "github.com/aws/aws-sdk-go/service/lambda"

type CreateFunctionInput struct { Code *FunctionCode `type:"structure" required:"true"` DeadLetterConfig *DeadLetterConfig `type:"structure"` Description *string `type:"string"` Environment *Environment `type:"structure"` FunctionName *string `min:"1" type:"string" required:"true"` Handler *string `type:"string" required:"true"` KMSKeyArn *string `type:"string"` Layers []*string `type:"list"` MemorySize *int64 `min:"128" type:"integer"` Publish *bool `type:"boolean"` Role *string `type:"string" required:"true"` Runtime *string `type:"string" required:"true" enum:"Runtime"` Tags map[string]*string `type:"map"` Timeout *int64 `min:"1" type:"integer"` TracingConfig *TracingConfig `type:"structure"` VpcConfig *VpcConfig `type:"structure"` }

Code

The code for the Lambda function. You can specify either an object in Amazon S3, or upload a deployment package directly.

DeadLetterConfig

The dead letter queue (https://docs.aws.amazon.com/lambda/latest/dg/dlq.html) for failed asynchronous invocations.

Description

Type: *string

A description of the function.

Environment

A function's environment variable settings.

FunctionName

Type: *string

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.

FunctionName is a required field

Handler

Type: *string

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

Handler is a required field

KMSKeyArn

Type: *string

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

Layers

Type: []*string

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

Type: *int64

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

Publish

Type: *bool

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

Role

Type: *string

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

Role is a required field

Runtime

Type: *string

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

Runtime is a required field

Tags

Type: map[string]*string

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

Timeout

Type: *int64

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.

TracingConfig

The function's AWS X-Ray tracing configuration.

VpcConfig

The VPC security groups and subnets that are attached to a Lambda function.

Method

GoString

func (s CreateFunctionInput) GoString() string

GoString returns the string representation

SetCode

func (s *CreateFunctionInput) SetCode(v *FunctionCode) *CreateFunctionInput

SetCode sets the Code field's value.

SetDeadLetterConfig

func (s *CreateFunctionInput) SetDeadLetterConfig(v *DeadLetterConfig) *CreateFunctionInput

SetDeadLetterConfig sets the DeadLetterConfig field's value.

SetDescription

func (s *CreateFunctionInput) SetDescription(v string) *CreateFunctionInput

SetDescription sets the Description field's value.

SetEnvironment

func (s *CreateFunctionInput) SetEnvironment(v *Environment) *CreateFunctionInput

SetEnvironment sets the Environment field's value.

SetFunctionName

func (s *CreateFunctionInput) SetFunctionName(v string) *CreateFunctionInput

SetFunctionName sets the FunctionName field's value.

SetHandler

func (s *CreateFunctionInput) SetHandler(v string) *CreateFunctionInput

SetHandler sets the Handler field's value.

SetKMSKeyArn

func (s *CreateFunctionInput) SetKMSKeyArn(v string) *CreateFunctionInput

SetKMSKeyArn sets the KMSKeyArn field's value.

SetLayers

func (s *CreateFunctionInput) SetLayers(v []*string) *CreateFunctionInput

SetLayers sets the Layers field's value.

SetMemorySize

func (s *CreateFunctionInput) SetMemorySize(v int64) *CreateFunctionInput

SetMemorySize sets the MemorySize field's value.

SetPublish

func (s *CreateFunctionInput) SetPublish(v bool) *CreateFunctionInput

SetPublish sets the Publish field's value.

SetRole

func (s *CreateFunctionInput) SetRole(v string) *CreateFunctionInput

SetRole sets the Role field's value.

SetRuntime

func (s *CreateFunctionInput) SetRuntime(v string) *CreateFunctionInput

SetRuntime sets the Runtime field's value.

SetTags

func (s *CreateFunctionInput) SetTags(v map[string]*string) *CreateFunctionInput

SetTags sets the Tags field's value.

SetTimeout

func (s *CreateFunctionInput) SetTimeout(v int64) *CreateFunctionInput

SetTimeout sets the Timeout field's value.

SetTracingConfig

func (s *CreateFunctionInput) SetTracingConfig(v *TracingConfig) *CreateFunctionInput

SetTracingConfig sets the TracingConfig field's value.

SetVpcConfig

func (s *CreateFunctionInput) SetVpcConfig(v *VpcConfig) *CreateFunctionInput

SetVpcConfig sets the VpcConfig field's value.

String

func (s CreateFunctionInput) String() string

String returns the string representation

Validate

func (s *CreateFunctionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: