From dee83206d233edb4661adbff76e1e14a1ddd48ee Mon Sep 17 00:00:00 2001 From: "guimin.hgm" Date: Fri, 8 Nov 2024 15:58:08 +0800 Subject: [PATCH] Market: Improves the invoking market api method and supports refreshing credential automatically --- alicloud/connectivity/client.go | 5 +++++ website/docs/r/market_order.html.markdown | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/alicloud/connectivity/client.go b/alicloud/connectivity/client.go index 1c6f8ffc2317..bf4f2590203f 100644 --- a/alicloud/connectivity/client.go +++ b/alicloud/connectivity/client.go @@ -1901,6 +1901,11 @@ func (client *AliyunClient) WithMarketClient(do func(*market.Client) (interface{ marketconn.AppendUserAgent(Module, client.config.ConfigurationSource) marketconn.AppendUserAgent(TerraformTraceId, client.config.TerraformTraceId) client.marketconn = marketconn + } else { + err := client.marketconn.InitWithOptions(client.RegionId, client.getSdkConfig(), client.config.getAuthCredential(true)) + if err != nil { + return nil, fmt.Errorf("unable to initialize the Market client: %#v", err) + } } return do(client.marketconn) diff --git a/website/docs/r/market_order.html.markdown b/website/docs/r/market_order.html.markdown index f2a797087399..30f5ce41f222 100644 --- a/website/docs/r/market_order.html.markdown +++ b/website/docs/r/market_order.html.markdown @@ -7,13 +7,13 @@ description: |- Provides a market order resource. --- -# alicloud\_market\_order +# alicloud_market_order Provides a market order resource. -> **NOTE:** Terraform will auto build a market order while it uses `alicloud_market_order` to build a market order resource. --> **NOTE:** Available in 1.69.0+ +-> **NOTE:** Available since v1.69.0. ## Example Usage