serverless

package
v0.0.0-...-3ff568a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GO_Runtime         = awslambda.Runtime_GO_1_X()
	PROVIDED_Runtime   = awslambda.Runtime_PROVIDED_AL2()
	X86_Architecture   = awslambda.Architecture_X86_64()
	ARM64_Architecture = awslambda.Architecture_ARM_64()
)

Functions

func NewLambdaFunction

func NewLambdaFunction(scope constructs.Construct, id string, opts *LambdaOpts) awslambda.Function

NewLambdaFunction builds a Go Lambda with sensible defaults.

Types

type BuildOpts

type BuildOpts struct {
	ForceContainer      bool
	Environment         map[string]*string
	BundleImageOverride awscdk.DockerImage
}

type LambdaOpts

type LambdaOpts struct {
	FunctionName        string
	FunctionDescription string
	CodeURI             string
	Handler             string
	Runtime             awslambda.Runtime
	Architecture        awslambda.Architecture
	BuildOpts
}

LambdaOpts is a collection of options for configuring an AWS Lambda Function.

CodeURI is the relative path from the project root to the source directory. Handler is the name of the executable that will run in the Lambda environment.

type LocalBundler

type LocalBundler struct {
	CodeUri string
	Handler string
	// contains filtered or unexported fields
}

LocalBundler satisfies the awscdk.ILocalBundling interface by implementing TryBundle. It will run go build so that the CDK can bundle the function assets correctly.

The implementation of the interface must be a struct as it must be a marshalable object in Go, therefore a functional approach is not possible.

func (*LocalBundler) TryBundle

func (lb *LocalBundler) TryBundle(outputDir *string, options *awscdk.BundlingOptions) *bool

TryBundle is used to build the Lambda function in the local environment. It returns `false` if unable to build the function, and `true` if it was successful. It will place the build output in the provided `outputDir`.

For more information see: https://aws.amazon.com/blogs/devops/building-apps-with-aws-cdk/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL