@berenddeboer/nx-aws-cdk
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-alpha8 • Public • Published

standard-readme compliant @berenddeboer/nx-aws-cdk Typescript LICENSE npm version Downloads


@berenddeboer/nx-aws-cdk

A self-inferring Nx plugin for developing aws-cdk applications.

Table of Contents

Install

# 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

Usage

Plugin

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.

Generating a CDK application

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.

Targets

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.

Contributing

See the contributing file!

PRs accepted.

If editing the README, please conform to the standard-readme specification.

License

This project is MIT licensed.

Package Sidebar

Install

npm i @berenddeboer/nx-aws-cdk

Weekly Downloads

331

Version

3.0.0-alpha8

License

MIT

Unpacked Size

91 kB

Total Files

97

Last publish

Collaborators

  • berenddeboer