Stack A:
Stack A outputs the websocket url e.g. wss://
_ = new CfnOutput(this, $"{id}-CfnWebSocketUrlOutput", new CfnOutputProps {
Value = webSocketStage.Url,
ExportName = "WebSocketUrl"
});
Stack B:
Stack B fetches that value.
var webSocketUrl = Fn.ImportValue("WebSocketUrl");
App:
Stack B has a dependency on Stack A:
var app = new App();
var backendStack = new BackendStack(app, "BackendStack", new StackProps());
var frontendStack = new FrontendStack(app, "FrontendStack", new StackProps());
frontendStack.AddDependency(backendStack);
app.Synth();
Output in console:
BackendStack.BackendStackCfnWebSocketUrlOutput = wss://dev
Value fetched in Stack B:
In Stack B I am outputting the value into a JSON file but the value outputted it always ${Token[TOKEN.272]}
and not the WebSocketUrl.