Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
/ go-lambda-ping Public archive
forked from frankcash/go-lambda-ping

Deploy a Lambda to Ping a Site in 20 Seconds!

License

Notifications You must be signed in to change notification settings

stockx/go-lambda-ping

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 := "<desired-site>" 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

About

Deploy a Lambda to Ping a Site in 20 Seconds!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 60.6%
  • Go 30.4%
  • Makefile 9.0%