Need help with go-lambda-ping?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

frankcash
195 Stars 8 Forks MIT License 9 Commits 0 Opened issues

Description

Deploy a Lambda to Ping a Site in 20 Seconds!

Services available

!
?

Need anything else?

Contributors list

# 26,185
yahoo-f...
algorit...
golang
cpluspl...
9 commits

go-lambda-ping

A simple program that will build the infrastructure to ping a website.

Gathering Dependencies

go get github.com/aws/aws-lambda-go/lambda

Configuration

The Go program exists inside of

function/
.
main.tf
is the Terraform configuration for the Lambda.

Configuring the Site

Change

url := "http://example.com/"
to
url := ""
in
function/function.go
.

Building the Zip

In the

function
directory run
make release
to generate the binary and then zip it.

Deploying the Lambda

  1. Run

    terraform init
    to initialize the terraform repository.
  2. Then run

    terraform plan
    to create the execution plan.
  3. Finally,

    terraform apply
    to apply the changes (run the execution plan).

Trigger the Lambda

aws lambda invoke \
--invocation-type RequestResponse \
--function-name demo_lambda \
--region us-east-1 \
--log-type Tail \
--payload '{"key1":"value1", "key2":"value2", "key3":"value3"}' \
outputfile.txt

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.