Skip to content
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

Treat token references as connections (and show them in the Console) #6433

Open
eladb opened this issue May 7, 2024 · 2 comments
Open

Treat token references as connections (and show them in the Console) #6433

eladb opened this issue May 7, 2024 · 2 comments
Labels
🛫 console Console ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl 🎨 sdk SDK

Comments

@eladb
Copy link
Contributor

eladb commented May 7, 2024

Use Case

When a resource references an attribute of another resource, it introduces a relationship between them, similarly to the relationship created when inflight code calls a method on another preflight resource.

I want to see these relationships (connections) in the Wing Console!

The fact that the relationship is introduced through a reference to an attribute and not a method call doesn't make it less of a relationship.

Before:
image

After:

image

Proposed Solution

We should identify tokens when we call toSimulator() in the resource configuration (simulator initially, but can also do it for terraform), and simply add a connection to the tree.json.

It should be straightforward to add something like this.

Implementation Notes

No response

Component

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Slack.
@eladb eladb added ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl labels May 7, 2024
@Chriscbr
Copy link
Contributor

Chriscbr commented May 7, 2024

I wonder how this would be solved for Terraform, given that CDKTF tokens like ${TfToken.123} often resolve into Terraform configuration tokens like ${aws_route_table.MyPrivateRouteTable.id} (in HCL or JSON). It's possible the SDK could try and parse this string and reverse-engineer what logical construct it was associated with, but I wonder if there's a better way.

@eladb
Copy link
Contributor Author

eladb commented May 10, 2024

Yes, I would just do some parsing to identify the terraform level relationship.

For now, sim is good enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛫 console Console ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl 🎨 sdk SDK
Projects
Status: 🤝 Backlog - handoff to owners
Development

No branches or pull requests

2 participants