set GO111MODULE=on
go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip
Use the tool from your GOPATH:
set GOOS=linux
set GOARCH=amd64
set CGO_ENABLED=0
go build -o handler\handler handler\handler.go
%USERPROFILE%\Go\bin\build-lambda-zip.exe -o handler\handler.zip handler\handler
Create a new stack, which is an isolated deployment target for this example:
pulumi stack init
Install dependencies:
go mod download
Set the AWS region to deploy into:
pulumi config set aws:region us-west-2
Deploy the stack:
pulumi up
Updating (dev):
Type Name Status
+ pulumi:pulumi:Stack go-lambda-dev created
+ ├─ aws:apigateway:RestApi UpperCaseGateway created
+ ├─ aws:iam:Role task-exec-role created
+ ├─ aws:apigateway:Resource UpperAPI created
+ ├─ aws:iam:RolePolicy lambda-log-policy created
+ ├─ aws:apigateway:Method AnyMethod created
+ ├─ aws:lambda:Function basicLambda created
+ ├─ aws:apigateway:Integration LambdaIntegration created
+ ├─ aws:lambda:Permission APIPermission created
+ └─ aws:apigateway:Deployment APIDeployment created
Outputs:
invocation URL: "https://<gateway-id>.execute-api.us-west-2.amazonaws.com/prod/{message}"
Resources:
+ 10 created
Duration: 29s