Skip to content
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

PostgreSQL - simple resource change requires the resource to recreate and hits the quota on Azure West Europe #3961

Open
Karol-Pawlowski-Allegro opened this issue Feb 18, 2025 · 6 comments · May be fixed by #3983
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec

Comments

@Karol-Pawlowski-Allegro
Copy link

Karol-Pawlowski-Allegro commented Feb 18, 2025

What happened?

Hi Guys,

We have a critical issue deploying PostgreSQL using Pulumi to WestEurope region. Due to the PostgreSQL implementation that uses PUT request method, we hit the region quota. The region has limited resources capacity and the quota may be hit when allocating new resources but that's not something we want to get now.

The change we want to apply is very straightforward and should not require any recreation (tags and credentials).

Image

The error:

Image

I have found the ticket: #4 that suggests the PUT should only be applied for resource creation, but don't see the PostgreSQL listed there.

Unfortunately, the migration to another region is not planned for the near future. Is there a way to perform the PATCH update for PostgreSQL or what is recommended way to mitigate the issue.

Example

postgreSQL_logs.txt

        var networkStack = DeploymentContext.GetStackReference<NetworkStack>();
        var subnetId = networkStack
            .RequireOutput(x => x.SubnetIds)
            .Apply(subnets => subnets[Constants.References.PostgresFlexibleSubnetName].ToString());

        var deploymentLocation = ctx.AzureLocation;
        var dnsZoneId = PrivateDnsZoneHelper.GetPrivateDnsZoneId(
            Constants.References.PostgresDnsZone, deploymentLocation).ToString();

        var login = config.RequireSecret("JobService--Postgres--LoginPrefix")!;
        var password = config.RequireSecret("JobService--Postgres--Password")!;

        _ = new Server(
            name: ctx.ToResourceName<Server>(),
            args: new ServerArgs
            {
                AdministratorLogin = login,
                AdministratorLoginPassword = password,
                AvailabilityZone = "2",
                DataEncryption = new DataEncryptionArgs
                {
                    Type = ArmServerKeyType.SystemManaged,
                },
                Location = deploymentLocation,
                Network = new NetworkArgs
                {
                    DelegatedSubnetResourceId = subnetId!,
                    PrivateDnsZoneArmResourceId = dnsZoneId!,
                },
                ReplicationRole = ReplicationRole.Primary,
                ResourceGroupName = resourceGroupName,
                ServerName = ctx.ToResourceName<Server>(),
                Sku = new SkuArgs
                {
                    Name = "Standard_B1ms",
                    Tier = SkuTier.Burstable,
                },
                Storage = new StorageArgs
                {
                    StorageSizeGB = 32,
                },
                Version = ServerVersion.ServerVersion_14,
            });
    }

Output of pulumi about

CLI
Version 3.150.0
Go Version go1.23.6
Go Compiler gc

Host
OS darwin
Version 14.7
Arch arm64

This project is written in dotnet: executable='/opt/homebrew/bin/dotnet' version='8.0.404'

Current Stack: organization/Devops.Examples/devops.dev

Found no resources associated with devops.dev

Found no pending operations associated with devops.dev

Backend
Name polpc13463
URL file://~
User karol.pawlowski
Organizations
Token type personal

No dependencies found

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).

@Karol-Pawlowski-Allegro Karol-Pawlowski-Allegro added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Feb 18, 2025
@thomas11
Copy link
Contributor

Thank you for reporting this, @Karol-Pawlowski-Allegro. The current logic always uses PUT unless it's not even defined in the spec. This is due to the findings from #4 where PATCH was found to be insufficient and inconsistent.

We'll probably need to look into hard-coding some exceptions, such as this one.

@thomas11 thomas11 added impact/usability Something that impacts users' ability to use the product easily and intuitively and removed needs-triage Needs attention from the triage team labels Feb 18, 2025
@Karol-Pawlowski-Allegro
Copy link
Author

thanks @thomas11. Is there a way I could mitigate the issue before it's addressed ?

@thomas11
Copy link
Contributor

Unfortunately, I don't think there is one at this point.

@PawelHaracz
Copy link

@thomas11, as you mentioned "hard-coding some exceptions", is it possible to modify the postgresql to support the patch method? I can try to handle it but I need some help where should I start.

@Karol-Pawlowski-Allegro
Copy link
Author

Karol-Pawlowski-Allegro commented Feb 19, 2025

@thomas11 I had my hopes at dynamic provider but unfortunately saw it's not supported for C# yet. I guess, if we get a little assistance we could contribute

@thomas11
Copy link
Contributor

I think #3983 should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants