Name: kinesis-lambda-slack-webhook
Owner: FT Interactive News
Description: Serverless project for subscribing to Lambda events and POSTing to a Slack webhook
Created: 2017-02-21 15:21:20.0
Updated: 2017-02-21 15:44:02.0
Pushed: 2017-10-20 15:10:15.0
Homepage: null
Size: 12
Language: Makefile
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This tutorial is intended to introduce you to serverless computing in Next.
Serverless what? Google explains. It is, like, function as a service.
What better way to introduce than to create, deploy and update a full-blown serverless application?
Pick one example from the collection of Serverless examples. OMG!
What? Oh alright. The biggest one. REST API with DynamoDB! This example lets you create, retrieve, update and delete “todos”. A common denominator of apps. :-)
clone git@github.com:serverless/examples
xamples serverless-examples
erverless-examples/aws-node-rest-api-with-dynamodb
Note that there's a directory called “todos”:
s
reate.js
elete.js
et.js
ist.js
pdate.js
clone git@github.com:financial-times/next-serverless-example
ext-serverless-example
install
and skip to Deploy it. Whoooo.
Righto. We need to make some tweaks to get it to work in the FT.
Make the following changes in the serverless.yml
:
vice: serverless-rest-api-with-dynamodb
vice: ft-next-app-noob
You will need to make up a unique (and more respected) system code to replace ft-next-app-noob
with. It needs to start with ft-next-
and end with a name of your choosing. This will be the “prefix” name for all the resources it creates in the cloud. Now…
vider:
ame: aws
untime: nodejs4.3
amRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:us-east-1:*:*"
ole: ${env:AWS_ROLE}
eploymentBucket: ${env:AWS_DEPLOYMENT_BUCKET}
That's because we're going to have a role and a deployment bucket created for us by the cool FT tooling, details of which we will then put in .env
. All that will come up shortly.
Following that:
nvironment:
TODOS_TABLE_NAME: ft-next-app-noob_${opt:stage}_todos
To avoid hardcoding the table name in the different functions, we'll create the environment variable and use it. So, in todos/(create|delete|get|list).js
files:
TableName: 'todos',
TableName: process.env.TODOS_TABLE_NAME,
Back in serverless.yml
, update the DynamoDB table definition:
TableName: 'todos'
TableName: ft-next-app-noob_${opt:stage}_todos
and
DeletionPolicy: Retain
to delete the table when we delete the application.
Finally, put this at the bottom:
kage:
xclude:
- node_modules/serverless/**
which is not used by the application itself. In Next, every little performance tweak helps. :-)
Create a Makefile
with tasks to deploy and remove the application.
If in Next, ensure n-makefile is present in the folder:
ude n.Makefile
else:
tup environment variables
lude .env
rt $(shell [ -f .env ] && sed 's/=.*//' .env)
node_modules/.bin on the PATH
L := /bin/bash
rt PATH := ./node_modules/.bin:$(PATH)
Add the following tasks:
oy:
erverless deploy --verbose --region eu-west-1 --stage dev
:
erverless remove --verbose --region eu-west-1 --stage dev
Either:
install -g serverless
or
install --save-dev serverless
Tough decision… I figure the latter is better because we can ensure everyone has the same version.
Progress. I've left the most uninspiring task to last!
We need to get a key with which to setup all the AWS access keys (secrets!), role and deployment bucket for our application. I have good news and bad news.
The good news is that we are so modern that we can get the key through a Slackbot! Boom-boom. In Slack, in any channel (noone will know):
keyfor kon_policygen personal
Then check your email and through that you should see an apiKey
field which is what you want.
Now the bad news is that the Konstructor webpage with which we use to setup access for applications is more confusing than knowing whether Father Santa exists. Let's do it a better way: cURL
.
Replace YOUR_API_KEY_IN_HERE
with the aforementioned key and the system code name:
-H 'x-api-key: YOUR_API_KEY_IN_HERE' -X POST -d '{
"systemCode": "ft-next-app-noob",
"policyDescription": "Next app by noob",
"performTestRun": "false",
"requireS3": {
"artefacts": true,
"application": true
},
"requireLambda": true,
"requireApiGateway": true,
"requireDynamo": true,
"requireKinesis": true,
"requireCloudformation": {
"required": true,
"changeRequestSetName": "Serverless-2016-10-31"
}
ttps://awspolicy-api-d.in.ft.com/v1/create > policy.json
This policy.json
will now have the all the information we need.
Pick the bits we need from the policy.json
and put in a new .env
file:
-e 'const p = require("./policy.json");
console.log(`AWS_ACCESS_KEY_ID=${p.accessKey.accessKeyId}`);
console.log(`AWS_SECRET_ACCESS_KEY=${p.accessKey.secretAccessKey}`);
console.log(`AWS_ROLE=${p.role.arn}`);
console.log(`AWS_DEPLOYMENT_BUCKET=${p.artefactBucket.name}`);' > .env
olicy.json
This is just brilliance. :-) The excitement can now begin!
Wooo.
deploy
and you should see something like:
ke deploy
erless: Packaging service...
erless: Uploading CloudFormation file to S3...
erless: Uploading service .zip file to S3 (10.3 KB)...
erless: Creating Stack...
erless: Checking Stack create progress...
dFormation - CREATE_IN_PROGRESS - AWS::CloudFormation::Stack - ft-next-app-noob-dev
dFormation - CREATE_IN_PROGRESS - AWS::DynamoDB::Table - TodosDynamoDbTable
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - UpdateLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - CreateLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - ListLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::DynamoDB::Table - TodosDynamoDbTable
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - DeleteLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - UpdateLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - ListLambdaFunction
dFormation - CREATE_COMPLETE - AWS::Lambda::Function - UpdateLambdaFunction
dFormation - CREATE_COMPLETE - AWS::Lambda::Function - ListLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - CreateLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - DeleteLambdaFunction
dFormation - CREATE_COMPLETE - AWS::Lambda::Function - CreateLambdaFunction
dFormation - CREATE_COMPLETE - AWS::Lambda::Function - DeleteLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - GetLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - GetLambdaFunction
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
dFormation - CREATE_COMPLETE - AWS::Lambda::Function - GetLambdaFunction
dFormation - CREATE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - DeleteLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CreateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - UpdateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CreateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - ListLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_COMPLETE - AWS::Lambda::Version - CreateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - UpdateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - DeleteLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_COMPLETE - AWS::Lambda::Version - UpdateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_COMPLETE - AWS::Lambda::Version - DeleteLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - ListLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
dFormation - CREATE_COMPLETE - AWS::Lambda::Version - ListLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
dFormation - CREATE_COMPLETE - AWS::Lambda::Version - GetLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
dFormation - CREATE_COMPLETE - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
dFormation - CREATE_COMPLETE - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
dFormation - CREATE_COMPLETE - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
dFormation - CREATE_COMPLETE - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
dFormation - CREATE_COMPLETE - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1484586575524
dFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1484586575524
dFormation - CREATE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1484586575524
dFormation - CREATE_COMPLETE - AWS::DynamoDB::Table - TodosDynamoDbTable
dFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - ft-next-app-noob-dev
erless: Stack create finished...
ice Information
ice: ft-next-app-noob
e: dev
on: eu-west-1
keys:
ne
oints:
ST - https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev/todos
T - https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev/todos
T - https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev/todos/{id}
T - https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev/todos/{id}
LETE - https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev/todos/{id}
tions:
-next-app-noob-dev-update: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-update
-next-app-noob-dev-get: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-get
-next-app-noob-dev-list: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-list
-next-app-noob-dev-create: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-create
-next-app-noob-dev-delete: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-delete
k Outputs
teLambdaFunctionArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-update
teLambdaFunctionQualifiedArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-delete:1
teLambdaFunctionQualifiedArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-create:1
ambdaFunctionQualifiedArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-get:1
teLambdaFunctionQualifiedArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-update:1
ambdaFunctionArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-get
LambdaFunctionArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-list
teLambdaFunctionArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-create
LambdaFunctionQualifiedArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-list:1
iceEndpoint: https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev
erlessDeploymentBucketName: artefacts.ft-next-app-noob-1h7j4i9qtpmi8
teLambdaFunctionArn: arn:aws:lambda:eu-west-1:371548805176:function:ft-next-app-noob-dev-delete
How fantastic! Let's cURL
one of the functions:
rl https://llzjg0qnl1.execute-api.eu-west-1.amazonaws.com/dev/todos
which is the empty list.
The deployment is completely managed (“Infrastructure as Code”) and so it's just as easy to update (by running make deploy
again) and to delete:
ke tidy
erless: Getting all objects in S3 bucket...
erless: Removing objects in S3 bucket...
erless: Removing Stack...
erless: Checking Stack removal progress...
dFormation - DELETE_IN_PROGRESS - AWS::CloudFormation::Stack - ft-next-app-noob-dev
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1484586575524
dFormation - DELETE_SKIPPED - AWS::Lambda::Version - ListLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - DELETE_SKIPPED - AWS::Lambda::Version - GetLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - DELETE_SKIPPED - AWS::Lambda::Version - DeleteLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
dFormation - DELETE_SKIPPED - AWS::Lambda::Version - CreateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
dFormation - DELETE_SKIPPED - AWS::DynamoDB::Table - TodosDynamoDbTable
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1484586575524
dFormation - DELETE_SKIPPED - AWS::Lambda::Version - UpdateLambdaVersion9SWsH6TSK4PXXfCNvAphLe1VTehQVAcjXlrafTd60w
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
dFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
dFormation - DELETE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
dFormation - DELETE_COMPLETE - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
dFormation - DELETE_COMPLETE - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
dFormation - DELETE_COMPLETE - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
dFormation - DELETE_COMPLETE - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
dFormation - DELETE_COMPLETE - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Function - ListLambdaFunction
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Function - CreateLambdaFunction
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Function - UpdateLambdaFunction
dFormation - DELETE_IN_PROGRESS - AWS::Lambda::Function - GetLambdaFunction
erless: Stack removal finished...
Add a task to the Makefile
:
:
@serverless info --verbose --region eu-west-1 --stage prod
and run it.
Ask Ben about using Exporting Stack Output Values which outputs useful information such as references for use by other applications.
You can test locally using serverless invoke local --stage dev --function list
(you may need to npm install --save aws-sdk
- not forgetting to exclude this in serverless.yml
because it's already available in the Lambda container).
You can test the deployed function using the same command as above but without local
.
Please read also: Serverless testing
That's a Work in Progress. Contact us for the latest update. :-)
Please contact Ben Fletcher or #ft-next-platform (if Next), or #cloud-enablement.
I highly recommend:
Resources
section… what properties are required, what they do, etc.dev
and have a look at serverless --help
regarding invoking functions locally)