github cloudposse/atmos v1.4.1

latest releases: v1.88.1, v1, v1.88.0...
2 years ago

what

  • Add settings.spacelift.stack_name_pattern
  • Fix parsing YAML config and detection of stacks when the stack name (on the command line) is the same as the YAML config file name in a subfolder

why

  • settings.spacelift.stack_name_pattern allows overriding Spacelift stack names. Supported tokens: {namespace}, {tenant}, {environment}, {stage}, {component}
components:
  terraform:
    "test/test-component-override-2":
      settings:
        spacelift:
          workspace_enabled: true
          # `stack_name_pattern` overrides Spacelift stack names
          # By specifying the following `stack_name_pattern`, the final Spacelift stack name will be
          # `tenant1-ue2-dev-new-component` instead of `tenant1-ue2-dev-test-test-component-override-2`
          # By default (if `stack_name_pattern` is not specified), the stack name is generated using the pattern {tenant}-{environment}-{stage}-{component}
          # Supported tokens: {namespace}, {tenant}, {environment}, {stage}, {component}
          stack_name_pattern: "{tenant}-{environment}-{stage}-new-component"

If the stack name pattern is specified incorrectly or not specific enough, an error like this will be thrown:

Duplicate Spacelift stack name 'tenant2-ue2-new-component' for component 'test/test-component-override-2' in the stack 'tenant2/ue2/prod'.
Check if the component name is correct and the Spacelift stack name pattern 'stack_name_pattern={tenant}-{environment}-new-component' is specific enough.
Did you specify the correct context tokens {namespace}, {tenant}, {environment}, {stage}, {component}?
  • When a stack name on the command line (e.g. atmos terraform plan test/test-component -s tenant1-ue2-dev) was the same as the name of the YAML config file in a subfolder inside the stacks folder, the stack was incorrectly detected (throwing an error "The stack 'xxx' does not exist") because it was considered as the folder path and not as a logical stack name (which is detected from the context)

Don't miss a new atmos release

NewReleases is sending notifications on new releases.