Skip to content

v2.0.3

Latest
Compare
Choose a tag to compare
@ribejara-te ribejara-te released this 16 Jan 15:20
· 7 commits to main since this release

Stacks v2 is here! πŸŽ‰

New features

  • Stacks is now a command-line interface, with the following subcommands:
    • stacks render: renders the layer in your working directory.
    • stacks terraform: wraps Terraform with stacks render so you can do things like stacks terraform plan.
    • stacks diff: compares a layer's rendered output at HEAD vs. your current uncommitted changes.
    • stacks encrypt/decrypt: encrypts/decrypts a string.
    • stacks surgery list/import/remove/move/rename/edit: group of commands to simplify Terraform state operations.
    • ...and a couple others for advanced debugging, you shouldn't need them but read the code if interested.
  • Added support for common Terraform code that's shared accross all layers.
  • Added support for subenvironments (details in docs).
  • Added support for Jinja-rendered variables in *.tfvars.jinja files at all levels of hierarchy.
  • stack.tfvars can now be <anything you want>.tfvars, also applies to common.tfvars and layer.tfvars. Precedence is attributed by alphabetical order (z.tfvars overrides a.tfvars).
  • Added the stacks_environments magic variable with the full list of environments and their variables.
  • Added these Jinja filters to facilitate cross-layer value retrieval (read docs for usage details):
    • {{ variable("foo", stack="bar") }}: read another layer's variable.
    • {{ output("foo", instance="bar") }}: read another layer's output in state.
    • {{ resource("aws_ec2_instance.main", stack="foo")["id"] }}: read another layer's resource attributes.
  • Added a {{ throw(message) }} Jinja filter to enable halting execution if Jinja-based value validation doesn't pass.
  • Documented all-of-the-above and more under docs/.

Breaking changes

  • Terraform code is no longer allowed in layer directories: all code must now live in the stack base.
  • *.jinja.tfvars files must now be named *.tfvars.jinja for them to be read.
  • Removed the terraform_remote_state_all_layers, safe_terraform_remote_state, terraform_remote_state and terraform_local_state Jinja filters: use the new variable, output and resource ones instead.
  • Removed all AWS-specific logic such as S3 state backend and AWS provider injection.
  • Removed support for Jinja in modules.

Other

  • Upgraded to Python 3.10.
  • Implemented uv for package management.
  • Implemented ruff for linting and formatting.