8000 Circular dependencies cause !terraform.output function to hang and eventually die · Issue #1216 · cloudposse/atmos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Circular dependencies cause !terraform.output function to hang and eventually die #1216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BFarand opened this issue Apr 23, 2025 · 0 comments
Labels
bug 🐛 An issue with the system

Comments

@BFarand
Copy link
BFarand commented Apr 23, 2025

Describe the Bug

Given the following two (example) components:

security-group-example1:
  metadata:
    component: "security-group"
  vars:
    ingress_rules:
      Allow-Example2:
        from_port: 8080
        referenced_security_group_id: !terraform.output security-group-example2 security_group_id
        to_port: 8080

security-group-example2:
  metadata:
    component: "security-group"
  vars:
    ingress_rules:
      Allow-Example1:
        from_port: 8080
        referenced_security_group_id: !terraform.output security-group-example1 security_group_id
        to_port: 8080

Attempting to apply either of the components will cause atmos to hang and eventually have its process be killed. This is the case even if the components are first applied without their co-dependency and reapplied afterwards.

Expected Behavior

Ideally, I would expect the apply to be successful if (and only if) the component(s) were first initially created before their dependency was established.

My assumption is that the !terraform.output function has atmos run a terraform output command. It makes sense why the circular dependency is a problem, though it would be ideal if this could be worked around. This issue arises if at any point during the apply a circular dependency is found. When working with security groups in a multi-account environment, this can happen surprisingly often.

If the issue cannot be worked around, the next best thing would be for atmos to detect the circular dependency, write an error to stderr describing that it can't be done, then exit with a non-zero status.

Steps to Reproduce

Apply any component that (1) uses !terraform.output to get the output of another component and (2) has that component also use !terraform.output to get the output of the first component.

See the bug description for a practical example.

Screenshots

No response

Environment

  • Linux (Ubuntu)
  • Atmos version 1.171.0

Additional Context

I would be happy to provde additional information if needed.

@BFarand BFarand added the bug 🐛 An issue with the system label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

1 participant
0