A self-inferring Nx plugin for developing aws-cdk applications.
# npm
npm install --save-dev @berenddeboer/nx-aws-cdk
# pnpm
pnpm i --save-dev @berenddeboer/nx-aws-cdk
# yarn
yarn add --dev @berenddeboer/nx-aws-cdk
This package uses inferred
targets (tasks). Any project
with a cdk.json
in its root will create the appropriate cdk targets
for that project.
You can configure the default target names in the plugin:
{
"plugin": "@berenddeboer/nx-aws-cdk/plugin",
"options": {
"synthTargetName": "synth",
"deployTargetName": "deploy",
"diffTargetName": "diff",
"rollbackTargetName": "rollback",
"watchTargetName": "watch",
"destroyTargetName": "destroy"
}
},
Remove a target if you do not want it auto-generated.
There's no need to use the executor anymore, but you can still use it for non-inferred targets.
To generate an AWS CDK v2 Application:
npx nx generate @berenddeboer/nx-aws-cdk:application --directory=stacks/cdk-app --name=cdk-app
Currently (alpha 3 versions): do not specify a unit test runner or eslint. This crashes nx for as yet unknown reasons.
You can customize it further by passing these options:
nx generate @berenddeboer/nx-aws-cdk:application [name] [options,...]
Options:
--tags Add tags to the project (used for linting)
--skipFormat Skip formatting files
--unitTestRunner Adds the specified unit test runner (default: jest)
--linter The tool to use for running lint checks. (default: eslint)
--setParserOptionsProject Whether or not to configure the ESLint "parserOptions.project" option. We do not do this by default for lint performance reasons.
--dryRun Runs through and reports activity without writing to disk.
--skip-nx-cache Skip the use of Nx cache.
--help Show available options for project target.
Generated applications expose several functions to the CLI that allow users to deploy, destroy and so on.
nx deploy myApp
nx destroy myApp
We infer the most common cdk commands. Use the executor to have access to all CDK commands.
PRs accepted.
If editing the README, please conform to the standard-readme specification.
This project is MIT licensed.