Hello I have encountered this issue upon updating ...
# azure
b
Hello I have encountered this issue upon updating the pulumi azure native provide and I am wondering if anyone has the same issue or know what the deal is? Basically, upon updates of the provider sometimes types get "rug pulled" in the python sdk. I mean, as an example, now from 3.16 - 3.17 I had this bit of code for the deployment of our azure container app infra:
Copy code
from pulumi_azure_native import app
...
self.managed_environment = app.ManagedEnvironment(
    ...,
    identity=app.ManagedServiceIdentityArgs(
                type=app.ManagedServiceIdentityType.SYSTEM_ASSIGNED)
    ...,
)
I prefer to be explicitly invoke the arg types for the providers since then we're more clear that the args are correct and we get type hinting. This snippet used to work, but then we update the provider and...
Copy code
File "C:\dev\datascience-exploration\deployment\infrastructure\pulumi\infrastructure_modules\containerapp.py", line 163, in __init__
        identity=app.ManagedServiceIdentityArgs(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module '<http://pulumi_azure_native.app|pulumi_azure_native.app>' has no attribute 'ManagedServiceIdentityArgs'
And so we inspect the ManagedEnvironment provider and we find the type declaration for the identity argument
Copy code
identity: Optional[pulumi.Input[Union['_commontypesv5.ManagedServiceIdentityArgs', '_commontypesv5.ManagedServiceIdentityArgsDict']]] = None,
So our arg type has suddenly moved to a new module _commontypesv5? Why move the arg type out of the module where it is used? At least then keep an alias or something. Our deployment pipeline pulls the newest versions of the providers and this sort of issue has broken our deployment more than once now. Its easy to fix; either just supply generic args instead of using the types, or locking the version. Still ,I find this a bit bothersome, and I was wondering if anyone else has encountered this, or knows why pulumi /pulumi_azure_native updates has this behaviour?
e
I think this is from https://github.com/pulumi/pulumi-azure-native/pull/4639 I don't think it should move again, this was a one off to match the azure rest specification. Arguably this should have been a major version bump. cc @numerous-book-75463 @purple-potato-34526 @microscopic-florist-22719