Is there a way to create stack references across p...
# general
Is there a way to create stack references across projects when not using the pulumi service? Say I have a project in
and an other in
yep, just references the name of the project:
Copy code
const stackRef = new pulumi.StackReference("")
It's recommended to name your projects and stacks with prefixes like you can see here
Doesn't that work only when the two projects have the same backend URL? So you'd need both to have
, and then you can refer to "" in there, from the prod stack of the app project..
I don't get how this works. If I am in project1 and want to reference project2 (stack dev) I just have to use ""? How does pulumi know its in
Iirc, you can't. You need to have both projects in the same key in the same bucket. And that's what you need the stack name to include the project name: so that they get different keys in the one big json file.
Oh damned..
Are there references to filenames and buckets in the files or can I get away by just moving them?
Can't answer that. You can definitely create a new stack in the right place, then export the old one and import it to the new place.
I see
Well then, let the nightmare begin, thanks a lot! 😭
Please note, my responses have been caveated with "iirc".. this is how it was over a year ago, when I used S3 buckets. Lee may well be right, things may have been improved...
Worth double-checking.
Where can I double check anyway? The doc just does talk about that, and most github issues are 2y old anyway, this slack is the only source of info AFAIK
Just try a stackreference like Lee suggested 🙂
@refined-appointment-5884 Check this project, it's quite complex and has many projects and directories
it's not improved I'm afraid, I didn't realise there were things being stored under different paths. You're correct in saying that won't work @little-cartoon-10569
It creates weird things to have all projects use the same s3 key
stack ls
now lists stacks from other projects
I named my stacks and
And when doing stack ls for project1 is see both and
Also export/import will not work as stack names are different >_<
Need to stack rename first
FWIW, it looks like this is going to get a lot better soon:
(from the Pulumi Roadmap)