Skip to content

fix(client): [119693049] OmitNil client support token #2823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading