turbot / steampipe-plugin-alicloud

Use SQL to instantly query Alibaba Cloud resources across regions and accounts. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/alicloud
Apache License 2.0
12 stars 6 forks source link

Querying `alicloud_cs_kubernetes_cluster` table result in error when no ACK present #338

Closed vmdude closed 1 year ago

vmdude commented 1 year ago

Describe the bug Querying the alicloud_cs_kubernetes_cluster table require the AliyunCSDefaultRole RAM system role to exist, which is created upon first ACK cluster creation. When you query on an account that doesn't have this role, the query fail with the following error:

Error: SDK.ServerError
ErrorCode:
Recommend:
RequestId:
Message: {"code":"400","message":"Aliyun API Error: RequestId: XXX Status Code: 404 Code: EntityNotExist.Role Message: The role not exists: acs:ram::XXX:role/aliyuncsdefaultrole. ","requestId":"XXX","status":400}

Alicloud steampipe plugin does not seems to support the ignore_code_errors settings in connections like AWS/GCP plugin, thus query will always exit 1 making it difficult to properly execute it automatically.

Steampipe version (steampipe -v)

steampipe --version
Steampipe v0.19.1

Plugin version (steampipe plugin list)

steampipe plugin list
hub.steampipe.io/plugins/turbot/alicloud@latest = 0.14.0

To reproduce Configure an Alicloud profile to an account where no ACK cluster has ever been configured. Run the following query:

select
  *
from
  alicloud_cs_kubernetes_cluster;

Expected behavior Check if needed role is available before using the API call, or having the possibility to ignore these errors like in GCP plugin.

misraved commented 1 year ago

Thanks @vmdude for raising the bug 👍.

We will take a look at it and post our feedback on this thread 👍.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

misraved commented 1 year ago

Fixed in https://github.com/turbot/steampipe-plugin-alicloud/pull/344