From ca0828b159394e00f77355c5e841771cbc425a6a Mon Sep 17 00:00:00 2001 From: Eric Bower Date: Thu, 11 Jul 2024 13:26:13 -0400 Subject: [PATCH] fix(database): set disk size in provision op --- aptible/resource_database.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aptible/resource_database.go b/aptible/resource_database.go index 5db0666..232976e 100644 --- a/aptible/resource_database.go +++ b/aptible/resource_database.go @@ -110,7 +110,6 @@ func resourceDatabaseCreate(d *schema.ResourceData, meta interface{}) error { create := aptibleapi.NewCreateDatabaseRequestWithDefaults() create.SetHandle(handle) - createDb := client.DatabasesAPI.CreateDatabase(ctx, int32(envID)) create.SetType(databaseType) if diskSize != 0 { @@ -129,12 +128,16 @@ func resourceDatabaseCreate(d *schema.ResourceData, meta interface{}) error { create.SetDatabaseImageId(int32(image.ID)) } + createDb := client.DatabasesAPI.CreateDatabase(ctx, int32(envID)) db, _, err := createDb.CreateDatabaseRequest(*create).Execute() if err != nil { return err } payload := aptibleapi.NewCreateOperationRequest("provision") + if diskSize != 0 { + payload.SetDiskSize(diskSize) + } if containerSize != 0 { payload.SetContainerSize(containerSize) }