A clear and concise description of what the bug is.
To Reproduce
A clear and concise description on how does it work now and what's the current behaviour.
Steps to reproduce the behaviour:
Import a non existing reosurce. Example: terraform import openapi_group.my_group non_existing_resource
openapi_group.my_group: Importing from ID "non_existing_resource"...
Error: [resource='group'] GET /api/group/non_existing_resource failed: HTTP Response Status Code 404 - Not Found. Could not find resource instance: {"id":"ZXOW8Xi4","code":"not_found","status":404,"detail":"group not found"}
2. Run terraform plan and get the diff
terraform plan
openapi_group.my_group: Refreshing state... [id=non_existing_group]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
destroy
Terraform will perform the following actions:
openapi_group.my_group will be destroyed
resource "openapi_group" "my_group" {
id = "non_existing_group" -> null
timeouts {}
}
Plan: 0 to add, 0 to change, 1 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value:
Apply cancelled.
## Expected behaviour
Example:
```gherkin
Scenario:
Given a non existing resource
When terraform import openapi_group.my_group non_existing_resource
Then an error should be thrown and also the state file should be clean and not contain any state for the non found resource
Additional context
Add any other context about the problem here.
Checklist (for admin only)
Don't forget to go through the checklist to make sure the issue is created properly:
[x] I have added a corresponding label (bug) to the issue (right side menu)
[x] I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
A clear and concise description on how does it work now and what's the current behaviour.
Steps to reproduce the behaviour:
terraform import openapi_group.my_group non_existing_resource
Error: [resource='group'] GET /api/group/non_existing_resource failed: HTTP Response Status Code 404 - Not Found. Could not find resource instance: {"id":"ZXOW8Xi4","code":"not_found","status":404,"detail":"group not found"}
terraform plan openapi_group.my_group: Refreshing state... [id=non_existing_group]
An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
openapi_group.my_group will be destroyed
resource "openapi_group" "my_group" {
id = "non_existing_group" -> null
timeouts {} }
Plan: 0 to add, 0 to change, 1 to destroy.
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value:
Apply cancelled.
Additional context
Add any other context about the problem here.
Checklist (for admin only)
Don't forget to go through the checklist to make sure the issue is created properly: