mirror of
https://github.com/autistic-symposium/backend-and-orchestration-toolkit.git
synced 2025-06-09 07:22:40 -04:00
🛌 Commit progress before sleep break
This commit is contained in:
parent
119cc7f62c
commit
585ee80f5d
319 changed files with 29 additions and 23 deletions
3
code/aws/lambda-function/monitoring_example/src/event.json
Executable file
3
code/aws/lambda-function/monitoring_example/src/event.json
Executable file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"forceError": true
|
||||
}
|
22
code/aws/lambda-function/monitoring_example/src/index.js
Executable file
22
code/aws/lambda-function/monitoring_example/src/index.js
Executable file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* @name monitoring
|
||||
* @param {Object} context Lambda context object
|
||||
* @return {Object} Object with a message and the original event
|
||||
*/
|
||||
exports.handler = async function(event) {
|
||||
console.log("got event", event);
|
||||
|
||||
if (event.forceError) {
|
||||
throw new Error ("Intentional Error.")
|
||||
}
|
||||
|
||||
return {
|
||||
message: "Work complete.",
|
||||
event
|
||||
};
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
const event = require("./event.json");
|
||||
exports.handler(event);
|
||||
}
|
11
code/aws/lambda-function/monitoring_example/src/template.yaml
Executable file
11
code/aws/lambda-function/monitoring_example/src/template.yaml
Executable file
|
@ -0,0 +1,11 @@
|
|||
AWSTemplateFormatVersion: '2010-09-09'
|
||||
Transform: 'AWS::Serverless-2016-10-31'
|
||||
Description: Monitoring test lambda
|
||||
Resources:
|
||||
MonitoringTest:
|
||||
Type: 'AWS::Serverless::Function'
|
||||
Properties:
|
||||
Handler: index.handler
|
||||
Runtime: nodejs8.10
|
||||
Description: Monitoring test lambda
|
||||
MemorySize: 256
|
Loading…
Add table
Add a link
Reference in a new issue