Hi, I’m trying to update our solution to use expli...
# general
r
Hi, I’m trying to update our solution to use explicit (custom) providers instead of the default one but I’m having a lot of issues with actually achieving that 😕 So following documentation and response from one person in this GitHub issue I have updated our code to something like this:
Copy code
var regions = new []
{
    new { Name = "ireland", Region = "eu-west-1" },
    new { Name = "north-virginia", Region = "us-east-1" },
};

foreach (var region in regions)
{
    var nativeProvider = new PulumiNative.Provider(region.Name, new PulumiNative.ProviderArgs
    {
        Region = region.Region,
    }, new CustomResourceOptions
    {
        Aliases = new List<Input<Alias>>
        {
            new Alias
            {
                Urn = "urn:pulumi:development::AWS.Infrastructure::pulumi:providers:aws-native::default_0_75_0", // that's the existing provider that I want to rename
            },
        },
    });
}
Above code, according to the comment from the issue, should work but it just throws following error:
Copy code
`error: Duplicate resource URN 'urn:pulumi:development::AWS.Infrastructure::pulumi:providers:aws-native::default_0_75_0' conflicting with alias on resource with URN 'urn:pulumi:development::AWS.Infrastructure::pulumi:providers:aws-native::ireland'
(full diff below)
Copy code
'dotnet build -nologo .' completed successfully
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:development::AWS.Infrastructure::pulumi:pulumi:Stack::AWS.Infrastructure-development]
error: Duplicate resource URN 'urn:pulumi:development::AWS.Infrastructure::pulumi:providers:aws-native::default_0_75_0' conflicting with alias on resource with URN 'urn:pulumi:development::AWS.Infrastructure::pulumi:providers:aws-native::ireland'
    ~ pulumi:providers:aws-native: (update)
        [id=316643b1-d250-4441-b043-f54a9a592a04]
        [urn=urn:pulumi:development::AWS.Infrastructure::pulumi:providers:aws-native::ireland]
        region                   : "eu-west-1"
      + skipCredentialsValidation: "true"
      + skipGetEc2Platforms      : "true"
      + skipMetadataApiCheck     : "true"
      + skipRegionValidation     : "true"
        version                  : "0.75.0"
Resources:
    ~ 1 to update
    1 unchanged