# Deployment Configuration

# Variables

You can define variables with the vars property at the top-level of the deployment configuration file. These variables are inherited to all deployment groups and targets.

# Examples

Defining top-level variables:

vars:
  project:
    name: My project
    id: 12345
    tags:
      costCenter: A1234
      contact: admin@example.com
  region: eu-west-1

# Config Sets

Config sets specify configuration that should be deployed to the deployment targets. You can attach config sets to deployment groups and individual deployment targets. Deployment groups inherit config sets from their parent, and deployment targets inherit config sets from the deployment group they belong to.

# Command Paths

Each config set can have one or more command paths. The command paths are launched in the order they are specified when the deployment target is deployed.

# Examples

An example of config sets:

configSets:
  MyNetwork:
    description: Network configuration
    commandPaths:
      - /networking
  Logs:
    description: Application and access logs 
    commandPaths:
      - /logs/application.yml
      - /logs/access.yml

In this example, we have two config sets: MyNetwork and Logs. We can then reference to these config sets from our deployment groups and targets like so:

deploymentGroups:

  Environments/Test:
    configSets: Logs
    targets:
      - name: first
      - name: second
        configSets: MyNetwork

The deployment target first would have only the Logs config set it inherited from its deployment group, whereas the deployment target second would also have the MyNetwork config set.

# Deployment Groups

Deployment groups form a tree-like hierarchies, and are configured in deploymentGroups object where keys are deployment group paths and values are configuration for the corresponding deployment group. Deployment groups inherit configuration from their parents.

# Deployment Targets

Each deployment group can have zero or more deployment targets, and each target can belong to exactly one deployment group.

To add deployment targets to a deployment group, add the targets into the targets list of the deployment group.

# Config Sets

Each deployment group can have zero or more config sets. Config sets added to the deployment group are inherited by its children and deployment targets that belong to it.

When the deployment groups are deployed, the deployment targets selected to be deployed get their config sets executed.

To add a config set to the deployment group, add the config set name into the configSets list of the deployment group.

# Variables

You can add variables to the deployment group with vars property. These variables are then inherited by the deployment group's children and deployment targets.

# Status

The deployment group status is used to control whether the deployment targets that belong to it are deployed when the deployment group is deployed. The status is inherited by the deployment groups's children.

Allowed values:

  • active - Deployment targets are deployed (default)
  • disabled - Deployment targets are not deployed

# Examples

An empty deployment group:

deploymentGroups:
  MyGroup: {}

Nested deployment groups:

deploymentGroups:
  MyGroup/Sandbox: {}
  SomeOther/Environments/Dev: {}
  SomeOther/Environments/Test: {}
  SomeOther/Environments/Prod: {}
  "Another/Customer Accounts": {}

As seen in this example, you don't need to explicitly define parent deployment groups if it's empty and has children. The path needs to be quoted if some deployment group name in it has spaces.

An deployment group with some deployment targets:

deploymentGroups:
  MyGroup:
    targets:
      - name: MyFirstTarget
      - name: AnotherTarget

Config sets in deployment groups:

configSets:
  basic:
    description: Some basic config set
    commandPaths:
      - /basic/stuff
  networking:
    description: Networking config
    commandPaths:
      - /network/vpc.yml
      - /network/transit-gateway.yml

deploymentGroups:
  Environments:
    configSets:
      - basic
  Environments/Test:
    configSets:
      - networking
    targets:
      - name: target1
  Environments/Dev:
    targets:
      - name: target2
  Sandbox:
    targets:
      - name: target3

In this example, target target1 would have config sets basic and networking, target2 would have only basic, and target3 would have no config sets.

Deployment groups with variables:

deploymentGroups:
  Environments:
    vars:
      envName: none
      code: 100
      props:
        color: red
        length: 20    
  Environments/Test:
    vars:
      envName: test
      props:
        color: blue
  Environments/Dev:
    vars:
      envName: dev
      props:
        color: green

In this example, the deployment group Environments declares some variables, and its children Environments/Test and Environments/Dev inherit these variables. The children also override some of the variables.

Deployment groups with status:

deploymentGroups:
  Environments:
    status: disabled
  Environments/Dev: {}
  Environments/Test: {}
  Sandbox: {}

In this example, the Environments deployment group has status disabled, and so does all its children.

Last Updated: 5/4/2020, 3:54:44 PM