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

[BUG] No validation of firewall_id on civo_instance resource on API? #272

Open
fernando-villalba opened this issue Jul 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fernando-villalba
Copy link
Contributor

fernando-villalba commented Jul 22, 2024

Issues

Using a completely wrong firewall_id will create the resource with the wrong firewall id

resource "civo_instance" "foo" {
    hostname = "amazingthingy20"
    tags = ["python", "nginx"]
    notes = "This is a test-issue"
    size = "g3.xsmall"
    region = "LON1"
    firewall_id = "fdsgdrefdfshgfdghdfsgsdref" # this field is wrong
    disk_image = "debian-11"
}

When listing the resource on the CLI we see this:

image

When going into the Dashboard we it's naming the firewall default:

image

But there is not firewall named Default:

image

This issue looks like it comes from the API, however when we create the same resource with the CLI, we don't get such issue:

image

Acceptance Criteria

  • Have this resource fail straight away when entering the wrong value fore firewall_id and return the error message from the API.
  • If the issue needs to be fixed on the API, fix it there, create internal tickets and/or liaise with anyone accordingly.

This ticket should be used as a reference for a bigger piece of work revamping the way we handle errors in terraform. The default behaviour with our provider seems to be to keep trying and it does NOT return the error the API gives, which is a problem.

We need to go through the entire provider and change the behaviour for everything not by writing error messages in terraform provider, but returning errors from the API

@fernando-villalba fernando-villalba added the bug Something isn't working label Jul 22, 2024
@fernando-villalba fernando-villalba changed the title [BUG] No validation of firewall_id on civo_instance resource [BUG] No validation of firewall_id on civo_instance resource on API? Jul 22, 2024
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

No branches or pull requests

1 participant