Skip to content

Commit

Permalink
Market: Improves the invoking market api method and supports refreshi…
Browse files Browse the repository at this point in the history
…ng credential automatically
  • Loading branch information
xiaozhu36 committed Nov 8, 2024
1 parent cf67c06 commit 5605ab0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions alicloud/connectivity/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/market_order.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -28,7 +28,7 @@ Basic Usage
```terraform
resource "alicloud_market_order" "order" {
product_code = "cmapi033136"
pay_type = "prepay"
pay_type = "PrePaid"
quantity = 1
duration = 1
pricing_cycle = "Month"
Expand Down

0 comments on commit 5605ab0

Please sign in to comment.