Can anyone point me in the right direction on when...
# help
d
Can anyone point me in the right direction on when its good/bad to use 
stack.resolve()
 ? It seems like more of an escape hatch that makes things less extensible as a construct author. No?
f
Hey @Dan Van Brunt, I just gave this a quick test:
Copy code
const api = new sst.Api(...);
console.log(api.url);
console.log(this.resolve(api.url));
On build, it printed out:
Copy code
${Token[TOKEN.271]}
{ 'Fn::GetAtt': [ 'ApiCD79AAA0', 'ApiEndpoint' ] }
resolve()
seems to convert a CDK token into CFN instrinsic functions. I don’t think you can pass the latter around as input to other constructs.
So yeah, it seems once u
resolve()
a token, it can’t be used in the CDK app anymore.
d
Thanks @Frank , so ya… seems to me like something you would rarely want to do at all …and almost never want to do as a construct author? (lest you lock your internal construct resources)
f
Yeah, I did a search in CDK’s repo, they mostly use this in their tests for checking TOKEN values.