Skip to content

Commit 18f111f

Browse files
authored
Merge pull request #116 from benkehoe/patch-1
Update lambda-go-how-to-create-deployment-package.md for #115
2 parents 8493715 + bbb836a commit 18f111f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc_source/lambda-go-how-to-create-deployment-package.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# AWS Lambda Deployment Package in Go<a name="lambda-go-how-to-create-deployment-package"></a>
22

3-
To create a Lambda function you first create a Lambda function deployment package, a \.zip file consisting of your code and any dependencies\.
3+
To create a Lambda function you first create a Lambda function deployment package, a \.zip file consisting of your code (a Go executable) and any dependencies\.
44

55
After you create a deployment package, you may either upload it directly or upload the \.zip file first to an Amazon S3 bucket in the same AWS region where you want to create the Lambda function, and then specify the bucket name and object key name when you create the Lambda function using the console or the AWS CLI\.
66

77
For Lambda functions written in Go, download the Lambda library for Go by navigating to the Go runtime directory and enter the following command: `go get github.com/aws/aws-lambda-go/lambda`
88

9-
Then use following command to build, package and deploy a Go Lambda function via the CLI\. Note that your *function\-name *must match the name of your *Lambda handler* name\.
9+
Then use following command to build, package and deploy a Go Lambda function via the CLI\. Note that the *handler* parameter must match the name of the executable containing your Lambda handler\.
1010

1111
```
1212
GOOS=linux go build lambda_handler.go
1313
zip handler.zip ./lambda_handler
1414
# --handler is the path to the executable inside the .zip
1515
aws lambda create-function \
1616
--region region \
17-
--function-name lambda-handler \
17+
--function-name function-name \
1818
--memory 128 \
1919
--role arn:aws:iam::account-id:role/execution_role \
2020
--runtime go1.x \
2121
--zip-file fileb://path-to-your-zip-file/handler.zip \
22-
--handler lambda-handler
22+
--handler lambda-handler-executable
2323
```
2424

2525
**Note**
@@ -54,4 +54,4 @@ In Powershell, run the following:
5454
$env:GOOS = "linux"
5555
go build -o main main.go
5656
~\Go\Bin\build-lambda-zip.exe -o main.zip main
57-
```
57+
```

0 commit comments

Comments
 (0)