pulumi / pulumi-azure-native

Azure Native Provider
Apache License 2.0
129 stars 35 forks source link

Postgres server missing option for publicNetworkAccess #2860

Open xwipeoutx opened 1 year ago

xwipeoutx commented 1 year ago

What happened?

I was trying to create a Pulumi.AzureNative.DBforPostgreSQL.Server, specifically with the publicNetworkAccess property defined in the REST API.

However, it doesn't exist!

Example

var dbServer = new Server("db", new()
    {
        ServerName = $"db-(REDACTED)-{stack}",
        ResourceGroupName = resourceGroup.Name,
        Sku = new SkuArgs()
        {
            Name = "Standard_B1ms",
            Tier = SkuTier.Burstable
        },
        Version = "14",
        AvailabilityZone = "1",
        Backup = new BackupArgs
        {
            BackupRetentionDays = 7,
            GeoRedundantBackup = "Disabled",
        },
        Network = new NetworkArgs()
        {
            PublicNetworkAccess = "Enabled" // Does not exist!
        },
        CreateMode = CreateMode.Create,
        AdministratorLogin = "someuser",
        AdministratorLoginPassword = "somepassword",
        Storage = new StorageArgs
        {
            StorageSizeGB = 32
        }
    });

Output of pulumi about

running 'dotnet build -nologo .'
  Determining projects to restore...

  All projects are up-to-date for restore.

  (REDACTED) -> C:\code\(REDACTED)

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.01

'dotnet build -nologo .' completed successfully
CLI
Version      3.90.1
Go Version   go1.21.3
Go Compiler  gc

Plugins
NAME          VERSION
azure-native  2.14.0
dotnet        unknown
random        4.14.0

Host
OS       Microsoft Windows 11 Pro
Version  10.0.22621 Build 22621
Arch     x86_64

This project is written in dotnet: executable='C:\Program Files\dotnet\dotnet.exe' version='7.0.203'

Current Stack: (REDACTED)

TYPE                                        URN
pulumi:pulumi:Stack                         urn:pulumi:stg::(REDACTED)::pulumi:pulumi:Stack::(REDACTED)-stg
pulumi:providers:random                     urn:pulumi:stg::(REDACTED)::pulumi:providers:random::default_4_14_0
pulumi:providers:azure-native               urn:pulumi:stg::(REDACTED)::pulumi:providers:azure-native::default_2_14_0
random:index/randomUuid:RandomUuid          urn:pulumi:stg::(REDACTED)::random:index/randomUuid:RandomUuid::jwt-key
random:index/randomPassword:RandomPassword  urn:pulumi:stg::(REDACTED)::random:index/randomPassword:RandomPassword::db-password
azure-native:resources:ResourceGroup        urn:pulumi:stg::(REDACTED)::azure-native:resources:ResourceGroup::rg-)redacted)-stg
azure-native:web:AppServicePlan             urn:pulumi:stg::(REDACTED)::azure-native:web:AppServicePlan::plan
azure-native:dbforpostgresql:Server         urn:pulumi:stg::(REDACTED)::azure-native:dbforpostgresql:Server::db
azure-native:dbforpostgresql:Database       urn:pulumi:stg::(REDACTED)::azure-native:dbforpostgresql:Database::db-(redacted)
azure-native:dbforpostgresql:Configuration  urn:pulumi:stg::(REDACTED)::azure-native:dbforpostgresql:Configuration::extensions-config
azure-native:web:WebApp                     urn:pulumi:stg::(REDACTED)::azure-native:web:WebApp::server

Found no pending operations associated with (REDACTED)

Backend
Name           pulumi.com
URL            https://app.pulumi.com/(REDACTED)
User           (REDACTED)
Organizations  (REDACTED), (REDACTED)
Token type     (REDACTED)

Dependencies:
NAME                VERSION
Pulumi              3.58.0
Pulumi.AzureNative  2.14.0
Pulumi.Random       4.14.0

Pulumi locates its logs in C:\Users\(REDACTED)\AppData\Local\Temp by default

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

mikhailshilkov commented 1 year ago

Hi @xwipeoutx Thank you for raising this issue.

This property is marked as read-only in the Azure API specs: https://github.com/Azure/azure-rest-api-specs/blob/14d24d17491d8c2bde24532cb8cc2d663c0ffd9f/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-12-01/FlexibleServers.json#L905

That's why we only project it to outputs, not inputs.

If you think it's a mistake, could you please file an upstream issue in https://github.com/Azure/azure-rest-api-specs/issues?

xwipeoutx commented 1 year ago

Thanks @mikhailshilkov, have raised it up the chain.

penenkel commented 4 months ago

fyi, this seems to have been fixed upstream in the preview versions since 2023-06-01-preview.