Skip to content

Configuration

Config File

The .totemrc.* configuration file is expected to live in the root directory of your projects repository, and can be in various formats, including YAML, JSON, Javascript, or Typescript.

By default, Totem will look for it’s configuration within any of the following files:

  • .totemrc.yaml
  • .totemrc.json
  • .totemrc.js
  • .totemrc.ts

The structure of this file, or the default export (in the case of TS/JS files) is expected to conform to the TotemConfig interface.

Config File Structure

  • version: (type: number) The version of the Totem configuration being used. Supported values: 1
  • name: (type: string) The name of the app.
  • description (optional): The description of the app.
  • targets: (type: TotemTargetsConfig ) Represents the target environments such as AWS, that the branches/services will be deployed to. This is an object where each key is an arbitrary name of the target and the value is a TotemTargetConfig object.
  • secrets (optional): (type: TotemSecretsConfig ) The secrets configuration for the app. This is an object where each key is an arbitrary name of the secret and the value is a TotemSecretConfig object.
  • services: (type: TotemServicesConfig ) The services configuration for the app. This is an object where each key is an arbitrary name of the service and the value is a TotemServiceConfig object.
  • build: (type: TotemBuildConfig ) The build configuration for the app. Here you will configure what branches trigger a build/deploy. You can also customize the service configuration for each branch here.

Example Config

Here is a example .totemrc.yaml config file that would deploy a static website whenever a git push occurred on the develop, qa, or main branches of the repository it was committed to.

version: 1
name: test-static-site
targets:
not-prod:
type: aws
env: aws://1234567890/us-west-2
prod:
type: aws
env: aws://1234567890/us-west-2
services:
site:
type: static-site
description: An Example Static Site
build:
type: github-actions
branches:
develop:
target: target://not-prod
services:
site:
domains:
- zoneName: meltdev.com
- recordName: test-site.develop
qa:
target: target://not-prod
services:
site:
domains:
- zoneName: meltdev.com
recordName: test-site.qa
main:
target: target://prod
services:
site:
domains:
- zoneName: meltdev.com
recordName: test-site.main
commands:
- yarn install
- yarn build

CDK Config

Because Totem is a CDK app, you will configure a cdk.json file, and inherit CDK related files (.cdk.out, cdk.context.json, etc)