Skip to content

Commit

Permalink
fix(database): set disk size in provision op
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jul 11, 2024
1 parent c48bd10 commit ca0828b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aptible/resource_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down

0 comments on commit ca0828b

Please sign in to comment.