Skip to content

NewEraCodeRepo/nec-cdk-components

Repository files navigation

New Era Code CDK Components and Modules

Build Status

name description
cdk-codepipeline-github Sends codbuild and codepipeline status events to github
cdk-static-site Creates static site infrastructure
cdk-deletion-protection Protects infrastructure from deletion

This repo tests, and packages different modules into npm mods which can be used in other New Era Code applications

Uses:

Setup

Prerequisites

  • Node.js (>= 8.11.x)
  • Installed globally:
$ npm install -g lerna aws-cdk typescript

Optional utilities

There are some optional handy lerna tools:

$ npm install -g lerna-wizard lerna-update-wizard

Make sure not to commit any sensative files:

AWS Credentials

AWS authentication

Environment Variables

Copy the sample.env file and rename it / place it in the root as .env.

Local

Build:

$ npm install
$ npm run setup
$ npm run build

Test

$ npm run test

Update NPM Modules

To make sure the npm modules from external libraries are up to date in all of the packages, run:

$ npm run update

Creating a new CDK Module

  1. Run the following commands:
$ lerna create @neweracode/cdk-<name-of-package> packages

for example:

$ lerna create @neweracode/cdk-deletion-protection packages
  1. Answer questions. Look at the package.json files in the other modules for sample information.
  2. Copy files from cdk-boilerplate folder
  3. Change EVERYTHING that has the string cdk-boilerplate (including filenames) and CDKBoilerplate (incuding classes) to match the name of your package.
  4. Modify files for your library / module

Version / Pack / Publish

  • When the code is committed to the repo a git pre-push hook versions the changed modules automatically.
  • When the code is pushed, the ci process will pack and publish the modules.

For this process to occur, the codebuild stack in the ci package must have already been deployed and working. See CI setup below for more information.

CI setup

CDK deployment

About

This repo tests, and packages different cdk modules into npm mods which can be used in other New Era Code applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published