Skip to content

use a resource that uses api.url allow origin in api's allow.origin #6102

@tsuf239

Description

@tsuf239

I tried this:

bring cloud;

class WebsiteServer {
  pub url: str;
  new (env: Map<str>) {
    // initializing some terraform and stuff....
    // doing some stuff with the env.
    this.url = "some terraform token";
  }
}

// creating a url that allows only the server origin
let api = new cloud.Api(corsOptions:{allowOrigin: server.url});

// the website server resource needs the api.url in its environment- since it's 
// essential to the initiation.
let server = new WebsiteServer({API_URL: api.url});

This happened:

I couldn't use a property url of a resource that wasn't initialized yet :(

I expected this:

to have a way to pass that

Is there a workaround?

No response

Anything else?

No response

Wing Version

0.66.5

Node.js Version

No response

Platform(s)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-discussionFurther discussion is needed prior to impl🎨 sdkSDK🐛 bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions