Skip to content

How to deal with depends_on when the dependency creates a resource for the dependant project #6106

@edwin-bruurs

Description

@edwin-bruurs

I have the situation where I have two projects, where one of these projects depends on the other.

My atlantis.yaml looks something like this;

version: 3
parallel_plan: true
parallel_apply: false
projects:
  - name: parent
    branch: /main/
    dir: modules/parent
    workspace: default
    autoplan:
      enabled: true
      when_modified:
        - '*.tf'
  - name: child
    branch: /main/
    dir: modules/child
    workspace: default
    autoplan:
      enabled: true
      when_modified:
        - '*.tf'
    depends_on:
      - parent

My parent module generaties some global resources which my child module depends on (using a data object in Terraform).

In some cases I create a new global resource and updates my child module to use it in one single pull request. Unfortunatly atlantis fails in this case, as the plan of my child project fails as it can't read the global resource created by my parent module. On the other hand I can't use atlantis plan -p parent followed by atlantis apply -p parent as this results in the error Apply Failed: Pull request must be mergeable before running apply.. Any suggestions on how to manage this kind of dependencies?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions