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

Add retry mechanism in tables. #216

Closed bigdatasourav closed 2 years ago

bigdatasourav commented 3 years ago

Is your feature request related to a problem? Please describe. reference links - https://www.alibabacloud.com/help/en/apsaravideo-for-vod/latest/go-sdk-initialization https://github.com/aliyun/alibaba-cloud-sdk-go/blob/7259de46d58ef905c66e04babf791190512a85da/sdk/config.go

We could implement configuration parameters in the config file as we did in the AWS config file. We can use the parameters like AutoRetry and MaxRetryTime. Below is a sample -

connection "alicloud" {
  plugin = "alicloud"

  # You may connect to one or more regions. If `regions` is not specified,
  # Steampipe will use a single default region using the below resolution
  # order:
  #  1. The `ALIBABACLOUD_REGION_ID`, `ALICLOUD_REGION_ID` or `ALICLOUD_REGION` environment variable
  #regions     = ["us-east-1", "ap-south-1"]

  # If no credentials are specified, the plugin will use the environment variables
  # resolver to get the current credentials.
  # Alternatively, you may set static credentials with the `access_key` and `secret_key` arguments.
  #access_key   = "LTAI4GBVFakeKey09Kxezv66"
  #secret_key   = "6iNPvThisIsNotARealSecretk1sZF"

  #auto_retry = true
  #max_retry_time = 3

}

We can also provide these parameters in env variables as Alicloud does support env variables for credentials. https://registry.terraform.io/providers/aliyun/alicloud/latest/docs.

We need to update the getEnv function here to take those parameter from the config/Env variables and implement NewClientWithOptions in each service function like this.

We can also check if we can use the custom jitter as we did use in aws here

github-actions[bot] commented 2 years ago

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

github-actions[bot] commented 2 years ago

'This issue was closed because it has been stalled for 60 days with no activity.'