New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade Azure-Native Api Version to latest forces resources recreation #2505
Comments
Thanks! I joined because I thought it was cool too! I'm under the impression that this is an azure-native provider issue so I'm going to transfer it there and they might be better able to assist. |
Hi @rexebin, sorry you're running into this issue. Would you be able to show us the diff that Pulumi prints on |
@thomas11 It doesn't try to update existing ones, it ignores them and tries to create new resources, no relationship with the resource created with the old API version. For example,
|
Hi @rexebin, I just tried to reproduce the issue with a minimal Key Vault program but wasn't able to. Changing the imported version from package main
import (
keyvault "github.com/pulumi/pulumi-azure-native-sdk/keyvault/v20211001"
"github.com/pulumi/pulumi-azure-native-sdk/resources"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
resourceGroup, err := resources.NewResourceGroup(ctx, "tkapplerrg", nil)
if err != nil {
return err
}
keyvault.NewVault(ctx, "tkapplervault", &keyvault.VaultArgs{
ResourceGroupName: resourceGroup.Name,
Properties: &keyvault.VaultPropertiesArgs{
Sku: &keyvault.SkuArgs{
Family: pulumi.String(keyvault.SkuFamilyA),
Name: keyvault.SkuNameStandard,
},
TenantId: pulumi.String("72f988bf-86f1-41af-91ab-2d7cd011db47"),
AccessPolicies: &keyvault.AccessPolicyEntryArray{
&keyvault.AccessPolicyEntryArgs{
ObjectId: pulumi.String("f4d7f4a0-3f9c-4f4e-8f5c-5b1f1e1b9f5e"),
TenantId: pulumi.String("72f988bf-86f1-41af-91ab-2d7cd011db47"),
Permissions: &keyvault.PermissionsArgs{
Certificates: pulumi.StringArray{
pulumi.String("list"),
},
},
},
},
},
})
return nil
})
} Are you able to share a sample program that shows the issue? |
Hi @thomas11, thanks for taking time to try to reproduce. Did you deploy |
I'm getting something that looks like the same issue. I have changed a managed cluster from the default api version to I have quite a few resources in the stack, so apologize for the rather long output: |
So i have been digging a bit more into this and trying to create a more minimal example. I have concluded 2 things:
Do note: I have only tested with the ManagedCluster here, since that is what I had my issue on. Test code: using Pulumi.AzureNative.Resources.V20220901;
using PulumiAzureReplacement;
using Deployment = Pulumi.Deployment;
await Deployment.RunAsync(() =>
{
var rg = new ResourceGroup("rg", new()
{
Location = "westeurope",
ResourceGroupName = "azreptest"
});
var c = new ClusterComponentResource("cluster", new()
{
ResourceGroup = rg.Name,
});
});
using Pulumi;
using Pulumi.AzureNative.ContainerService.V20230102Preview;
using Pulumi.AzureNative.ContainerService.V20230102Preview.Inputs;
namespace PulumiAzureReplacement;
public class ClusterComponentResource : ComponentResource
{
public ClusterComponentResource(string name, ClusterComponentResourceArgs args) : base("dgz:index:cluster", name, args)
{
var managedCluster = new ManagedCluster("managedCluster", new()
{
AgentPoolProfiles = new[]
{
new ManagedClusterAgentPoolProfileArgs
{
AvailabilityZones = new[]
{
"1",
},
Count = 1,
EnableNodePublicIP = true,
Mode = "System",
Name = "nodepool1",
OsType = "Linux",
Type = "VirtualMachineScaleSets",
VmSize = "Standard_B4ms",
},
},
Identity = new ManagedClusterIdentityArgs
{
Type = ResourceIdentityType.SystemAssigned,
},
DnsPrefix = "azreptest",
ResourceGroupName = args.ResourceGroup,
ResourceName = "clustername1",
}, new()
{
Parent = this,
Aliases =
{
new Alias()
{
Parent = this,
Name = "managedCluster",
Type = "azure-native:containerservice:ManagedCluster",
}
}
});
RegisterOutputs();
}
}
public class ClusterComponentResourceArgs : ResourceArgs
{
public required Input<string> ResourceGroup { get; init; }
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.54.1" />
<PackageReference Include="Pulumi.AzureNative" Version="1.99.2" />
</ItemGroup>
</Project> |
Cool, good to know. To be clear, we have been upgrading the api versions and pulumi azure native packages a lot of times before, never encountered this issue, until the version 103. My bet is that some changes in release 103 caused issue. |
Just out of curiosity: are the resource you have issues with also declared in a component resource like in the code I made, or are they at the "root" of the stack like the resource group in my example? |
All of our resources are encapsulated into custom classes and have their
container as their parents.
…On Thu, 22 Jun 2023 at 19:44, Rasmus Hansen ***@***.***> wrote:
Cool, good to know.
To be clear, we have been upgrading the api versions and pulumi azure
native packages a lot of times before, never encountered this issue, until
the version 103.
My bet is that some changes in release 103 caused issue.
Just out of curiosity: are the resource you have issues with also declared
in a component resource like in the code I made, or are they at the "root"
of the stack like the resource group in my example?
—
Reply to this email directly, view it on GitHub
<#2505 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTDVB4LP3HAW5WPRWDLHGDXMSHBXANCNFSM6AAAAAAY7Q3QMM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@rexebin Which language are you using? It sounds like @zlepper has issues with .NET, are you also using it? @justinvp This sounds similar to pulumi/pulumi#12662. Do we know if C# works correctly? |
@rexebin what version of the Pulumi CLI are you using? The issue sounds like it could be pulumi/pulumi#12848, which was fixed in v3.72.0 on 6/15. Are you still hitting this using the latest version of the CLI (as of today v3.75.0)? |
I was using 3.71.0, but the cli is doing fine until I upgrade the azure
native package to 1.103.
…On Fri, 14 Jul 2023 at 01:15, Justin Van Patten ***@***.***> wrote:
@rexebin <https://github.com/rexebin> what version of the Pulumi CLI are
you using?
@zlepper <https://github.com/zlepper> same, what version of the Pulumi
CLI are you using?
The issue sounds like it could be pulumi/pulumi#12848
<pulumi/pulumi#12848>, which was fixed in v3.72.0
on 6/15. Are you still hitting this using the latest version of the CLI (as
of today v3.75.0)?
—
Reply to this email directly, view it on GitHub
<#2505 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTDVB73K7VTQBCBOWKSBRTXQCFQPANCNFSM6AAAAAAY7Q3QMM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I see something similar since using native for resource groups, which is quite annoying since it contains all the other resources xD The typescript code:
the output of pulumi up
The output of pulumi about
|
What happened?
First of all, thanks for the awesome product.
I upgraded to Pulumi Azure Native package 1.103.0 and a few API versions are marked as obsolete. So I upgraded them to the recommended version, for example:
On redeployment, resources are being created:
Expected Behavior
Changing API version should not require resource recreations as the document indicates: https://www.pulumi.com/registry/packages/azure-native/version-guide/#switching-between-api-versions
Steps to reproduce
Output of
pulumi about
azure-native:documentdb/v20230315:DatabaseAccount (f3a5e968b6de4b2380a76afd187cadf3-exa-ees):
error: cannot create already existing subresource '/subscriptions/***/resourceGroups/xxxxx/providers/Microsoft.DocumentDB/databaseAccounts/xxxxx'
names are replaced with xxxx.
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).
The text was updated successfully, but these errors were encountered: