Go Lambda Functions with the CLI
We will deploy a Golang (Go) AWS Lambda function using the latest recommended settings with AWS CLI commands. Chapters 00:00 Intro 00:17 Go files 01:33 Deployment package 02:03 Lambda execution role 03:14 Deploy the lambda 03:28 AWS Lambda console 03:45 Test Lambda in the console 04:10 Test Lambda with CLI 04:45 Outro Commands 1. go mod init example.com 2. touch main.go 3. go mod tidy 4. GOOS=linux GOARCH=amd64 go build -tags lambda.norpc -o bootstrap main.go 5. zip myFunction bootstrap 6. aws iam create-role --role-name myFunctionExecRole --assume-role-policy-document file://trust-policy.json 7. aws iam attach-role-policy --role-name myFunctionExecRole --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole` 8. aws lambda create-function --function-name myFunction \ --runtime provided.al2023 --handler bootstrap \ --architectures x86_64 \ --role arn:aws:iam::YOUR_ACCOUNT_ID:role/myFunctionExecRole \ --zip-file fileb://myFunction.zip #golang #aws #awslambda #cli
Download
0 formatsNo download links available.