3.0.0-alpha9 • Published 9 months ago

@berenddeboer/nx-aws-cdk v3.0.0-alpha9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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": {
	"cdkTargetName": "cdk",
	"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.

Use the cdk target to run any cdk command easily:

npx nx run my-stack:cdk import ...

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.

2.3.0

10 months ago

3.0.0-alpha9

9 months ago

3.0.0-alpha8

10 months ago

3.0.0-alpha5

10 months ago

3.0.0-alpha4

10 months ago

3.0.0-alpha7

10 months ago

3.0.0-alpha6

10 months ago

3.0.0-alpha1

10 months ago

3.0.0-alpha3

10 months ago

3.0.0-alpha2

10 months ago

1.0.0

3 years ago

2.2.1

2 years ago

2.0.3

3 years ago

2.2.0

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.2.2

2 years ago

2.0.4

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

2.0.0

3 years ago