Hello! I think I must be missing something obvious...
# general
b
Hello! I think I must be missing something obvious. How does one use
aliases
with multiple stacks in the same project? The URN includes the stack name, so there doesn't seem to be a way to alias something that got moved, at least using URNs. Can't use parent/name since it moved to an earlier component in the dep tree.
b
What are you trying to do? Rename a resource within a stack?
b
I moved a resource from one ComponentResource to another
so in effect, the parent changed
e
b
Via the parent you mean? I don't have the old parent - since it is dependent on the new one
e
Oh right I see and Alias.Parent wants a URN not a name.
So that's dumb and feel free to raise an issue that Alias objects ought to support parent being just name. For now I think you'd have to construct the URN manually. That shouldn't be too tricky as you can ask for the current stack name with
getStack()
and you've got what the parent URN looks like so if you've got something like: "urnpulumitest_stack:test projectsome type:parent_name" you can just lerp in the result of getStack for the stackname part of the URN and leave the rest as is.
🙌 1
b
Ah thanks, I'll try that out.
That works. I agree if the parent could just be a name it would be a lot more straightforward.