This message was deleted.
# azure
s
This message was deleted.
b
Hi Paul! Can you share your plan when you do a preview? pulumi preview --diff, and also the code that you use (including the code using the ignoreChanges parameter)
n
Hello Mats! I am a colleague of Paul, our configuration does not allow us to easily run pulumi preview unfortunately. Code snippet:
Copy code
import (
  dbforpostgresql "<http://github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2/v20230601preview|github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2/v20230601preview>"
  "<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

server, err := dbforpostgresql.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
  ServerName:                 pulumi.String("name"),
  CreateMode:                 pulumi.String("Create"),
  ...
  Storage: dbforpostgresql.StorageArgs{
    AutoGrow:      pulumi.String("Enabled"),
    StorageSizeGB: <http://pulumi.Int|pulumi.Int>(storageGB),
  },
  ...
},
  pulumi.IgnoreChanges([]string{
    "storage.storageSizeGB",
  }),
)
Error:
Copy code
Requested data Disk size '131072' cannot be less than current size '262144'. Please make sure to request correct disk size.
The snippet code works on creation and as long as autogrow did not come into effect. IgnoreChanges seemingly still sends the value that succeeded last time, being unaware of azure having scaled up the instance. The "storageGB" variable we set would ideally only be used on creation.
c
Are you certain that the string literal value you've given in
ignoreChanges
is correct? Because
ignoreChanges
does exactly what you are looking for and I doubt that the value you've given it is targeting the property in question.
For example, should it be
storage.storageSizeGb
? Note the camelCase
Gb
instead of
GB
a
From Pulumi Docs:
The property names passed to
ignoreChanges
should always be the “camelCase” version of the property name, as used in the core Pulumi resource model. For example, a property named
NestedResource
would turn into
nestedResource
.
StorageSizeGB
is also a parameter, which is nested under
Storage
so I think @clever-sunset-76585 is correct that it would be
storage.storageSizeGb
but you should see that if you run
pulumi pre --diff --refresh
👍 1