/aws-lambda-hello-world

Testing out AWS Lambda with the Serverless Framework

Primary LanguagePythonApache License 2.0Apache-2.0

AWS Lambda + Serverless Framework: Hello World

Requirements

Deploy

sls deploy [--aws-profile PROFILE]

Execute

Any of these command will run the Lambda function.

sls invoke --log --function hello [--data "{\"name\":\"${USER}\"}"] [--aws-profile PROFILE]
curl -X POST https://[api-id].execute-api.us-east-1.amazonaws.com
curl -d "name=${USER}" https://[api-id].execute-api.us-east-1.amazonaws.com
curl -H "Content-Type: application/json" -d "{\"name\":\"${USER}\"}" https://[api-id].execute-api.us-east-1.amazonaws.com

Run / Test Locally

serverless invoke local --function hello

Created from template

sls create --template aws-python3

References

License

Copyright 2020 digitalr00ts

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.