A class that creates a riff-raff.yaml file.

Rather than using this directly, prefer to use [[GuRoot]] instead.

Supports:

  • Multiple CloudFormation stacks
  • Multiple regions
  • Lambda applications
  • EC2 (autoscaling) applications

For lambda applications, 3 deployments will be defined:

  1. Lambda upload (aws-lambda, action: [uploadLambda])
  2. CloudFormation deploy (cloud-formation)
  3. Lambda update (aws-lambda, action: [updateLambda])

For EC2 applications, 3 deployments will be defined:

  1. Artifact upload (autoscaling, action: [uploadArtifacts])
  2. CloudFormation deploy (cloud-formation)
  3. Autoscaling deploy (autoscaling, action: [deploy])

It assumes a Riff-Raff bundle structure as follows:

.
├── cdk.out
│ └── MyApplication.template.json
├── my-application
│ └── my-application.deb
└── my-lambda
└── my-lambda.zip

That is, all CloudFormation templates are in a cdk.out directory, and there is a directory per app. Application artifact(s) are in the app directory.

NOTE: The file extension is decided by you, the above file tree is used for illustration purposes.

NOTE: Resources will be looked up by tags (Stack, Stage, App). Ensure your CFN stack is tagged appropriately!

Hierarchy

  • RiffRaffYamlFileExperimental

Constructors

Properties

allCdkStacks: GuStack[]
allRegions: string[]
allStackTags: string[]
allStageTags: string[]
outdir: string
riffRaffYaml: RiffRaffYaml

The riff-raff.yaml file as an object.

It is useful for specifying additional deployment types that GuCDK does not support. Consider raising an issue or pull request if you think it should be supported.

In most cases, you shouldn't need to access this. No validation is performed on the parameters you provide, so you might get deployment errors.

Methods

  • Private

    Check there are the appropriate number of GuStacks. Expect to find an instance for each combination of stack, and stage.

    If not valid, a message is logged describing what is missing to aid debugging.

    Given the following:

    const app = new App();

    class MyApplicationStack extends GuStack { }

    new MyApplicationStack(app, "App-CODE-deploy", {
    env: {
    region: "eu-west-1",
    },
    stack: "deploy",
    stage: "CODE"
    });

    new MyApplicationStack(app, "App-PROD-media-service", {
    env: {
    region: "eu-west-1",
    },
    stack: "media-service",
    stage: "PROD",
    });

    new MyApplicationStack(app, "App-PROD-deploy", {
    env: {
    region: "eu-west-1",
    },
    stack: "deploy",
    stage: "PROD"
    });

    This will log a message like this, where ❌ denotes something missing, specifically there is no CODE template for media-service.

    Unable to produce a working riff-raff.yaml file; missing 1 definitions (details below)
    
    ┌───────────────┬──────┬──────┐
    │    (index)    │ CODE │ PROD │
    ├───────────────┼──────┼──────┤
    │    deploy     │ '✅' │ '✅' │
    │ media-service │ '❌' │ '✅' │
    └───────────────┴──────┴──────┘
    

    Returns void

Generated using TypeDoc