perfectsense / gyro

Gyro is a command-line tool for creating, updating, and maintaining cloud infrastructure. Gyro makes infrastructure-as-code possible.
https://gyro.dev
Apache License 2.0
134 stars 7 forks source link

Add @depends-on directive to allow definition of explicit dependencies #354

Closed beetlebugorg closed 3 years ago

beetlebugorg commented 3 years ago

There are a few rare cases where Gyro cannot infer a dependency between two resources. To allow for this a @depends-on directive should be defined that lets users define dependencies.

In this example node group creation may fail if the nategateway and route tables already exist.

aws::eks-nodegroup frontend
    name: "frontend"
    cluster: $(aws::eks-cluster $project)
    node-role: $(aws::iam-role eks-node)

    @depends-on: $(aws::nat-gateway *)
    @depends-on: $(aws::route-table private*)
end

The directive takes either a single reference or a list of references.