Last active
November 1, 2022 10:03
-
-
Save cal0610/30ce283c845250b191a4b644d2f4340b to your computer and use it in GitHub Desktop.
create nodejs lambda functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nodejsProps: NodejsFunctionProps = { | |
depsLockFilePath: join(__dirname, '..', 'package-lock.json'), | |
environment: { | |
STORE_PRIMARY_KEY: 'id', // we're able to reference it in our lambda function with process.env | |
STORE_TABLE_NAME: storesTable.tableName, | |
} | |
}; | |
const getOneLambda = new NodejsFunction(this, 'getOneStoreFunction', { | |
entry: join(__dirname, '..', 'get-one.ts'), | |
...nodejsProps, | |
}); | |
const getAllLambda = new NodejsFunction(this, 'getAllStoresFunction', { | |
entry: join(__dirname, '..', 'get-all.ts'), | |
...nodejsProps, | |
}); | |
const createOneLambda = new NodejsFunction(this, 'createStoreFunction', { | |
entry: join(__dirname, '..', 'create.ts'), | |
...nodejsProps, | |
}); | |
const updateOneLambda = new NodejsFunction(this, 'updateStoreFunction', { | |
entry: join(__dirname, '..', 'update-one.ts'), | |
...nodejsProps, | |
}); | |
const deleteOneLambda = new NodejsFunction(this, 'deleteStoreFunction', { | |
entry: join(__dirname, '..', 'delete-one.ts'), | |
...nodejsProps, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment