Skip to content

Instantly share code, notes, and snippets.

@apoorvmote
Created February 22, 2021 02:30
Show Gist options
  • Save apoorvmote/f2adcd20c50b725c36af2f4b86a2a197 to your computer and use it in GitHub Desktop.
Save apoorvmote/f2adcd20c50b725c36af2f4b86a2a197 to your computer and use it in GitHub Desktop.
exports.handler = async (event) => {
console.log(event)
return {
statusCode: 200,
body: JSON.stringify({ message: 'success' })
}
}
import { Code, Function, Runtime } from '@aws-cdk/aws-lambda';
import * as cdk from '@aws-cdk/core';
export class LambdaLocalStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// The code that defines your stack goes here
const oneFn = new Function(this, 'oneFn', {
runtime: Runtime.NODEJS_14_X,
code: Code.fromAsset(`${__dirname}/../lambda-fns/one/deployment.zip`),
handler: 'index.handler'
})
}
}
# https://taskfile.dev
version: '3'
tasks:
default:
cmds:
- rm deployment.zip -f
- zip deployment.zip index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment