Skip to content

feat(provider): [116938598]support set proxy #2607

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

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4d0e996
add proxy
hellertang Apr 29, 2024
921b9c1
add proxy
hellertang Apr 29, 2024
35762b3
add changelog
hellertang Apr 29, 2024
bec1e06
feat(ci): golang-ci (#2609)
WeiMengXS Apr 29, 2024
d3c18e8
feat(postgresql): [117095855]support cpu for pg (#2605)
hellertang Apr 29, 2024
88c427d
feat(cvm): [117096263] Output `cpu`, `memory`, `os_name` (#2608)
hellertang Apr 29, 2024
d3498ec
fix(cls): [117200212] cls index support dynamic_index params (#2606)
SevenEarth Apr 29, 2024
f412428
feat(tco): [117095836]add resource organization policy (#2604)
WeiMengXS Apr 29, 2024
f6a76f3
docs: add changelog of version v1.81.90
andrew-tx Apr 29, 2024
b3fca6b
fix(iacExt): [116337119] Optimizing the code (#2613)
SevenEarth Apr 30, 2024
4556a81
fix(ckafka): [116791339] Updated ckafka route documentation (#2614)
SevenEarth Apr 30, 2024
5ee893a
docs: add changelog of version v1.81.91
andrew-tx Apr 30, 2024
cd2ccd9
docs(clb): [116790844]Waste resources (#2601)
WeiMengXS May 1, 2024
e37b3d5
feat(clb): [116532977]support healthcheck don't checke parameter (#2598)
WeiMengXS May 2, 2024
75b25fa
feat(es): [115889723]Fix resource scanning issue (#2602)
bruceybian May 6, 2024
c1e16ea
fix(cdb): [117252423]Fix the problem of multiple values ​​in fields d…
gitmkn May 6, 2024
7a0ebb8
fix(tmp): [117224022]Fix array order issue (#2620)
gitmkn May 6, 2024
8fc09fa
docs: add changelog of version v1.81.92
andrew-tx May 6, 2024
f29eeb9
update clb doc (#2623)
hellertang May 11, 2024
c9e550f
feat(tke): [116855855]add tencentcloud_kubernetes_addon (#2624)
lyu571 May 11, 2024
f2a875b
feat(tdmq): [116612886]add tencentcloud_tdmq_topic_with_full_id (#2625)
tongyiming May 13, 2024
6c89e8f
docs(clb): [116968016]update-doc (#2622)
WeiMengXS May 13, 2024
3673f72
fix(mongodb): [117095823]mongodb support update sg (#2628)
tongyiming May 13, 2024
1b216f5
docs: add changelog of version v1.81.93
andrew-tx May 13, 2024
6257fee
modify cvm doc (#2632)
hellertang May 14, 2024
e7b7d57
modify doc which has trouble (#2633)
hellertang May 14, 2024
fc29ee0
fix(ckafka): [117466142]public-network rm deprecated and validate min…
tongyiming May 15, 2024
e9c7b12
fix(cvm): [117460361] Update the limit of period and charge type (#2630)
hellertang May 15, 2024
f208439
fix(rds): [117455637] support mem_size 512 (#2629)
gitmkn May 15, 2024
74bceec
fix(crs): [117472679]Optimize Availability Zone (#2634)
gitmkn May 15, 2024
d7e7cfd
docs: add changelog version v1.81.94
andrew-tx May 15, 2024
be5442f
修改资源ID (#2639)
rudolfzhao May 16, 2024
74160d9
fix cvm test (#2635)
tongyiming May 16, 2024
504f54e
feat(tke): [117206907]Querying cluster node information limit support…
bruceybian May 16, 2024
45ef851
modify docs (#2640)
hellertang May 17, 2024
e895561
fix(cynosdb): [117461388]improvement id empty situation (#2636)
gitmkn May 17, 2024
887aa96
docs: add changelog of version v1.81.95
andrew-tx May 17, 2024
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/2607.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
provider : Support set `proxy`
```
5 changes: 5 additions & 0 deletions tencentcloud/connectivity/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ type TencentCloudClient struct {
Region string
Protocol string
Domain string
Proxy string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxy 参数我们有办法加个测试用例吗


cosConn *s3.S3
tencentCosConn *cos.Client
Expand Down Expand Up @@ -220,6 +221,8 @@ func (me *TencentCloudClient) NewClientProfile(timeout int) *profile.ClientProfi
cpf.HttpProfile.Scheme = me.Protocol
// request domain
cpf.HttpProfile.RootDomain = me.Domain
// request proxy
cpf.HttpProfile.Proxy = me.Proxy
// default language
cpf.Language = "en-US"

Expand All @@ -238,6 +241,8 @@ func (me *TencentCloudClient) NewClientIntlProfile(timeout int) *intlProfile.Cli
cpf.HttpProfile.Scheme = me.Protocol
// request domain
cpf.HttpProfile.RootDomain = me.Domain
// request proxy
cpf.HttpProfile.Proxy = me.Proxy
// default language
cpf.Language = "en-US"

Expand Down
13 changes: 13 additions & 0 deletions tencentcloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const (
PROVIDER_REGION = "TENCENTCLOUD_REGION"
PROVIDER_PROTOCOL = "TENCENTCLOUD_PROTOCOL"
PROVIDER_DOMAIN = "TENCENTCLOUD_DOMAIN"
PROVIDER_PROXY = "TENCENTCLOUD_PROXY"
//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.
//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.
PROVIDER_ASSUME_ROLE_ARN = "TENCENTCLOUD_ASSUME_ROLE_ARN"
Expand Down Expand Up @@ -191,6 +192,12 @@ func Provider() *schema.Provider {
DefaultFunc: schema.EnvDefaultFunc(PROVIDER_DOMAIN, nil),
Description: "The root domain of the API request, Default is `tencentcloudapi.com`.",
},
"proxy": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc(PROVIDER_PROXY, nil),
Description: "The proxy of the API request.",
},
//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.
//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.
"assume_role": {
Expand Down Expand Up @@ -2003,6 +2010,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
region string
protocol string
domain string
proxy string
)

if v, ok := d.GetOk("secret_id"); ok {
Expand Down Expand Up @@ -2038,6 +2046,10 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
domain = v.(string)
}

if v, ok := d.GetOk("proxy"); ok {
proxy = v.(string)
}

// standard client
var tcClient TencentCloudClient
tcClient.apiV3Conn = &connectivity.TencentCloudClient{
Expand All @@ -2049,6 +2061,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
Region: region,
Protocol: protocol,
Domain: domain,
Proxy: proxy,
}

var (
Expand Down
Loading