Skip to content

v1.37.0

Compare
Choose a tag to compare
@aknysh aknysh released this 21 Jun 01:40
· 86 commits to master since this release
c476b95

what

  • Add spacelift_stack and atlantis_project outputs to atmos describe component command
  • Add --include-spacelift-admin-stacks flag to atmos describe affected command
  • Update Atmos docs

why

  • Having the spacelift_stack and atlantis_project outputs from the atmos describe component command is useful when using the command in GitHub actions related to Spacelift and Atlantis

  • The --include-spacelift-admin-stacks flag for the atmos describe affected command allows including the Spacelift admin stacks of any stack that is affected by config changes. This will optimize Spacelift stack triggering by not triggering all admin stacks on any changes, but instead just triggering the affected admin stacks from a GitHub action

atmos describe affected --include-spacelift-admin-stacks=true
[
  {
    "component": "infrastructure-tenant1",
    "component_type": "terraform",
    "component_path": "examples/complete/components/terraform/spacelift",
    "stack": "tenant1-ue2-prod",
    "stack_slug": "tenant1-ue2-prod-infrastructure-tenant1",
    "spacelift_stack": "tenant1-ue2-prod-infrastructure-tenant1",
    "atlantis_project": "tenant1-ue2-prod-infrastructure-tenant1",
    "affected": "stack.settings.spacelift.admin_stack_context"
  },
  {
    "component": "infrastructure-tenant2",
    "component_type": "terraform",
    "component_path": "examples/complete/components/terraform/spacelift",
    "stack": "tenant2-ue2-prod",
    "stack_slug": "tenant2-ue2-prod-infrastructure-tenant2",
    "spacelift_stack": "tenant2-ue2-prod-infrastructure-tenant2",
    "atlantis_project": "tenant2-ue2-prod-infrastructure-tenant2",
    "affected": "stack.settings.spacelift.admin_stack_context"
  },
  {
    "component": "test/test-component-override-2",
    "component_type": "terraform",
    "component_path": "components/terraform/test/test-component",
    "stack": "tenant1-ue2-dev",
    "stack_slug": "tenant1-ue2-dev-test-test-component-override-2",
    "spacelift_stack": "tenant1-ue2-dev-new-component",
    "atlantis_project": "tenant1-ue2-dev-new-component",
    "affected": "stack.vars"
  },
  {
    "component": "infra/vpc",
    "component_type": "terraform",
    "component_path": "components/terraform/infra/vpc",
    "stack": "tenant2-ue2-staging",
    "stack_slug": "tenant1-ue2-staging-infra-vpc",
    "spacelift_stack": "tenant1-ue2-staging-infra-vpc",
    "atlantis_project": "tenant1-ue2-staging-infra-vpc",
    "affected": "component"
  }
]

The Atmos components for the Spacelift admin stacks will be included in the affected stacks output only if all the following is true:

- The `atmos describe affected` is executed with the `--include-spacelift-admin-stacks=true` flag

- Any of the affected Atmos components has configured the section `settings.spacelift.admin_stack_context` 
  pointing to the Spacelift admin stack that manages the components. For example:
settings:
  spacelift:
    # All Spacelift child stacks for the `tenant1` tenant are managed by the 
    # `tenant1-ue2-prod-infrastructure-tenant1` Spacelift admin stack.
    # The `admin_stack_context` attribute is used to find the affected Spacelift 
    # admin stack for each affected Atmos stack
    # when executing the command 
    # `atmos describe affected --include-spacelift-admin-stacks=true`
    admin_stack_context:
      component: infrastructure-tenant1
      tenant: tenant1
      environment: ue2
      stage: prod
- The Spacelift admin stacks are enabled by `settings.spacelift.workdpace_enabled` set to `true`. For example:
components:
  terraform:
    infrastructure-tenant1:
      metadata:
        component: spacelift
        inherits:
          - spacelift-defaults
      settings:
        spacelift:
          workspace_enabled: true