atmos icon indicating copy to clipboard operation
atmos copied to clipboard

Provider Configuration Not Inherited When Using Abstract Components and Context Provider

Open mirageAlchemy opened this issue 10 months ago • 0 comments

Describe the Bug

When inheriting an abstract component (demo) with a providers configuration in the Cloud Posse demo(the demo itself does not inherit but rather override), the name: petset value from the abstract component is not merged into the final providers configuration of the inheriting component. Other variables (e.g., pet: "dog") are inherited, but the name field from the context provider is missing.

Expected Behavior

The providers section should deep-merge the name: petset from the abstract component and the environment: dev from the stack, resulting in:

providers:
  context:
    values:
      name: petset
      environment: dev
      support_email: [email protected]

Steps to Reproduce

  1. Define the abstract component (catalog/demo.yaml):

    components:
      terraform:
        demo:
          metadata:
            type: abstract
            component: petset
          providers:
            context:
              values:
                name: petset
          vars:
            pet: "dog"
    
  2. Define the stack (deploy/dev/demo.yaml):

     # yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
    
     import:
     - ../_defaults
     - catalog/demo
     - mixins/west-coast
    
     terraform:
       providers:
         context:
           values:
             environment: dev
             support_email: [email protected]
    
     components:
       terraform:
         demo-new: # this was `demo` in original demo
           metadata:
             inherits: # this was missing in the original demo
               - demo
             type: real
           vars:
             size: 3
    
  3. Run atmos describe component demo -s deploy/dev.

  4. Observe that the name: petset value is missing in the providers.context.values section.

Screenshots

No response

Environment

OS: Linux/macOS (tested in Cloud Posse demo environment) Atmos Version: 1.165.2+ Context Provider Configuration: same as in the demo

Additional Context

No response

mirageAlchemy avatar Mar 13 '25 02:03 mirageAlchemy