Skip to content

Commit

Permalink
fix(client): [119693049] OmitNil client support token (#2823)
Browse files Browse the repository at this point in the history
* add

* add
  • Loading branch information
SevenEarth authored Sep 12, 2024
1 parent 552c4f8 commit d76d437
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/2823.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_ccn_route_table_associate_instance_config: Support assume role
```
9 changes: 8 additions & 1 deletion tencentcloud/connectivity/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,15 @@ func (me *TencentCloudClient) UseVpcClient(iacExtInfo ...IacExtInfo) *vpc.Client
func (me *TencentCloudClient) UseOmitNilClient(module string) *common.Client {
secretId := me.Credential.SecretId
secretKey := me.Credential.SecretKey
token := me.Credential.Token
region := me.Region
credential := common.NewCredential(secretId, secretKey)
var credential common.CredentialIface
if token != "" {
credential = common.NewTokenCredential(secretId, secretKey, token)
} else {
credential = common.NewCredential(secretId, secretKey)
}

cpf := profile.NewClientProfile()
cpf.HttpProfile.Endpoint = fmt.Sprintf("%s.tencentcloudapi.com", module)
cpf.HttpProfile.ReqMethod = "POST"
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/services/thpc/resource_tc_thpc_workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "tencentcloud_thpc_workspaces" "example" {
disk_type = "CLOUD_HSSD"
}
data_disk {
data_disks {
disk_size = 200
disk_type = "CLOUD_HSSD"
encrypt = false
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/thpc_workspaces.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ resource "tencentcloud_thpc_workspaces" "example" {
disk_type = "CLOUD_HSSD"
}
data_disk {
data_disks {
disk_size = 200
disk_type = "CLOUD_HSSD"
encrypt = false
Expand Down

0 comments on commit d76d437

Please sign in to comment.