0.0.7 • Published 6 months ago

@sp-tools/kloud-stack v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

☁️ kloud-stack

Provide a declarative way to deploy multiple CloudFormation stacks with ease.

Installation

# Via yarn
$ yarn add @sp-tools/kloud-stack

# Via npm
$ npm install @sp-tools/kloud-stack

Usage

  1. Ensure that the environment variable AWS_DEFAULT_REGION is set
  2. At the root of your application add configuration file called kloud-stack.yml.
  3. kloud-stack run -s <stage>

CLI options

Following is the usage of kloud-stack CLI.

Usage: kloud-stack [command] <options>

Options:
  --stage,    -s Specify stage to run on. (required)
  --file,     -f Path to kloud-stack configuration file (default: "kloud-stack.yml")
  --dry       -d Execute a dry-run
  --version,  -v Output the version number
  --help,     -h Show help

Commands:
  run [options]          Deploy all cloudformation stacks in config file

kloud-stack.yml

Following is the configuration file will all possible options:

Example - SSM

provider:
  name: ssm

stacks:
  - templateFile: './sample-stack.yml'
    stackName: 'sample-stack-name'
    parameters:
      Stage: ${opt:stage}
      Foo: ${ssm:/foo-service/config/THEFOO}
  - templateFile: './sample-stack-two.yml'
    stackName: 'second-stack'
    parameters:
      Stage: ${opt:stage}
      Bar: bar-queue-${opt:stage}
      Blah: ${cf:blah-service/THEBLAH}

Example - DynamoDB

provider: # If used in conjunction with parameter store. Will support ${ddb:} resolution
  name: ddb (optional)
  tableName: tableName

stacks:
  - templateFile: './cloudformation/global/acm.yml' # path to cloudformation template
    stackName: blah-acm-${opt:stage}
    parameters:
      Stage: ${opt:stage}

  - templateFile: './cloudformation/global/internal-domain.yml'
    stackName: blah-api-gateway-${opt:stage}
    parameters:
      Stage: ${opt:stage}

Variables

Options

  • ${opt:stage}

AWS

  • ${aws:accountId}
  • ${aws:region}

Providers

SSM
provider:
  name: ssm

To reference ssm parameters, use: ${ssm:/foo-service/config/THEFOO}

DynamoDB

provider:
  name: ddb
  tableName: ThisTableHasConfigs

To reference ddb parameters, use: ${ddb:/theValue}

0.0.7

6 months ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago