Skip to content

Commit 60ed1f3

Browse files
authored
Feat/yunti build annotation (#2392)
* feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: test * feat: fix rex * feat: py update * feat: py update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: mark update * feat: make file * feat: make file * feat: make file * feat: update code yaml * feat: fmt
1 parent 8a0de31 commit 60ed1f3

12 files changed

+164
-29
lines changed

GNUmakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,4 @@ changelog:
198198
./scripts/generate-changelog.sh
199199

200200
.PHONY: build sweep test testacc fmt fmtcheck lint tools test-compile doc hooks website website-lint website-test
201+

tencentcloud/connectivity/client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ import (
103103
ssl "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss/v20180426"
104104
)
105105

106+
//internal version: replace import begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
107+
//internal version: replace import end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
108+
106109
const (
107110
PROVIDER_CVM_REQUEST_TIMEOUT = "TENCENTCLOUD_CVM_REQUEST_TIMEOUT"
108111
PROVIDER_CBS_REQUEST_TIMEOUT = "TENCENTCLOUD_CBS_REQUEST_TIMEOUT"
@@ -196,6 +199,8 @@ type TencentCloudClient struct {
196199
trocketConn *trocket.Client
197200
biConn *bi.Client
198201
cdwpgConn *cdwpg.Client
202+
//internal version: replace client begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
203+
//internal version: replace client end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
199204
}
200205

201206
// NewClientProfile returns a new ClientProfile
@@ -1371,6 +1376,9 @@ func (me *TencentCloudClient) UseCdwpgClient() *cdwpg.Client {
13711376
return me.cdwpgConn
13721377
}
13731378

1379+
//internal version: replace useClient begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
1380+
//internal version: replace useClient end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
1381+
13741382
func getEnvDefault(key string, defVal int) int {
13751383
val, ex := os.LookupEnv(key)
13761384
if !ex {

tencentcloud/internal/helper/transform.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ func StrToBool(s string) (i bool) {
271271
return
272272
}
273273

274+
//internal version: replace boolStr begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
275+
//internal version: replace boolStr end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
276+
274277
func StrListToStr(strList []*string) string {
275278
res := ""
276279
for i, v := range strList {

tencentcloud/provider.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ import (
2121
)
2222

2323
const (
24-
PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID"
25-
PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY"
26-
PROVIDER_SECURITY_TOKEN = "TENCENTCLOUD_SECURITY_TOKEN"
27-
PROVIDER_REGION = "TENCENTCLOUD_REGION"
28-
PROVIDER_PROTOCOL = "TENCENTCLOUD_PROTOCOL"
29-
PROVIDER_DOMAIN = "TENCENTCLOUD_DOMAIN"
24+
PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID"
25+
PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY"
26+
PROVIDER_SECURITY_TOKEN = "TENCENTCLOUD_SECURITY_TOKEN"
27+
PROVIDER_REGION = "TENCENTCLOUD_REGION"
28+
PROVIDER_PROTOCOL = "TENCENTCLOUD_PROTOCOL"
29+
PROVIDER_DOMAIN = "TENCENTCLOUD_DOMAIN"
30+
//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.
31+
//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.
3032
PROVIDER_ASSUME_ROLE_ARN = "TENCENTCLOUD_ASSUME_ROLE_ARN"
3133
PROVIDER_ASSUME_ROLE_SESSION_NAME = "TENCENTCLOUD_ASSUME_ROLE_SESSION_NAME"
3234
PROVIDER_ASSUME_ROLE_SESSION_DURATION = "TENCENTCLOUD_ASSUME_ROLE_SESSION_DURATION"
@@ -85,6 +87,8 @@ func Provider() *schema.Provider {
8587
DefaultFunc: schema.EnvDefaultFunc(PROVIDER_DOMAIN, nil),
8688
Description: "The root domain of the API request, Default is `tencentcloudapi.com`.",
8789
},
90+
//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.
91+
//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.
8892
"assume_role": {
8993
Type: schema.TypeSet,
9094
Optional: true,

tencentcloud/resource_tc_cynosdb_cluster.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ func resourceTencentCloudCynosdbClusterCreate(d *schema.ResourceData, meta inter
3939
cynosdbService = CynosdbService{client: client}
4040
tagService = TagService{client: client}
4141
region = client.Region
42-
42+
//internal version: replace client begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
43+
//internal version: replace client end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
4344
request = cynosdb.NewCreateClustersRequest()
4445
)
45-
46+
//internal version: replace varId begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
47+
//internal version: replace varId end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
4648
request.ProjectId = helper.IntInt64(d.Get("project_id").(int))
4749
request.Zone = helper.String(d.Get("available_zone").(string))
4850
request.VpcId = helper.String(d.Get("vpc_id").(string))
@@ -115,7 +117,11 @@ func resourceTencentCloudCynosdbClusterCreate(d *schema.ResourceData, meta inter
115117
}
116118

117119
var chargeType int64 = 0
120+
//internal version: replace varCharge begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
121+
//internal version: replace varCharge end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
118122
if v, ok := d.GetOk("charge_type"); ok {
123+
//internal version: replace strCharge begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
124+
//internal version: replace strCharge end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
119125
if v == CYNOSDB_CHARGE_TYPE_PREPAID {
120126
chargeType = 1
121127
if vv, ok := d.GetOk("prepaid_period"); ok {
@@ -143,6 +149,8 @@ func resourceTencentCloudCynosdbClusterCreate(d *schema.ResourceData, meta inter
143149
}
144150
}
145151
log.Printf("[CRITAL]%s api[%s] fail, reason:%s", logId, request.GetAction(), err.Error())
152+
//internal version: replace bpass begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
153+
//internal version: replace bpass end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
146154
return retryError(err)
147155
}
148156
return nil
@@ -179,10 +187,13 @@ func resourceTencentCloudCynosdbClusterCreate(d *schema.ResourceData, meta inter
179187
if dealRes != nil && dealRes.Response != nil && len(dealRes.Response.BillingResourceInfos) != 1 {
180188
return fmt.Errorf("cynosdb cluster id count isn't 1")
181189
}
182-
190+
//internal version: replace normal begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
183191
id := *dealRes.Response.BillingResourceInfos[0].ClusterId
192+
//internal version: replace normal end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
184193
d.SetId(id)
185194

195+
//internal version: replace setTag begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
196+
//internal version: replace setTag end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
186197
_, _, has, err := cynosdbService.DescribeClusterById(ctx, id)
187198
if err != nil {
188199
return err
@@ -638,6 +649,8 @@ func resourceTencentCloudCynosdbClusterUpdate(d *schema.ResourceData, meta inter
638649
return err
639650
}
640651

652+
//internal version: replace waitTag begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
653+
//internal version: replace waitTag end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
641654
}
642655

643656
// update sg

tencentcloud/resource_tc_elasticsearch_instance.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,10 @@ func resourceTencentCloudElasticsearchInstanceCreate(d *schema.ResourceData, met
264264
elasticsearchService := ElasticsearchService{
265265
client: meta.(*TencentCloudClient).apiV3Conn,
266266
}
267-
268267
request := es.NewCreateInstanceRequest()
268+
269+
//internal version: replace var begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
270+
//internal version: replace var end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
269271
request.Zone = helper.String(d.Get("availability_zone").(string))
270272
request.EsVersion = helper.String(d.Get("version").(string))
271273
request.VpcId = helper.String(d.Get("vpc_id").(string))
@@ -275,7 +277,9 @@ func resourceTencentCloudElasticsearchInstanceCreate(d *schema.ResourceData, met
275277
request.InstanceName = helper.String(v.(string))
276278
}
277279
if v, ok := d.GetOk("charge_type"); ok {
280+
//internal version: replace strCharge begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
278281
chargeType := v.(string)
282+
//internal version: replace strCharge end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
279283
request.ChargeType = &chargeType
280284
if chargeType == ES_CHARGE_TYPE_PREPAID {
281285
if v, ok := d.GetOk("charge_period"); ok {
@@ -355,14 +359,17 @@ func resourceTencentCloudElasticsearchInstanceCreate(d *schema.ResourceData, met
355359
request.NodeInfoList = append(request.NodeInfoList, &info)
356360
}
357361
}
358-
362+
//internal version: replace reqTag begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
363+
//internal version: replace reqTag end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
359364
instanceId := ""
360365
err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
361366
ratelimit.Check(request.GetAction())
362367
response, err := meta.(*TencentCloudClient).apiV3Conn.UseEsClient().CreateInstance(request)
363368
if err != nil {
364369
log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n",
365370
logId, request.GetAction(), request.ToJsonString(), err.Error())
371+
//internal version: replace bpass begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
372+
//internal version: replace bpass end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
366373
return retryError(err)
367374
}
368375
instanceId = *response.Response.InstanceId
@@ -373,6 +380,8 @@ func resourceTencentCloudElasticsearchInstanceCreate(d *schema.ResourceData, met
373380
}
374381
d.SetId(instanceId)
375382

383+
//internal version: replace setTag begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
384+
//internal version: replace setTag end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
376385
instanceEmptyRetries := 5
377386
err = resource.Retry(15*readRetryTimeout, func() *resource.RetryError {
378387
instance, errRet := elasticsearchService.DescribeInstanceById(ctx, instanceId)
@@ -706,15 +715,23 @@ func resourceTencentCloudElasticsearchInstanceUpdate(d *schema.ResourceData, met
706715
return err
707716
}
708717
}
718+
709719
if d.HasChange("tags") {
710720
oldInterface, newInterface := d.GetChange("tags")
711721
replaceTags, deleteTags := diffTags(oldInterface.(map[string]interface{}), newInterface.(map[string]interface{}))
712722
tagService := TagService{
713723
client: meta.(*TencentCloudClient).apiV3Conn,
714724
}
715725
region := meta.(*TencentCloudClient).apiV3Conn.Region
726+
727+
//internal version: replace null begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
716728
resourceName := fmt.Sprintf("qcs::es:%s:uin/:instance/%s", region, instanceId)
717729
err := tagService.ModifyTags(ctx, resourceName, replaceTags, deleteTags)
730+
//internal version: replace null end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
731+
732+
//internal version: replace waitTag begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
733+
//internal version: replace waitTag end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
734+
718735
if err != nil {
719736
return err
720737
}

tencentcloud/resource_tc_mongodb_instance.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
1515
)
1616

17+
//internal version: replace import begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
18+
//internal version: replace import end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
19+
1720
func resourceTencentCloudMongodbInstance() *schema.Resource {
1821
mongodbInstanceInfo := map[string]*schema.Schema{
1922
"standby_instance_list": {
@@ -218,6 +221,8 @@ func mongodbCreateInstanceByMonth(ctx context.Context, d *schema.ResourceData, m
218221
response, err = meta.(*TencentCloudClient).apiV3Conn.UseMongodbClient().CreateDBInstance(request)
219222
if err != nil {
220223
log.Printf("[CRITAL]%s api[%s] fail, reason:%s", logId, request.GetAction(), err.Error())
224+
//internal version: replace bpass begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
225+
//internal version: replace bpass end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
221226
return retryError(err)
222227
}
223228
return nil
@@ -263,6 +268,8 @@ func resourceTencentCloudMongodbInstanceCreate(d *schema.ResourceData, meta inte
263268

264269
instanceId := d.Id()
265270

271+
//internal version: replace setTag begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
272+
//internal version: replace setTag end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
266273
_, has, err := mongodbService.DescribeInstanceById(ctx, instanceId)
267274
if err != nil {
268275
return err
@@ -285,14 +292,16 @@ func resourceTencentCloudMongodbInstanceCreate(d *schema.ResourceData, meta inte
285292
if !has {
286293
return fmt.Errorf("[CRITAL]%s creating mongodb instance failed, instance doesn't exist", logId)
287294
}
288-
295+
//internal version: replace begin begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
296+
//internal version: replace begin end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
289297
if tags := helper.GetTags(d, "tags"); len(tags) > 0 {
290298
resourceName := BuildTagResourceName("mongodb", "instance", region, instanceId)
291299
if err := tagService.ModifyTags(ctx, resourceName, tags, nil); err != nil {
292300
return err
293301
}
294302
}
295-
303+
//internal version: replace end begin, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
304+
//internal version: replace end end, please do not modify this annotation and refrain from inserting any code between the beginning and end lines of the annotation.
296305
return resourceTencentCloudMongodbInstanceRead(d, meta)
297306
}
298307

0 commit comments

Comments
 (0)