SAP / terraform-exporter-btp

The Terraform Exporter for SAP BTP is a tool that helps export resources from a SAP BTP account. It generates Terraform scripts for the import of resources and enables the import of the Terraform state.
https://sap.github.io/terraform-exporter-btp/
Apache License 2.0
3 stars 0 forks source link

[FEATURE] Improve Usability for wrong subaccount ID #126

Closed lechnerc77 closed 3 weeks ago

lechnerc77 commented 3 weeks ago

What area do you want to see improved?

other

Is your feature request related to a problem? Please describe.

Currently the output generated during terraform apply if the user specifies the wrong subaccount is hard to read. As the API returns a 404 (see https://api.sap.com/api/APIAccountsService/path/getSubaccount) identifying that either subaccount or global account is not found, it would be helpful if this could be propagated in a more readable manner

Describe the solution you would like

In case of a 404 during a terraform apply for subaccounts the error message should be transformed to a more readable message

Describe alternatives you have considered

n/a

Additional context

> btptf create-json -s 0815

🚀 Creation of resource list started ...

⣽  collecting resources2024/10/15 12:22:34 error running Apply: exit status 1

Error: API Error Reading Resource Subaccount

  with data.btp_subaccount.all,
  on main.tf line 1, in data "btp_subaccount" "all":
   1: data "btp_subaccount" "all"{

404 Not Found: [no body] [Error: 404]

Error: Value Conversion Error

  with data.btp_subaccount.all,
  on main.tf line 1, in data "btp_subaccount" "all":
   1: data "btp_subaccount" "all"{

An unexpected error was encountered while verifying an attribute value
matched its expected type to prevent unexpected behavior or panics. This is
always an error in the provider. Please report the following to the provider
developer:

Expected framework type from provider logic:
types.MapType[types.SetType[basetypes.StringType]] / underlying type:
tftypes.Map[tftypes.Set[tftypes.String]]
Received framework type from provider logic: types.MapType[!!! MISSING TYPE
!!!] / underlying type: tftypes.Map[tftypes.DynamicPseudoType]
Path: labels
github-actions[bot] commented 3 weeks ago

Thanks for the feature request. We evaluate it and update the issue accordingly.

Community Note

Voting for Prioritization

Volunteering to Work on This Issue