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

Updating existing/imported Hyperdrive fails as no ID passed through on Update #3250

Closed
2 tasks done
siame opened this issue Apr 17, 2024 · 4 comments · Fixed by #3251
Closed
2 tasks done

Updating existing/imported Hyperdrive fails as no ID passed through on Update #3250

siame opened this issue Apr 17, 2024 · 4 comments · Fixed by #3251
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Milestone

Comments

@siame
Copy link

siame commented Apr 17, 2024

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

tofu -v
OpenTofu v1.6.0
on darwin_arm64

provider registry.opentofu.org/cloudflare/cloudflare v4.29.0

Affected resource(s)

cloudflare_hyperdrive_config

Terraform configuration files

resource "cloudflare_hyperdrive_config" "hyperdrives" {
  account_id = "my-id"
  name       = "name"
  origin = {
    database = "postgres"
    password = "password"
    host     = "host"
    port     = 5432
    scheme   = "postgres"
    user     = "user"
  }
}

Link to debug output

None

Panic output

No response

Expected output

Should update existing/imported hyperdrive resource with values provided in the cloudflare_hyperdrive_config resource block.

Actual output

╷
│ Error: Error updating hyperdrive config
│
│   with cloudflare_hyperdrive_config.hyperdrives,
│   on cloudflare.tf line 24, in resource "cloudflare_hyperdrive_config" "hyperdrives":
│   24: resource "cloudflare_hyperdrive_config" "hyperdrives" {
│
│ required hyperdrive config id is missing
╵

Steps to reproduce

  1. Create hyperdrive outside of terraform
  2. Write cloudflare_hyperdrive_config resource block for that above created hyperdrive
  3. Import hyperdrive created in step 1 for the resource block created in step 2 using command terraform import cloudflare_hyperdrive_config.example <account_id>/<hyperdrive_config_id>
  4. terraform apply to apply changes to reconcile between imported hyperdrive and cloudflare_hyperdrive_config resource
  5. Should error

Additional factoids

The error message required hyperdrive config id is missing originates from https://github.com/cloudflare/cloudflare-go/blob/master/hyperdrive.go#L13, which in the context of our update call, starts here: https://github.com/cloudflare/cloudflare-go/blob/master/hyperdrive.go#L176-L178.

This is happening because our call to Update within the terraform-provider does not pass through a HyperdriveID parameter: https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/framework/service/hyperdrive_config/resource.go#L130-L143.

Fixing the provider to pass through HyperdriveID should fix this issue.

References

No response

@siame siame added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 17, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@siame
Copy link
Author

siame commented Apr 17, 2024

I'd like to have a go at fixing this issue too.

Copy link

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 17, 2024
@jacobbednarz jacobbednarz added this to the v4.31.0 milestone Apr 22, 2024
Copy link

github-actions bot commented May 1, 2024

This functionality has been released in v4.31.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants