This message was deleted.
# general
s
This message was deleted.
l
Not there, no. But you could use that syntax for the "Name" tag and it would work. Can you use a static string for the Pulumi arn? Maybe just "main"?
q
If I use a static string like
main
then I get an error stating that the URN is duplicate
Copy code
error: Duplicate resource URN 'urn:pulumi:main::acddevops-eks::aws:ec2/vpc:Vpc::main'; try giving it a unique name
l
You may need to maintain a map of provider names to providers, if you want a VPC for each one. Would the difference be the region? Maintain a map of regions to providers, and use the key to build the ARN.
q
I’m trying to define a function that defines a set of resources that I want deployed to multiple AWS accounts identically. So the only difference is which provider gets used per each account
I thought about maintaining a map of name=>provider. Was hoping there was a more elegant solution 😞
l
Ah. Often that sort of thing is done with one Pulumi stack per provider, is that the pattern you've chosen? You could use the stack name...
q
I’m hoping to achieve 1 stack to deploy to multiple accounts to keep the PR process simpler
l
If you want a bit more elegance, you could wrap Provider in your own class that maintains the discriminator?
q
Oh true
I’m used to terraform. So things are just different
l
You have a Real Language at your disposal 🙂
q
Didn’t think about the fact I can define my own classes
It does seem odd, though, that pulumi doesn’t take into account the provider id when generating the URN of a resource (this is something terraform does)
l
Too many use cases supported by Pulumi 😞 In my case, I wouldn't like that to happen. I use different stacks per provider in one project, and the same stack with multiple providers in another. I want to be able to choose my own ARN pattern. And I can!
q
When you say you can choose your own ARN pattern, you mean by setting the ‘name’ property on each resource?
l
Yes. That's pretty much all that first "name" parameter is for.
It doesn't go to AWS. The "Name" tag is what goes to AWS.
q
Thanks
👍 1