if i have a pulumi stack “aws-providers” of just o...
# aws
p
if i have a pulumi stack “aws-providers” of just one aws provider for each region and I export each region_provider, should i be able to
providers = pulumi.StackReference('aws-providers')
and then
opts=pulumi.ResourceOptions(provider=providers.get_output('provider_aws_us-east-1'))
???
g
I do not think it's supposed to work this way. provider parameter requires an instance of a
ProviderResource
This means that you need to instantiate the provider in the same stack. I do not think it would be a good pattern to instantiate providers somewhere else.
p
this means that in a micro-stack setup you need providers decribed within every stack which can sometimes be an issue when multiple people with different versions of pulumi installed wind up toggling the provider version back and forth… i was trying to escape from this situation by defining a single set of providers which is only updated once each new pulumi_aws version is released
g
This should not be an issue, because the stack is supposed to be an independent unit of resources. Stack References provide only input values. And you can pin the version of providers in
requirements.txt