Skip to content

Latest commit

 

History

History
67 lines (53 loc) · 2.39 KB

README.md

File metadata and controls

67 lines (53 loc) · 2.39 KB

terracanary

Deployment orchestration using terraform

Synopsis

Terracanary provides a wrapper for terraform that manages multiple versions of terraform stacks and facilitates sharing data between multiple related stacks. This allows you to easily construct complex deployment procedures.

Examples

# Apply database infrastructure updates
terracanary apply --stack database
# Run database migrations
...
# Build new copy of infrastructure, using shared database
NEW_VERSION=$(terracanary next)
terracanary apply --stack-version main:$NEW_VERSION --input-stack database
# Run some automated tests on new main stack
HOSTNAME_TO_TEST=$(terracanary output --stack-version main:$NEW_VERSION hostname)
...
# Start sending traffic to new main stack
terracanary apply --stack routing --input-stack-version main:$NEW_VERSION
# Clean up old stack(s)
terracanary destroy --all main --except main:$NEW_VERSION

For more complete examples see the examples folder.

Directory Layout

Terracanary must be run from a working directory which has subdirectories containing the terraform definitions for each stack. Terracanary will create a ".terracanary" config file when you run "terracanary init" to set up the working directory. So for the above example, the layout would look like:

.
|-- database
|   \-- *.tf
|
|-- main
|   \-- *.tf
|
|-- routing
|   \-- *.tf
|
\-- .terracanary

Options

  -h, --help   help for terracanary

SEE ALSO

Auto generated by spf13/cobra on 12-Apr-2018