Skip to main content

Bootstrap your AWS CDK project resources by running CLI commands

Project description

Windsor

Toolkit to speed up AWS CDK applications development.

windsor is a CLI tool built by Westpoint to increase the development speed of applications built using AWS CDK by injecting pre-made code into the project as well as managing dependencie versions and project configurations.

System requirements

To use windsor and all of its features make sure you have the following dependencies installed.

Installation

Install windsor using PyPI

pip install windsor

Getting started

Create a CDK application using windsor

Each CDK app have its own dependencies and must be in its own folder. Start by creating an empty folder in your terminal.

$ mkdir my-app
$ cd my-app

Start a CDK application running windsor init.

The init command doesn't need to be ran in an empty folder. If you want to use windsor in a project already started, the command init will identify your project and create the a configuration file for it.

Control your dependencies

Windsor can help you manage your CDK dependencies by locking the version of @aws-cdk/core and providing commands to install and update these dependencies. The following example shows how to install the package @aws-cdk/aws-lambda.

windsor install aws-lambda

Notice that you also don't need to specify the namespace @aws-cdk, windsor will prefix that in all packages listed to install.

If you have packages with different versions, windsor provides a command to update all of them to the version specified in the CDKVersion attribute of windsor.json file. To update all your packages run.

windsor lock

Generating resources

windsor is able to generate resources with the command generate. Each resource generate will be in the form a CDK Construct, meaning that you can extend them and customize as you wish. Obs: windsor doesn't inject code in files that already exists in your project, that means that for every generated resource, you will need to instanciate the construct into your stack.

windsor generate lambda-function --function-name HelloWorld

The example above shows how to generate a lambda function. The only required parameter to generate lambda functions is function-name, since windsor will store a default runtime for them in its configuration. To change the default runtime change the attribute DefaultRuntime in windsor configuration file.

Resources available

lambda-function

Parameters:

  • function-name
  • runtime

Example

import * as cdk from '@aws-cdk/core';
import HelloWorldFunction from './constructs/helloworld';

export class WindsortestStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new HelloWorldFunction(this, 'HelloWorldFunction');
  }
}

codepipeline-react

A Pipeline that builds a React Application and sends to a S3 Bucket. The source stage pull code from Github and is triggered every time the branch (specified with the parameter branch) is updated.

Parameters:

  • pipeline-name

Example:

import * as cdk from '@aws-cdk/core';
import ReactPipeline from './constructs/react-pipeline';

export class WindsortestStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new ReactPipeline(this, 'ReactPipeline', {
      owner: 'REPOOWNER',
      repo: 'REPONAME',
      oauthToken: 'YOURTOKEN'
    });
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windsor-1.0.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

windsor-1.0.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file windsor-1.0.1.tar.gz.

File metadata

  • Download URL: windsor-1.0.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for windsor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 001b8166fa8e529cb0495566e38e1c0143f6acbf16c57024ccc9cbc2539f9636
MD5 bf8e779492a387c69cbfb1c5bc2e6ae7
BLAKE2b-256 f6bab25f0a3dabd397acfd096bef5ec1faf4c18285e26f2f9a49cb8879bfd385

See more details on using hashes here.

File details

Details for the file windsor-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: windsor-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.6

File hashes

Hashes for windsor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83a931781ec5a6c6c95b1e81192cf7a1e3cb659ba5c134ab97610dc473f7df44
MD5 58f05fb326c3a0509eba6bcdd6888b3d
BLAKE2b-256 7b77f854d90a36676ca03b4900a3d0c2a97bb69e6487c670c2302e4391682f35

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page