Does anyone know if there's a way to access and mo...
# general
a
Does anyone know if there's a way to access and modify the attributes of a default provider object? Failing that, has anyone worked out a way to automate replacing the provider object in an existing stack deployment to avoid having to recreate all of the resources?
b
aliases should handle that i believe
a
Can you elaborate?
b
if you look at the
diff
that happens when you change providers, it's doing a recreate because the
urn
is changing. If you alias the resource properly (https://www.pulumi.com/docs/intro/concepts/resources/options/aliases/) it shouldn't do any recreation
a
Thanks! I'll take a look.
b
On this front (modify the attributes of a default provider object), it seems that: • aliasing the Provider works well for certain resources, but on others, things need to be replaced? Is this a problem with the resource or expected? (example is an Iam Policy on AWS. Lots of internal attributes getting dropped in addition, etc.)
Copy code
~ name       : "colorado-external-dns-policy-3c3afa2" => "colorado-external-dns-policy-5e5f314"
• on the original question, is it possible to set aliases for the default provider? i.e. if you wanted to migrate back to the default provider? I cannot create a new provider w/ the name
default
, and I have not found a way to reference / modify the default provider.
For the record, default is pointed at us-east-2, and have set this to migrate (python):
Copy code
us_east_2_provider = aws.Provider(
        f'us-east-2-provider',
        region='us-east-2',
        opts=pulumi.ResourceOptions(aliases=[pulumi.Alias(name='default')]),
    )