Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Atmos 1.194.0 regression: backend prefix resolves to abstract component → new empty state #1613

@Musthaq101

Description

@Musthaq101

Describe the Bug

Area: terraform backend / abstract-component instances
Type: bug (likely regression)

  • Versions: Affects Atmos 1.194.0 (worked on 1.193.0).
  • Scenario: stacks using an abstract component (e.g. eks/service/defaults with metadata.component: eks/service)
    plus a named instance (e.g. eks/service/<name>).
  • In 1.194.0, the backend workspace_key_prefix is derived from the abstract path
    (e.g. eks-service-defaults) instead of the concrete/metadata component (e.g. eks-service).
  • This changes the S3 state location from the existing prefix /eks-service/... to a new prefix
    /eks-service-defaults/....
  • Atmos/tofu then initializes a new empty state at the new prefix (~small file; tofu state list empty),
    and plan shows create-only / full re-create.
  • On 1.193.0, the backend used eks-service and correctly found the existing state.
  • Net effect: applying plans from 1.194.0 can duplicate resources or fail with conflicts because the
    real state isn’t found.

Example effect:

  • Old/expected state prefix: /eks-service/... (has real state)
  • New/actual state prefix: /eks-service-defaults/...

Expected Behavior

Use the concrete component identity (e.g. eks/service → eks-service) so existing instances find their current state.

Steps to Reproduce

  1. Define abstract eks/service/defaults with metadata.component: eks/service and a named instance eks/service/apps inheriting it.
  2. Run on 1.193.0 → backend shows workspace_key_prefix: eks-service; state is found.
  3. Run on 1.194.0 → backend shows workspace_key_prefix: eks-service-defaults; new empty state is created; plan wants to create everything.

Code block:

components:
  terraform:
    eks/service/defaults:
      metadata:
        type: abstract
        component: eks/service
import:
  - catalog/eks/service/defaults

components:
  terraform:
    eks/service/begonia-clipfe:
      metadata:
        component: eks/service
        inherits:
          - eks/service/defaults
          - eks/helm-teleport-helper

Screenshots

#image:1 - no IaC state file available
Image

##############################
image:2 - describe component output
Image

##############################
#image:3 - S3 listings with both prefixes
Image

###############################
#image:4 - backend.tf.json on 1.194.0
Image

Environment

Atmos 1.194.0

Additional Context

Screenshots showing: backend.tf.json on 1.194.0, S3 listings with both prefixes, describe component output, and tofu state list (empty on new prefix).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions