Is there anyway to deal with a scenario where the ...
# help
m
Is there anyway to deal with a scenario where the SiteStack needs the api url from the ApiStack and the ApiStack needs the url for the site? In other words they each need the output of the other to populate the Environment variables of the other?
a
If it's a runtime need, could perhaps build API then Site, and have site put the URL in Parameter Store where API can access it at runtime. If deployment time, hopefully your URL is pretty stable and you can deploy API first without it, then site, and as then redeploy API. A more typical strategy may be a custom DNS - where DNS basically serves the same role as Parameter Store would.
m
Parameter Store should work, thanks, I hadn't though of using it like that.
d
With circular dependencies, I generate one side (a name, or url, in a const), then use the generated name when creating and when referencing.
(Another way of saying what Adam said, but without the runtime fetch, can fetch if its fully dynamic, though)
t
I'd maybe give it a predictable domain name so one side can infer the other ones
which I think is what derek is saying woops