This message was deleted.
# general
s
This message was deleted.
g
You can instantiate additional Resource Providers to hit different regions: https://www.pulumi.com/docs/intro/concepts/resources/#providers
p
Thankyou @green-musician-49057 I'll take a look at this.
@green-musician-49057 I want to thank you for the direct answer you provided to my question. This example is fantastic and is exactly what I needed.
thanks
This makes me think you cant create a custom provider for Azure. Is my assumption correct? I cant deploy to multiple regions for azure within the same stack? https://www.pulumi.com/docs/reference/pkg/azure/provider/#inputs
Or am I looking at the wrong API?
l
You can. You need to use separate providers per region. One stack can use any number of providers.
You can deploy to AWS, k8s and Azure in the same stack, if you like.
p
hmm..the API reference isnt showing anything for instantiating this
Closest thing I see is Environment. My assumptions are being made based on this example and the C# api reference for azures Provider. https://www.pulumi.com/docs/intro/concepts/resources/#explicit-provider-configuration
l
Yes, that's the correct link
You can create as many providers as you like. In the example code, just one is created (useast1), but you can create any number.
p
Right but look at the provider args. Those are supported args in Azures provider. Or am I overthinking this? https://www.pulumi.com/docs/reference/pkg/azure/provider/
l
They can all be from the same package (e.g. Azure) or from multiple packages. They can all have the same parameters (e.g.
Region = "us-east-1
) or they call all be different.
p
ok, I believe you. still new to this tool ๐Ÿ˜…
so it should look something like this then
l
๐Ÿ™‚
I don't know why those docs don't mention Region
p
Yeah its making me think it doesnt exist and the compiler isnt liking it
it doesnt even show up as a selectable object when I push ctrl + space
l
It's not in Azure Native either. Weeeird... let's look at some example code...
p
yeah...thats what Im saying. I dont think this is a thing
it is in aws though ๐Ÿ˜…
l
Yep... it should be there, I'd have thought...
p
yeah its not. I just peeled back Pulumis covers. There is no region mention in any of the APIs.
its in everything but Azure.
l
Apparently you can set azure:location in config.. let's see what that maps to...
p
yeah but that conflicts wouldnt it? you cant have two values for the same object like that
for example. Default region for me.
Copy code
config:
  azure-native:location: westus-2
l
Yes, that's what it's looking like at the moment. But maybe automation-api can work around this...
p
hmm ok
yeah that violates Yaml syntax and cuases a duplication of keys
l
Just found this error message in the provider source code:
reason += ". Either set it explicitly or configure it with 'pulumi config set azure-native:location <value>'."
Just need to figure out how to "set it explicitly"...
p
hmm ok.
l
Apparently it is possible: see this at bottom of https://www.pulumi.com/docs/get-started/azure/review-project/:
Note: In this program, the location of the resource group is set in the configuration setting azure-native:location (check the Pulumi.dev.yaml file). This is an easy way to set a global location for your program so you donโ€™t have to specify the location for each resource manually. The location for the storage account is automatically derived from the location of the resource group. To override the location for a resource, simply set the location property to one of Azureโ€™s supported locations.
Have to find the "location" property :)
p
lol this is quite an easter egg hunt
just in time for the holiday
l
๐Ÿณ
Oooo... it's in the args, not the opts.
Ooop.
p
huh?
l
Looks like every Azure and Azure Native resource has a Location property.
p
checking...
l
So you don't use different providers. One provider can access any location.
p
Thats...weird
l
Certainly different!
Handy though, I guess.
Soo... this egg is cracked.
p
omg Im blind!!!!
l
๐Ÿ‘“
p
It was there the whole time in Vnet ๐Ÿ˜ฑ
l
Kinda sticks out when you know to look for it, eh?
p
Yeah, but I was going off the docs for general pulumi usage
oof
Looks like we can submit an edit to this page here. I think Ill do that.
Something like. If youre in Azure you dont have to do this
๐Ÿ‘ 1
Submitted an issue. If you feel its worth while help by upvoting it ๐Ÿ˜Š https://github.com/pulumi/docs/issues/5604
๐Ÿ‘ 1