Skip to content

Commit 8ca4f7a

Browse files
authored
feat(controlcenter): [119069726] add new operation (#2803)
* add * add * add * add
1 parent c290d73 commit 8ca4f7a

File tree

18 files changed

+747
-4
lines changed

18 files changed

+747
-4
lines changed

.changelog/2803.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_batch_apply_account_baselines
3+
```

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ require (
307307
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
308308
github.com/tdakkota/asciicheck v0.2.0 // indirect
309309
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwdoris v1.0.993 // indirect
310+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 // indirect
310311
github.com/tetafro/godot v1.4.11 // indirect
311312
github.com/tidwall/gjson v1.17.0 // indirect
312313
github.com/tidwall/match v1.1.1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.991 h1:0Xg2
931931
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.991/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
932932
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.993 h1:+iJMmF0q1MPyhLs0+J7CcJ47w/vq6ICsCxnV4gc0dKw=
933933
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.993/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
934+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ=
935+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY=
934936
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 h1:F3esKBIT3HW9+7Gt8cVgf8X06VdGIczpgLBUECzSEzU=
935937
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860/go.mod h1:NZo1WplQcC314kMlCRUoy8NQju2BnolIJj7NAWgsuhY=
936938
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.960 h1:Tpz3KVUfaJ7b98wQDYZSbmoKIn0hlH0oHPOzWMzE5Q8=

tencentcloud/connectivity/client.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import (
4141
cls "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016"
4242
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
4343
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
44+
controlcenter "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter/v20230110"
4445
csip "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip/v20221121"
4546
cvmv20170312 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
4647
cwp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp/v20180228"
@@ -202,9 +203,10 @@ type TencentCloudClient struct {
202203
regionConn *region.Client
203204
//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.
204205
//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.
205-
tkev20220501Conn *tkev20220501.Client
206-
cdcConn *cdc.Client
207-
cdwdorisConn *cdwdoris.Client
206+
tkev20220501Conn *tkev20220501.Client
207+
cdcConn *cdc.Client
208+
cdwdorisConn *cdwdoris.Client
209+
controlcenterConn *controlcenter.Client
208210
//omit nil client
209211
omitNilConn *common.Client
210212
}
@@ -1698,3 +1700,16 @@ func (me *TencentCloudClient) UseCdwdorisV20211228Client() *cdwdoris.Client {
16981700

16991701
return me.cdwdorisConn
17001702
}
1703+
1704+
// UseControlcenter return CONTROLCENTER client for service
1705+
func (me *TencentCloudClient) UseControlcenterV20230110Client() *controlcenter.Client {
1706+
if me.controlcenterConn != nil {
1707+
return me.controlcenterConn
1708+
}
1709+
cpf := me.NewClientProfile(300)
1710+
cpf.Language = "zh-CN"
1711+
me.controlcenterConn, _ = controlcenter.NewClient(me.Credential, me.Region, cpf)
1712+
me.controlcenterConn.WithHttpTransport(&LogRoundTripper{})
1713+
1714+
return me.controlcenterConn
1715+
}

tencentcloud/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import (
4848
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/clb"
4949
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cls"
5050
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/common"
51+
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/controlcenter"
5152
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/cos"
5253
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/crs"
5354
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/services/csip"
@@ -2120,6 +2121,7 @@ func Provider() *schema.Provider {
21202121
"tencentcloud_cdwdoris_instance": cdwdoris.ResourceTencentCloudCdwdorisInstance(),
21212122
"tencentcloud_cdwdoris_workload_group": cdwdoris.ResourceTencentCloudCdwdorisWorkloadGroup(),
21222123
//"tencentcloud_cdwdoris_user": cdwdoris.ResourceTencentCloudCdwdorisUser(),
2124+
"tencentcloud_batch_apply_account_baselines": controlcenter.ResourceTencentCloudBatchApplyAccountBaselines(),
21232125
},
21242126

21252127
ConfigureFunc: providerConfigure,

tencentcloud/provider.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,3 +2178,7 @@ CdwDoris
21782178
Resource
21792179
tencentcloud_cdwdoris_instance
21802180
tencentcloud_cdwdoris_workload_group
2181+
2182+
ControlCenter
2183+
Resource
2184+
tencentcloud_batch_apply_account_baselines

tencentcloud/services/controlcenter/resource_tc_batch_apply_account_baselines.go

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Provides a resource to create a controlcenter batch apply account baselines
2+
3+
Example Usage
4+
5+
```hcl
6+
resource "tencentcloud_batch_apply_account_baselines" "example" {
7+
member_uin_list = [
8+
10037652245,
9+
10037652240,
10+
]
11+
12+
baseline_config_items {
13+
identifier = "TCC-AF_SHARE_IMAGE"
14+
configuration = "{\"Images\":[{\"Region\":\"ap-guangzhou\",\"ImageId\":\"img-mcdsiqrx\",\"ImageName\":\"demo1\"}, {\"Region\":\"ap-guangzhou\",\"ImageId\":\"img-esxgkots\",\"ImageName\":\"demo2\"}]}"
15+
}
16+
}
17+
```
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package controlcenter_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
8+
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest"
9+
)
10+
11+
// go test -i; go test -test.run TestAccTencentCloudNeedFixBatchApplyAccountBaselinesResource_basic -v
12+
func TestAccTencentCloudNeedFixBatchApplyAccountBaselinesResource_basic(t *testing.T) {
13+
t.Parallel()
14+
resource.Test(t, resource.TestCase{
15+
PreCheck: func() {
16+
tcacctest.AccPreCheck(t)
17+
},
18+
Providers: tcacctest.AccProviders,
19+
Steps: []resource.TestStep{
20+
{
21+
Config: testAccBatchApplyAccountBaselines,
22+
Check: resource.ComposeTestCheckFunc(
23+
resource.TestCheckResourceAttrSet("tencentcloud_batch_apply_account_baselines.example", "id"),
24+
),
25+
},
26+
},
27+
})
28+
}
29+
30+
const testAccBatchApplyAccountBaselines = `
31+
resource "tencentcloud_batch_apply_account_baselines" "example" {
32+
member_uin_list = [
33+
10037652245,
34+
10037652240,
35+
]
36+
37+
baseline_config_items {
38+
identifier = "TCC-AF_SHARE_IMAGE"
39+
configuration = "{\"Images\":[{\"Region\":\"ap-guangzhou\",\"ImageId\":\"img-mcdsiqrx\",\"ImageName\":\"demo1\"}, {\"Region\":\"ap-guangzhou\",\"ImageId\":\"img-esxgkots\",\"ImageName\":\"demo2\"}]}"
40+
}
41+
}
42+
`

tencentcloud/services/controlcenter/service_tencentcloud_controlcenter.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)