Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created example for creating an AWS Lambda in Go #553

Merged
merged 6 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed something somehow
  • Loading branch information
Tasia Halim authored and Tasia Halim committed Feb 12, 2020
commit 28431c60721ff1a7b1c2332fbd7881f6d8846b71
12 changes: 0 additions & 12 deletions aws-go-lambda/function/function.go

This file was deleted.

Binary file added aws-go-lambda/handler/handler
Binary file not shown.
13 changes: 13 additions & 0 deletions aws-go-lambda/handler/handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package handler

import (
"github.com/aws/aws-lambda-go/lambda"
)

func Handler() (string, error) {
return "hello", nil
}

func main() {
lambda.Start(Handler)
}
Binary file added aws-go-lambda/handler/handler.zip
Binary file not shown.
6 changes: 4 additions & 2 deletions aws-go-lambda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/pulumi/pulumi-aws/sdk/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/go/aws/lambda"
"github.com/pulumi/pulumi/sdk/go/pulumi"

_ "github.com/pulumi/examples/aws-go-lambda/handler"
)

func main() {
Expand All @@ -28,10 +30,10 @@ func main() {

// Set arguments for constructing the function resource.
args := &lambda.FunctionArgs{
Handler: pulumi.String("function"),
Handler: pulumi.String("handler"),
Role: role.Arn,
Runtime: pulumi.String("go1.x"),
Code: pulumi.NewFileArchive("function"),
Code: pulumi.NewFileArchive("./handler/handler.zip"),
}

// Create the lambda using the args.
Expand Down