Skip to content

Commit de9d37d

Browse files
committed
Merge branch 'master' into feat/cfw-sg-rule
2 parents 551c0ca + 7d86bde commit de9d37d

30 files changed

+1128
-68
lines changed

.changelog/2877.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_ccn_routes: fix ccn routes read
3+
```

.changelog/2883.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_cdn_domain: Support origin_company field and add computed to the message field.
3+
```

.changelog/2885.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_kubernetes_scale_worker: add params `create_result_output_file`
3+
```

.changelog/2888.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
tencentcloud_postgresql_clone_db_instance
3+
```

.changelog/2889.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_lite_hbase_instance: fix delete state refresh
3+
```

.changelog/2890.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_security_group_rule_set: update doc
3+
```

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
## 1.81.133 (October 14 , 2024)
2+
3+
FEATURES:
4+
5+
* **New Resource:** `tencentcloud_postgresql_clone_db_instance` ([#2888](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2888))
6+
7+
ENHANCEMENTS:
8+
9+
* resource/tencentcloud_cdn_domain: Support origin_company field and add computed to the message field. ([#2883](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2883))
10+
* resource/tencentcloud_kubernetes_scale_worker: add params `create_result_output_file` ([#2885](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2885))
11+
* resource/tencentcloud_lite_hbase_instance: fix delete state refresh ([#2889](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2889))
12+
* resource/tencentcloud_security_group_rule_set: update doc ([#2890](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2890))
13+
14+
## 1.81.132 (October 11 , 2024)
15+
16+
FEATURES:
17+
18+
* **New Resource:** `tencentcloud_ssl_check_certificate_domain_verification_operation` ([#2871](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2871))
19+
20+
ENHANCEMENTS:
21+
22+
* ccn/Update sdk version ([#2882](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2882))
23+
* resource/tencentcloud_as_scaling_config: Supports `enhanced_automation_tools_service` params. ([#2875](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2875))
24+
* resource/tencentcloud_ccn_routes: fix ccn routes read ([#2877](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2877))
25+
* resource/tencentcloud_instance: support `disable_automation_service` params ([#2873](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2873))
26+
* resource/tencentcloud_mysql_cls_log_attachment: Update md doc ([#2879](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2879))
27+
128
## 1.81.131 (October 1 , 2024)
229

330
ENHANCEMENTS:

tencentcloud/common/context.go

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ package common
22

33
import (
44
"context"
5+
"sync"
56

67
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
78
)
89

910
type ctxResourceDataKey struct{}
1011
type ctxProviderMetaKey struct{}
12+
type ctxDataKey struct{}
1113

1214
// NewResourceLifeCycleHandleFuncContext 创建一个资源生命周期处理方法上下文
1315
func NewResourceLifeCycleHandleFuncContext(
@@ -19,6 +21,7 @@ func NewResourceLifeCycleHandleFuncContext(
1921
ctx := context.WithValue(parent, LogIdKey, logID)
2022
ctx = context.WithValue(ctx, ctxResourceDataKey{}, d)
2123
ctx = context.WithValue(ctx, ctxProviderMetaKey{}, meta)
24+
ctx = context.WithValue(ctx, ctxDataKey{}, &ContextData{})
2225
return ctx
2326
}
2427

@@ -37,3 +40,77 @@ func ProviderMetaFromContext(ctx context.Context) interface{} {
3740
}
3841
return nil
3942
}
43+
44+
// DataFromContext 从上下文获取 data
45+
func DataFromContext(ctx context.Context) *ContextData {
46+
if data, ok := ctx.Value(ctxDataKey{}).(*ContextData); ok {
47+
return data
48+
}
49+
return nil
50+
}
51+
52+
// ContextData 上下文临时数据
53+
type ContextData struct {
54+
lock sync.RWMutex
55+
data map[string]interface{}
56+
}
57+
58+
// Set 设置值
59+
func (d *ContextData) Set(key string, v interface{}) {
60+
d.lock.Lock()
61+
defer d.lock.Unlock()
62+
if d.data == nil {
63+
d.data = make(map[string]interface{})
64+
}
65+
d.data[key] = v
66+
}
67+
68+
// Delete 删除值
69+
func (d *ContextData) Delete(key string) {
70+
d.lock.Lock()
71+
defer d.lock.Unlock()
72+
delete(d.data, key)
73+
}
74+
75+
// Get 获取键
76+
func (d *ContextData) Get(key string) interface{} {
77+
d.lock.RLock()
78+
defer d.lock.RUnlock()
79+
return d.data[key]
80+
}
81+
82+
// GetInt 获取 int 数据键
83+
func (d *ContextData) GetInt(key string) (ret int, ok bool) {
84+
ret, ok = d.Get(key).(int)
85+
return
86+
}
87+
88+
// GetUInt 获取 uint 数据键
89+
func (d *ContextData) GetUInt(key string) (ret uint, ok bool) {
90+
ret, ok = d.Get(key).(uint)
91+
return
92+
}
93+
94+
// GetInt64 获取 int64 数据键
95+
func (d *ContextData) GetInt64(key string) (ret int64, ok bool) {
96+
ret, ok = d.Get(key).(int64)
97+
return
98+
}
99+
100+
// GetUInt64 获取 uint64 数据键
101+
func (d *ContextData) GetUInt64(key string) (ret uint64, ok bool) {
102+
ret, ok = d.Get(key).(uint64)
103+
return
104+
}
105+
106+
// GetString 获取 string 数据键
107+
func (d *ContextData) GetString(key string) (ret string, ok bool) {
108+
ret, ok = d.Get(key).(string)
109+
return
110+
}
111+
112+
// GetBool 获取 bool 数据键
113+
func (d *ContextData) GetBool(key string) (ret bool, ok bool) {
114+
ret, ok = d.Get(key).(bool)
115+
return
116+
}

tencentcloud/connectivity/client.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,11 @@ type TencentCloudClient struct {
211211
controlcenterConn *controlcenter.Client
212212
thpcConn *thpc.Client
213213
//omit nil client
214-
omitNilConn *common.Client
215-
emrv20190103Conn *emr.Client
216-
teov20220901Conn *teo.Client
217-
sslv20191205Conn *sslCertificate.Client
214+
omitNilConn *common.Client
215+
emrv20190103Conn *emr.Client
216+
teov20220901Conn *teo.Client
217+
sslv20191205Conn *sslCertificate.Client
218+
postgresv20170312Conn *postgre.Client
218219
cfwv20190904Conn *cfw.Client
219220
}
220221

@@ -1860,6 +1861,19 @@ func (me *TencentCloudClient) UseSslV20191205Client() *sslCertificate.Client {
18601861
return me.sslv20191205Conn
18611862
}
18621863

1864+
// UsePostgresV20170312Client return POSTGRES client for service
1865+
func (me *TencentCloudClient) UsePostgresV20170312Client() *postgre.Client {
1866+
if me.postgresv20170312Conn != nil {
1867+
return me.postgresv20170312Conn
1868+
}
1869+
cpf := me.NewClientProfile(300)
1870+
cpf.Language = "zh-CN"
1871+
me.postgresv20170312Conn, _ = postgre.NewClient(me.Credential, me.Region, cpf)
1872+
me.postgresv20170312Conn.WithHttpTransport(&LogRoundTripper{})
1873+
1874+
return me.postgresv20170312Conn
1875+
}
1876+
18631877
// UseCfwV20190904Client return CFW client for service
18641878
func (me *TencentCloudClient) UseCfwV20190904Client() *cfw.Client {
18651879
if me.cfwv20190904Conn != nil {

tencentcloud/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ func Provider() *schema.Provider {
15061506
"tencentcloud_postgresql_account": postgresql.ResourceTencentCloudPostgresqlAccount(),
15071507
"tencentcloud_postgresql_account_privileges_operation": postgresql.ResourceTencentCloudPostgresqlAccountPrivilegesOperation(),
15081508
"tencentcloud_postgresql_apply_parameter_template_operation": postgresql.ResourceTencentCloudPostgresqlApplyParameterTemplateOperation(),
1509+
"tencentcloud_postgresql_clone_db_instance": postgresql.ResourceTencentCloudPostgresqlCloneDbInstance(),
15091510
"tencentcloud_sqlserver_instance": sqlserver.ResourceTencentCloudSqlserverInstance(),
15101511
"tencentcloud_sqlserver_db": sqlserver.ResourceTencentCloudSqlserverDB(),
15111512
"tencentcloud_sqlserver_account": sqlserver.ResourceTencentCloudSqlserverAccount(),

tencentcloud/provider.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,7 @@ TencentDB for PostgreSQL(PostgreSQL)
901901
tencentcloud_postgresql_instance_ha_config
902902
tencentcloud_postgresql_account
903903
tencentcloud_postgresql_apply_parameter_template_operation
904+
tencentcloud_postgresql_clone_db_instance
904905

905906
TencentDB for Redis(crs)
906907
Data Source

tencentcloud/services/ccn/resource_tc_ccn_routes_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func TestAccTencentCloudCcnRoutesResource_basic(t *testing.T) {
3939
const testAccVpcCcnRoutes = `
4040
4141
resource "tencentcloud_ccn_routes" "ccn_routes" {
42-
ccn_id = "ccn-39lqkygf"
43-
route_id = "ccnr-3o0dfyuw"
42+
ccn_id = "ccn-0bbkedsb"
43+
route_id = "ccnr-9sqye2qg"
4444
switch = "off"
4545
}
4646
@@ -49,8 +49,8 @@ resource "tencentcloud_ccn_routes" "ccn_routes" {
4949
const testAccVpcCcnRoutesUpdate = `
5050
5151
resource "tencentcloud_ccn_routes" "ccn_routes" {
52-
ccn_id = "ccn-39lqkygf"
53-
route_id = "ccnr-3o0dfyuw"
52+
ccn_id = "ccn-0bbkedsb"
53+
route_id = "ccnr-9sqye2qg"
5454
switch = "on"
5555
}
5656

tencentcloud/services/ccn/service_tencentcloud_ccn.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,12 @@ func (me *VpcService) DescribeVpcCcnRoutesById(ctx context.Context, ccnId string
12601260

12611261
request := vpc.NewDescribeCcnRoutesRequest()
12621262
request.CcnId = &ccnId
1263-
1263+
request.Filters = []*vpc.Filter{
1264+
{
1265+
Name: helper.String("route-id"),
1266+
Values: []*string{helper.String(routeId)},
1267+
},
1268+
}
12641269
defer func() {
12651270
if errRet != nil {
12661271
log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error())
@@ -1276,11 +1281,8 @@ func (me *VpcService) DescribeVpcCcnRoutesById(ctx context.Context, ccnId string
12761281
}
12771282
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
12781283

1279-
for _, route := range response.Response.RouteSet {
1280-
if *route.RouteId == routeId {
1281-
ccnRoutes = route
1282-
return
1283-
}
1284+
if response != nil && response.Response != nil && len(response.Response.RouteSet) > 0 {
1285+
ccnRoutes = response.Response.RouteSet[0]
12841286
}
12851287

12861288
return

tencentcloud/services/cdn/resource_tc_cdn_domain.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
4141
"cache_key": []interface{}{map[string]interface{}{
4242
"full_url_cache": "on",
4343
}},
44+
"full_url_cache": true,
4445
}),
4546
},
4647

@@ -137,6 +138,11 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
137138
Optional: true,
138139
Description: "Host header used when accessing the backup origin server. If left empty, the ServerName of master origin server will be used by default.",
139140
},
141+
"origin_company": {
142+
Type: schema.TypeString,
143+
Optional: true,
144+
Description: "Object storage back to the source vendor. Required when the source station type is a third-party storage source station (third_party). Optional values include the following: `aws_s3`: AWS S3; `ali_oss`: Alibaba Cloud OSS; `hw_obs`: Huawei OBS; `qiniu_kodo`: Qiniu Cloud kodo; `others`: other vendors' object storage, only supports object storage compatible with AWS signature algorithm, such as Tencent Cloud Financial Zone COS. Example value: `hw_obs`.",
145+
},
140146
},
141147
},
142148
},
@@ -212,6 +218,7 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
212218
"message": {
213219
Type: schema.TypeString,
214220
Optional: true,
221+
Computed: true,
215222
Description: "Certificate remarks.",
216223
},
217224
"deploy_time": {
@@ -1861,6 +1868,9 @@ func resourceTencentCloudCdnDomainCreate(d *schema.ResourceData, meta interface{
18611868
request.Origin.BackupOrigins = append(request.Origin.BackupOrigins, helper.String(item.(string)))
18621869
}
18631870
}
1871+
if v := origin["origin_company"]; v.(string) != "" {
1872+
request.Origin.OriginCompany = helper.String(v.(string))
1873+
}
18641874

18651875
// https config
18661876
if v, ok := d.GetOk("https_config"); ok {
@@ -2564,6 +2574,7 @@ func resourceTencentCloudCdnDomainRead(d *schema.ResourceData, meta interface{})
25642574
origin["backup_origin_type"] = domainConfig.Origin.BackupOriginType
25652575
origin["backup_origin_list"] = domainConfig.Origin.BackupOrigins
25662576
origin["backup_server_name"] = domainConfig.Origin.BackupServerName
2577+
origin["origin_company"] = domainConfig.Origin.OriginCompany
25672578
origins = append(origins, origin)
25682579
_ = d.Set("origin", origins)
25692580

@@ -3178,6 +3189,9 @@ func resourceTencentCloudCdnDomainUpdate(d *schema.ResourceData, meta interface{
31783189
request.Origin.BackupOrigins = append(request.Origin.BackupOrigins, helper.String(item.(string)))
31793190
}
31803191
}
3192+
if v := origin["origin_company"]; v.(string) != "" {
3193+
request.Origin.OriginCompany = helper.String(v.(string))
3194+
}
31813195
}
31823196
if d.HasChange("request_header") {
31833197
updateAttrs = append(updateAttrs, "request_header")

0 commit comments

Comments
 (0)