interface ICommandHooks
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.Nodejs.ICommandHooks |
Java | software.amazon.awscdk.services.lambda.nodejs.ICommandHooks |
Python | aws_cdk.aws_lambda_nodejs.ICommandHooks |
TypeScript (source) | @aws-cdk/aws-lambda-nodejs » ICommandHooks |
Command hooks.
These commands will run in the environment in which bundling occurs: inside the container for Docker bundling or on the host OS for local bundling.
Commands are chained with &&.
The following example (specified in TypeScript) copies a file from the input directory to the output directory to include it in the bundled asset:
afterBundling(inputDir: string, outputDir: string): string[]{
return [`cp ${inputDir}/my-binary.node ${outputDir}`];
}
Methods
| Name | Description |
|---|---|
| after | Returns commands to run after bundling. |
| before | Returns commands to run before bundling. |
| before | Returns commands to run before installing node modules. |
afterBundling(inputDir, outputDir)
public afterBundling(inputDir: string, outputDir: string): string[]
Parameters
- inputDir
string - outputDir
string
Returns
string[]
Returns commands to run after bundling.
Commands are chained with &&.
beforeBundling(inputDir, outputDir)
public beforeBundling(inputDir: string, outputDir: string): string[]
Parameters
- inputDir
string - outputDir
string
Returns
string[]
Returns commands to run before bundling.
Commands are chained with &&.
beforeInstall(inputDir, outputDir)
public beforeInstall(inputDir: string, outputDir: string): string[]
Parameters
- inputDir
string - outputDir
string
Returns
string[]
Returns commands to run before installing node modules.
This hook only runs when node modules are installed.
Commands are chained with &&.

.NET
Java
Python
TypeScript (