01/19/2023, 12:05 AM
Hey folks! I'm looking at trying to create an Application Gateway for a VM Scale Set, and I'm noticing that the creation process seems to be pretty... janky? It seems like you need to do a bunch of ID self-referencing through
. For example, you define
for the Gateway inside the resource declaration, but when you later set up the
, you need to refer back to the
you created and you can only refer to them by Resource ID. See the snippet for an example of what I mean. Yet, we can't manually construct these Resource IDs, as we don't know the name of the Application Gateway in advance due to Pulumi's unique ID appending to the end of resource names. I also can't create them in advance, as there's no standalone
resource that I can create separately, then pass in later. My question: is there any intelligent, programmatic way to do these self-references before the Gateway has been created (something magic like
)? Or do I just need to bite the bullet, manually name Gateway and bypass the unique name generation, and manually write these Resource IDs out? Thank you!


01/19/2023, 1:37 PM
Hey! Yes, unfortunately it is indeed janky at this point. This is recorded as issue (please upvote). However, the issue does at least have a workaround using
. Could you use this approach as well?


01/19/2023, 10:35 PM
Thanks, Thomas! Glad to know it's not just me. I upvoted that issue as well 🙂 I ended up just making a large C# anonymous object with a map of sub resources, which each contained their name and a string concatenation of what I'm pretty sure their resource IDs will end up being. It's inelegant, but it should at least work until some sort of self-referencing ability is put in!