Posts

Creating a NodeJS Lambda together with API Gateway per CLI: First we create a simple NodeJS Lambda: const apiTestHandler = (event, context, callback) => { console.log(`Function apiTestHandler called with payload ${JSON.stringify(event)}`); callback(null, { statusCode: 201, body: JSON.stringify({ somethingId: payload.pathParameters.somethingId }), headers: { "X-Click-Header": "abc" } }); } module.exports = { apiTestHandler, } Put that into a zip File called apiTestHandler.zip and upload it to localstack: aws lambda create-function \ --region us-east-1 \ --function-name api-test-handler \ --runtime nodejs6.10 \ --handler index.apiTestHandler \ --memory-size 128 \ --zip-file fileb://apiTestHandler.zip \ --role arn:aws:iam::123456:role/role-name --endpoint-url=http://localhost:4574 Now we can create our Rest-Api: aws apigateway create-rest-api --region us-east-1 --name 'API Test' --endpoint-url=http://localh...