wooden-memory-88493
02/07/2024, 9:24 AMbillowy-engine-58246
02/07/2024, 10:25 AMnice-soccer-3571
02/07/2024, 12:42 PMimport (
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:
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.clever-sunset-76585
02/07/2024, 2:47 PMignoreChanges
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.clever-sunset-76585
02/07/2024, 2:50 PMstorage.storageSizeGb
? Note the camelCase Gb
instead of GB
adventurous-butcher-54166
02/07/2024, 6:28 PMThe property names passed toshould always be the “camelCase” version of the property name, as used in the core Pulumi resource model. For example, a property namedignoreChanges
would turn intoNestedResource
.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