Skip to content

Conversation

@savme
Copy link
Collaborator

@savme savme commented Nov 21, 2025

What kind of change does this PR introduce?

feature

What is the current behavior?

Changing instance_size is not supported.
Attempting to do so results in the following error: Update is not supported for project resource: <project>

What is the new behavior?

Plans like this are supported

  ~ resource "supabase_project" "test" {
        id                = "xyz"
      ~ instance_size     = "micro" -> "small"
        name              = "test"
        # (3 unchanged attributes hidden)
    }

@savme savme requested a review from a team as a code owner November 21, 2025 18:03
@savme savme requested a review from sweatybridge November 21, 2025 18:04
@savme savme force-pushed the alex/ter-7-allow-users-to-upgrade-their-compute-size-after-project branch from 6719d52 to b2b3093 Compare November 21, 2025 18:05
@savme savme force-pushed the alex/ter-7-allow-users-to-upgrade-their-compute-size-after-project branch from b2b3093 to f9459b5 Compare November 24, 2025 16:37
// Read Terraform plan data into the model
resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...)
resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...)
resp.Diagnostics.Append(req.State.Get(ctx, &state)...)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ignore values in the current state? I believe TF client will handle this comparison.

See https://github.com/supabase/terraform-provider-supabase/blob/main/internal/provider/settings_resource.go#L197

return diag.Diagnostics{diag.NewErrorDiagnostic("Client Error", msg)}
}

if addonsResp.JSON200 != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bubble up errors here

var freeInstanceSizes = []string{
string(api.V1CreateProjectBodyDesiredInstanceSizeNano),
string(api.V1CreateProjectBodyDesiredInstanceSizePico),
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this check to api side

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On closer look, we need to call the api to remove compute addon if user specifies nano or pico compute size. https://api.supabase.com/api/v1#tag/billing/delete/v1projectsrefbillingaddonsaddon_variant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants