Skip to content

Commit 1e2e5eb

Browse files
authored
add new resource tencentcloud_instance_set (#1120)
* add new resource tencentcloud_instance_set * bug fix
1 parent a5a7f36 commit 1e2e5eb

File tree

6 files changed

+796
-1
lines changed

6 files changed

+796
-1
lines changed

tencentcloud/internal/helper/transform.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package helper
22

3-
import "strconv"
3+
import (
4+
"encoding/base64"
5+
"strconv"
6+
"strings"
7+
)
48

59
func Bool(i bool) *bool { return &i }
610

@@ -164,3 +168,25 @@ func StrToBool(s string) (i bool) {
164168
}
165169
return
166170
}
171+
172+
func StrListToStr(strList []*string) string {
173+
res := ""
174+
for i, v := range strList {
175+
res += *v
176+
if i < len(strList)-1 {
177+
res += ";"
178+
}
179+
}
180+
return base64.StdEncoding.EncodeToString([]byte(res))
181+
}
182+
183+
func StrToStrList(str string) (res []string, err error) {
184+
185+
decodeString, err := base64.StdEncoding.DecodeString(str)
186+
if err != nil {
187+
return res, err
188+
}
189+
190+
res = strings.Split(string(decodeString), ";")
191+
return res, nil
192+
}

tencentcloud/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ Cloud Virtual Machine(CVM)
271271
272272
Resource
273273
tencentcloud_instance
274+
tencentcloud_instance_set
274275
tencentcloud_eip
275276
tencentcloud_eip_association
276277
tencentcloud_key_pair
@@ -915,6 +916,7 @@ func Provider() terraform.ResourceProvider {
915916
ResourcesMap: map[string]*schema.Resource{
916917
"tencentcloud_emr_cluster": resourceTencentCloudEmrCluster(),
917918
"tencentcloud_instance": resourceTencentCloudInstance(),
919+
"tencentcloud_instance_set": resourceTencentCloudInstanceSet(),
918920
"tencentcloud_reserved_instance": resourceTencentCloudReservedInstance(),
919921
"tencentcloud_key_pair": resourceTencentCloudKeyPair(),
920922
"tencentcloud_placement_group": resourceTencentCloudPlacementGroup(),

0 commit comments

Comments
 (0)