GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Why Go
  • Case Studies
  • Use Cases
  • Security
  • Learn
  • Effective Go
  • Go User Manual
  • Standard library
  • Release Notes
  • API
  • Packages
  • Recorded Talks
  • Meetups
  • Conferences

This view

  • Original page
  • New address

GeezerVison is showing pkg.go.dev — awslambdarpc command - github.com/blmayer/awslambdarpc - Go Packages

Details

  • checked Valid go.mod file

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.

  • checked Redistributable license

    Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  • checked Tagged version

    Modules with tagged versions give importers more predictable builds.

  • checked Stable version

    When a project reaches major version v1 it is considered stable.

  • Learn more about best practices

Repository

github.com/blmayer/awslambdarpc

Links

  • Open Source Insights Logo Open Source Insights

README ¶

awslambdarpc

Go Report Card Go Reference

Small utility to make RPC requests to a locally running AWS Lambda, for development purposes.

Installing

Run go get github.com/blmayer/awslambdarpc.

Using

You need a running lambda, let's say in your computer port 3000, then to make a request to it, run:

awslambdarpc -a localhost:3000 -d '{"body": "Hello World!"}'.

Options

You can specify an input event to your lambda in 2 ways:

  • Pointing to a JSON file
  • Writing the JSON as an argument

For pointing to a file use the -e or --event option, e.g.:

awslambdarpc -a localhost:3000 -e example.json,

and passing the input directly is done with the -d or --data option, such as:

awslambdarpc -a localhost:3000 -d '{"body": "Hello World!"}'.

There is also the -h or --help flags that will give you further explanation.

Why?

I couldn't setup a debugger using go and aws-sam-cli, so this way I could just compile the binary for my function, attach the debugger on it and run this utility.

Documentation ¶

Overview ¶

awslambdarpc is an utility to make requests to your local AWS Lambda.

This tool is a CLI, and running awslambdarpc help will show your options. It uses the client package for the real interaction with AWS Lambda, you can import and use it if you wish.

Usage:

awslambdarpc [options]

Available options:

-a, --address
	the address of your local running function, defaults to localhost:8080
-e, --event
	path to the event JSON to be used as input
-d, --data
	data passed to the function as input, in JSON format, defaults to "{}"
-l, --execution-limit
	maximum execution limit for your handler, expressed as a duration, defaults to 15s
help, -h, --help
	show this help

To make a request to a lambda function running at localhost:3000 and passing the contents of a file, events/input.json as payload:

awslambdarpc -a localhost:3000 -e events/input.json

You can do passing the data directly with the -d flag:

awslambdarpc -a localhost:3000 -d '{"body": "Hello World!"}'

Source Files ¶

View all Source files
  • awslambdarpc.go

Directories ¶

Path Synopsis
client
package client provides the function to make a RPC request to a lambda function and read the response.
package client provides the function to make a RPC request to a lambda function and read the response.
Click to show internal directories.
Click to hide internal directories.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.