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.6k stars 180 forks source link

`aws.xxxRef` Resources Creates Unneeded TF Resources For `tf-aws` #6383

Open hasanaburayyan opened 2 weeks ago

hasanaburayyan commented 2 weeks ago

I tried this:

bring aws;

new aws.BucketRef("blah");

wing compile -t tf-aws

THEN

tf apply

This happened:

~40 some resources are going to be made

image

I expected this:

No resources

Is there a workaround?

No response

Anything else?

I think this is because the ui fields we add for interacting with Refs in the simulator, and they are being turned into lambda functions in AWS

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

eladb commented 2 weeks ago

Oh, seems like this is the resources used for the ui elements, no @Chriscbr ?

Chriscbr commented 2 weeks ago

Oh, seems like this is the resources used for the ui elements, no @Chriscbr ?

Yup 👍

Perhaps for now we can disable the ui elements from creating various child resources when you're compiling to non-sim targets, since Wing Console only works with simulated apps at the moment. ie

if app.target != "sim" {
  // existing logic
}
eladb commented 2 weeks ago

👍