Skip to content

Commit 64eea2a

Browse files
committed
use proxy
1 parent c13e667 commit 64eea2a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tencentcloud/connectivity/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ type TencentCloudClient struct {
120120
Region string
121121
Protocol string
122122
Domain string
123+
Proxy string
123124

124125
cosConn *s3.S3
125126
tencentCosConn *cos.Client
@@ -221,6 +222,8 @@ func (me *TencentCloudClient) NewClientProfile(timeout int) *profile.ClientProfi
221222
cpf.HttpProfile.Scheme = me.Protocol
222223
// request domain
223224
cpf.HttpProfile.RootDomain = me.Domain
225+
// request proxy
226+
cpf.HttpProfile.Proxy = me.Proxy
224227
// default language
225228
cpf.Language = "en-US"
226229

@@ -239,6 +242,8 @@ func (me *TencentCloudClient) NewClientIntlProfile(timeout int) *intlProfile.Cli
239242
cpf.HttpProfile.Scheme = me.Protocol
240243
// request domain
241244
cpf.HttpProfile.RootDomain = me.Domain
245+
// request proxy
246+
cpf.HttpProfile.Proxy = me.Proxy
242247
// default language
243248
cpf.Language = "en-US"
244249

tencentcloud/provider.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ const (
121121
PROVIDER_REGION = "TENCENTCLOUD_REGION"
122122
PROVIDER_PROTOCOL = "TENCENTCLOUD_PROTOCOL"
123123
PROVIDER_DOMAIN = "TENCENTCLOUD_DOMAIN"
124+
PROVIDER_PROXY = "TENCENTCLOUD_PROXY"
124125
//internal version: replace envYunti begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
125126
//internal version: replace envYunti end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
126127
PROVIDER_ASSUME_ROLE_ARN = "TENCENTCLOUD_ASSUME_ROLE_ARN"
@@ -192,6 +193,12 @@ func Provider() *schema.Provider {
192193
DefaultFunc: schema.EnvDefaultFunc(PROVIDER_DOMAIN, nil),
193194
Description: "The root domain of the API request, Default is `tencentcloudapi.com`.",
194195
},
196+
"proxy": {
197+
Type: schema.TypeString,
198+
Optional: true,
199+
DefaultFunc: schema.EnvDefaultFunc(PROVIDER_PROXY, nil),
200+
Description: "The proxy of the API request.",
201+
},
195202
//internal version: replace enableBpass begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
196203
//internal version: replace enableBpass end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
197204
"assume_role": {
@@ -2009,6 +2016,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
20092016
region string
20102017
protocol string
20112018
domain string
2019+
proxy string
20122020
)
20132021

20142022
if v, ok := d.GetOk("secret_id"); ok {
@@ -2044,6 +2052,10 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
20442052
domain = v.(string)
20452053
}
20462054

2055+
if v, ok := d.GetOk("proxy"); ok {
2056+
proxy = v.(string)
2057+
}
2058+
20472059
// standard client
20482060
var tcClient TencentCloudClient
20492061
tcClient.apiV3Conn = &connectivity.TencentCloudClient{
@@ -2055,6 +2067,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
20552067
Region: region,
20562068
Protocol: protocol,
20572069
Domain: domain,
2070+
Proxy: proxy,
20582071
}
20592072

20602073
var (

0 commit comments

Comments
 (0)