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

Primary branch config is ignored #42

Closed
domenikk opened this issue Aug 27, 2023 · 5 comments · Fixed by #49
Closed

Primary branch config is ignored #42

domenikk opened this issue Aug 27, 2023 · 5 comments · Fixed by #49
Labels
bug Something isn't working
Milestone

Comments

@domenikk
Copy link

Terraform Version

Terraform v1.5.6
on darwin_arm64
+ provider registry.terraform.io/kislerdm/neon v0.2.1

Provider Version

0.2.1

Affected Resource(s)

  • neon_project

Terraform Configuration Files

terraform {
  required_providers {
    neon = {
      source  = "kislerdm/neon"
      version = "0.2.1"
    }
  }
}

provider "neon" {}

resource "neon_project" "this" {
  name      = var.project_name
  region_id = var.region

  branch {
    name = "master"
    database_name = "neon-test"
    role_name = "admin"
  }
}

Debug Output

https://gist.github.com/domenikk/7eae89c13154375f721a800c00e6e363

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

Primary branch should have been created using the values (name, database_name, role_name) provided in config.

Actual Behavior

Branch has been created with the default values from Neon, ignoring config. From .tfstate file:

"branch": [
  {
    "database_name": "neondb",
    "id": "br-frosty-cherry-96448510",
    "name": "main",
    "role_name": "neon.user"
  }
]

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234
@domenikk
Copy link
Author

domenikk commented Aug 27, 2023

@kislerdm This line stood out after a quick review of the relevant code:

if v, ok := mConf["database_name"].(string); ok && v != "" {
o.RoleName = &v
}
(RoleName instead of DatabaseName).
Not sure if it explains why branch name and role_name are ignored as well.

@kislerdm
Copy link
Owner

kislerdm commented Sep 16, 2023

@domenikk Hello! Thank you for opening the issue!

AFAIK, the default branch cannot be mutated upon project creation. I'll check with Neon folks, and come back with execution paths for us to align on if you don't mind. Thanks for your support!

Regards,
Dmitry

kislerdm added a commit that referenced this issue Sep 18, 2023
fix: fixed custom default_endpoint_settings configuration;
fix: fixed custom quota configuration;
fix: fixed custom default branch configuration;

Issues:
Signed-off-by: Dmitry Kisler <[email protected]>
#42
#48
@kislerdm kislerdm added the bug Something isn't working label Sep 18, 2023
@kislerdm kislerdm added this to the v0.2.2 milestone Sep 18, 2023
@kislerdm
Copy link
Owner

kislerdm commented Sep 18, 2023

@domenikk hey! A headsup: the issue's root cause was identified, it will be fixed in v0.2.2. ETA: 2023-09-20.

@domenikk
Copy link
Author

@kislerdm that's great news. Thanks a lot for looking into it

@kislerdm
Copy link
Owner

@domenikk Hey! Thank you for your contribution! May I kindly ask to star the repo to gain its visibility? Thanks!

kislerdm added a commit that referenced this issue Sep 19, 2023
fix: fixed custom default_endpoint_settings configuration;
fix: fixed custom quota configuration;
fix: fixed custom default branch configuration;

Issues:
Signed-off-by: Dmitry Kisler <[email protected]>
#42
#48
@kislerdm kislerdm linked a pull request Sep 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants