winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.8k stars 189 forks source link

Declare Dependencies between SDK and external resources #3225

Open skorfmann opened 1 year ago

skorfmann commented 1 year ago

Feature Spec

It's now possible to explicitly declare dependencies between SDK and non-SDK resources, which are otherwise not directly depending on each other. This is using the the depends_on meta argument of Terraform and hence only available within tf-* targets.

e.g.

// wait for 5 minutes
new nullProvider.provider.NullProvider();
let blocker = new nullProvider.resource.Resource(
  provisioners: [
    {
      type: "local-exec",
      command: "sleep 300"
    }
  ]
);

let bucket = new cloud.Bucket
bucket.dependsOn(blocker)

Use Cases

Implementation Notes

Might be worthwhile thinking about supporting provider and lifecycle

Component

SDK

Community Notes

eladb commented 11 months ago

We support construct dependencies:

class Foo {

}

let foo = new Foo() as "foo";
let bar = new Foo() as "bar";

foo.node.addDependency(bar);

@skorfmann does CDKTF honor construct dependencies? Maybe this is something we can add upstream?

skorfmann commented 10 months ago

@skorfmann does CDKTF honor construct dependencies?

no, not yet

Maybe this is something we can add upstream?

Looks like this is something which could be accepted https://github.com/hashicorp/terraform-cdk/issues/785

github-actions[bot] commented 4 months ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] commented 1 month ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!