Register Stack Sets in the CLI

Before your stack sets can be previewed or deployed, they must be registered in the command line interface.

In your project’s __main__.py:

  1. Call smokestack.register() to make your stack sets available.

  2. Call smokestack.SmokestackCli.invoke_and_exit() to hand off execution to Smokestack.

Example

This __main__.py registers three stack sets then hands off execution to Smokestack:

from smokestack import register, SmokestackCli

import myproject.stack_sets


def cli_entry() -> None:
   register("app", myproject.stack_sets.ApplicationStackSet)
   register("boot", myproject.stack_sets.BootstrapStackSet)
   register("ci", myproject.stack_sets.ContinuousIntegrationStackSet)
   SmokestackCli.invoke_and_exit()


if __name__ == "__main__":
   cli_entry()

Functions

smokestack.register(key: str, stack_set: Type[smokestack.stack_set.StackSet]) None

Registers a stack set to make it available via the command line.

Arguments:

key: Unique key to identify the stack set on the command line.

stack_set: Stack set.

smokestack.SmokestackCli.invoke_and_exit()

Hands execution over to Smokestack. Any command line arguments will be interpreted, operated on, then the script will terminate with an appropriate exit code.