{
"code": "200",
"message": "success message"
}
//
{
"code": "500",
"message": "fail message"
}Install Mac SAM CLI
brew tap aws/tap
brew install aws-sam-cliCreate team directory
- DevOps already have
devopssubdirectory.
Add your function into team directory as a module.
- Add a python file into under team directory. For example, new file name would be
devops/test.py. - Edit
__init__.pyto make sure your new file read as module for local testing. - Call your module from
main.py
Local invoking with SAM
- Add your module defined in
template.yaml - If your module(lambda) needs specific input values, define
events.jsonfile. Take a lookevents/events.json - Run SAM CLI
sam local invoke CFInvalidationFunction -e events/events.json
- Don't forget login OKTA
Deploy lambda application
- Update or create your
samconfig.toml- Please check
samconfig.toml.sample
- Please check
- Run SAM CLI
sam deploy # If you have samconfig.toml
sma deploy --guided # If you don't have samconfig.toml -> This will generate samconfig.toml