Open Oro opened 2 years ago
Hi @Oro - thank you for opening this issue. We'll look into it as soon as we can.
I think this might be another instance of the issue where explicit providers are not inherited correct - in the component framework - https://github.com/pulumi/pulumi/issues/10640
This will be able to be resolved once that issue is fixed and we can make a new release.
Upstream issue seems resolved. Will this be in the next beta release?
Yes, this should be fixed in the next release once we're upgraded dependencies. This should be happening quite soon.
After upgrading to 1.0.0
I am still running into that issue. Can someone confirm?
Are you testing this on a new or existing stack? An existing stacks may contain references to the old version of the awsx plugin from existing resources and might required a re-deploy to pull in the new provider version. If this is still persisting, we can raise this again in https://github.com/pulumi/pulumi
The dependency versions are:
pulumi==3.47.2
pulumi-aws==5.17.0
pulumi-aws-native==0.40.2
pulumi-awsx==1.0.0
pulumi-docker==3.6.1
pulumi-random==4.8.2
I have set pulumi:disable-default-providers: ["*"]
and deploy the following new stack to LocalStack:
import pulumi_awsx as awsx
import pulumi
import pulumi_aws as aws
provider = aws.Provider("provider")
awsx.ec2.Vpc("vpc", opts=pulumi.ResourceOptions(provider=provider))
Still results in Exception: Default provider for 'awsx' disabled. 'awsx:ec2:Vpc' must use an explicit provider.
Here's a quick status update and workaround:
As of the 1.0.0 beta and later, AWSx is implemented as a component package so it can be used by all Pulumi languages, which means it has an associated awsx provider plugin.
As such, when using the feature to disable all default providers, you'll get an error when not specifying an explicit awsx provider for any AWSx components created in a stack: Default provider for 'awsx' disabled. 'awsx:ec2:Vpc' must use an explicit provider.
To address this, you'd have to specify an explicit awsx provider for the AWSx component, as well as an explicit aws provider for the component's children, something like:
import pulumi
import pulumi_aws as aws
import pulumi_awsx as awsx
awsxProvider = awsx.Provider("awsxProvider")
awsProvider = aws.Provider("awsProvider")
awsx.ec2.Vpc("vpc", opts=pulumi.ResourceOptions(provider=awsxProvider, providers=[awsProvider]))
Unfortunately, this doesn't currently work due to a limitation that prevents specifying an explicit provider for packaged components: https://github.com/pulumi/pulumi/issues/11520.
In the meantime, the best workaround when using pulumi:disable-default-providers
is to specify the list of providers rather than using the catch-all "*"
, e.g.:
config:
pulumi:disable-default-providers:
- aws
- kubernetes
Since - awsx
isn't listed, it won't error with Default provider for 'awsx' disabled.
.
And then specify the explicit provider to use for the component's children:
import pulumi
import pulumi_aws as aws
import pulumi_awsx as awsx
awsProvider = aws.Provider("awsProvider")
awsx.ec2.Vpc("vpc", opts=pulumi.ResourceOptions(provider=awsProvider)) # or: opts=pulumi.ResourceOptions(providers=[awsProvider])
Will this be solved with https://github.com/pulumi/pulumi/pull/13282?
Checking up on this issue, I understand that https://github.com/pulumi/pulumi/issues/11520 solves it for Python, TypeScript and Go, and Justin's example above should now be working. Leaving the issue in the backlog until all the languages are supported. Please let us know if this is not working for you as expected in the meanwhile.
Repeating Justin's snippet:
import pulumi
import pulumi_aws as aws
import pulumi_awsx as awsx
awsxProvider = awsx.Provider("awsxProvider")
awsProvider = aws.Provider("awsProvider")
awsx.ec2.Vpc("vpc", opts=pulumi.ResourceOptions(provider=awsxProvider, providers=[awsProvider]))
What happened?
Denying all default providers via the following stack configuration does not allow me to instantiate e.g. a VPC (I also tried it with a cloudtrail, presumably others also don't work).
Steps to reproduce
Expected Behavior
Pulumi should create the vpc with the supplied provider config. NB: With awsx 0.40 using the aws provider with the following works:
Actual Behavior
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).