Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to define branch auto-scaling settings #134

Open
steve-todorov opened this issue Dec 10, 2024 · 2 comments
Open

Not possible to define branch auto-scaling settings #134

steve-todorov opened this issue Dec 10, 2024 · 2 comments

Comments

@steve-todorov
Copy link

steve-todorov commented Dec 10, 2024

Details

It looks like it is not possible to set auto-scaling settings per branch inside a neon_project. Is there any reason for that or another way to do it?

resource "neon_project" "my_project" {
  name                      = var.neon_project
  org_id                    = var.neon_org_id
  history_retention_seconds = (3600 * 24)
  pg_version                = 17
  region_id                 = "aws-us-west-2"

  branch {
    name          = "my-default-branch-name"
    // no auto scaling for this branch?
    endpoint_settings {
       autoscaling_limit_min_cu = 2
       autoscaling_limit_max_cu = 4
       suspend_timeout_seconds  = 0
    }
  }

  default_endpoint_settings {
    autoscaling_limit_min_cu = 0.25
    autoscaling_limit_max_cu = 0.25
    suspend_timeout_seconds  = 60
  }
}
@kislerdm
Copy link
Owner

kislerdm commented Jan 30, 2025

Hey Steve! default_endpoint_settings configures auto-scaling for the compute resources associated with the default branch using the branch attribute of the neon_project tf resource.

@steve-todorov
Copy link
Author

steve-todorov commented Jan 30, 2025

Hey Dmitry!

Thanks for your reply.

If I am reading this right you are saying that the branch {} inherits the default_endpoint_settings which makes sense.

However, our Neon project is used for production and the default branch is our defacto production instance.
As such, the production branch has different (higher) specs than the actual default default_endpoint_settings settings and the default_endpoint_settings settings are used by our feature branches (during development).

Hence the question -- how to set endpoint_settings for the branch {} section in the neon_project resource or is there another way to achieve the same thing? I attempted using the neon_endpoint but it is trying to create a new endpoint resource and fails because one already exists.

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

No branches or pull requests

2 participants