serverless

command
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 3 Imported by: 0

README

Serverless

This example demonstrates how to deploy a single function using Serverless that handles both API Gateway and ALB Target Group events. The basic handler is defined in main.go and the event handlers are specified in serverless.yml.

Deploy

The following steps can be used to deploy the function to AWS. Please be aware that this may incur AWS costs.

Invoke

The Lambda function can be invoked via either the ALB DNS record or the API Gateway endpoints.

  • Copy the API Gateway endpoint from the serveress output
  • Invoke the function using API Gateway, e.g. curl https://{value}.execute-api.eu-west-1.amazonaws.com/dev/resource?a=1
  • Get the ALB DNS, e.g. aws cloudformation describe-stacks --region eu-west-1 --stack-name chop-example-dev | grep elb.amazonaws.com
  • Invoke the function using the ALB Target Group, e.g. curl chop-example-dev-{value}.eu-west-1.elb.amazonaws.com/resource?a=1

Remove

  • Run make remove to delete the CloudFormation stack and clean the working directory

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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