Skip to content

Commit 17fefaf

Browse files
committed
feat(teo): [] support teo security ip group
1 parent 638e88d commit 17fefaf

7 files changed

+390
-1
lines changed

tencentcloud/connectivity/client.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ type TencentCloudClient struct {
213213
//omit nil client
214214
omitNilConn *common.Client
215215
emrv20190103Conn *emr.Client
216+
teov20220901Conn *teo.Client
216217
}
217218

218219
// NewClientProfile returns a new ClientProfile
@@ -1830,3 +1831,16 @@ func (me *TencentCloudClient) UseEmrV20190103Client() *emr.Client {
18301831

18311832
return me.emrv20190103Conn
18321833
}
1834+
1835+
// UseTeoV20220901Client return TEO client for service
1836+
func (me *TencentCloudClient) UseTeoV20220901Client() *teo.Client {
1837+
if me.teov20220901Conn != nil {
1838+
return me.teov20220901Conn
1839+
}
1840+
cpf := me.NewClientProfile(300)
1841+
cpf.Language = "zh-CN"
1842+
me.teov20220901Conn, _ = teo.NewClient(me.Credential, me.Region, cpf)
1843+
me.teov20220901Conn.WithHttpTransport(&LogRoundTripper{})
1844+
1845+
return me.teov20220901Conn
1846+
}

tencentcloud/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"strings"
1313

1414
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
15-
"github.com/mitchellh/go-homedir"
1615
sdkcommon "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
1716
commonJson "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json"
1817
sdksts "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts/v20180813"
@@ -1702,6 +1701,7 @@ func Provider() *schema.Provider {
17021701
"tencentcloud_teo_application_proxy": teo.ResourceTencentCloudTeoApplicationProxy(),
17031702
"tencentcloud_teo_application_proxy_rule": teo.ResourceTencentCloudTeoApplicationProxyRule(),
17041703
"tencentcloud_teo_realtime_log_delivery": teo.ResourceTencentCloudTeoRealtimeLogDelivery(),
1704+
"tencentcloud_teo_security_ip_group": teo.ResourceTencentCloudTeoSecurityIpGroup(),
17051705
"tencentcloud_tcm_mesh": tcm.ResourceTencentCloudTcmMesh(),
17061706
"tencentcloud_tcm_cluster_attachment": tcm.ResourceTencentCloudTcmClusterAttachment(),
17071707
"tencentcloud_tcm_prometheus_attachment": tcm.ResourceTencentCloudTcmPrometheusAttachment(),

tencentcloud/services/teo/resource_tc_teo_security_ip_group.go

Lines changed: 296 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Provides a resource to create a teo teo_security_ip_group
2+
3+
Example Usage
4+
5+
```hcl
6+
resource "tencentcloud_teo_security_ip_group" "teo_security_ip_group" {
7+
ip_group = {
8+
}
9+
}
10+
```
11+
12+
Import
13+
14+
teo teo_security_ip_group can be imported using the id, e.g.
15+
16+
```
17+
terraform import tencentcloud_teo_security_ip_group.teo_security_ip_group teo_security_ip_group_id
18+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package teo
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package teo
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+
func TestAccTencentCloudTeoSecurityIpGroupResource_basic(t *testing.T) {
12+
t.Parallel()
13+
resource.Test(t, resource.TestCase{
14+
PreCheck: func() {
15+
tcacctest.AccPreCheck(t)
16+
},
17+
Providers: tcacctest.AccProviders,
18+
Steps: []resource.TestStep{{
19+
Config: testAccTeoSecurityIpGroup,
20+
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_teo_security_ip_group.teo_security_ip_group", "id")),
21+
}, {
22+
ResourceName: "tencentcloud_teo_security_ip_group.teo_security_ip_group",
23+
ImportState: true,
24+
ImportStateVerify: true,
25+
}},
26+
})
27+
}
28+
29+
const testAccTeoSecurityIpGroup = `
30+
31+
resource "tencentcloud_teo_security_ip_group" "teo_security_ip_group" {
32+
ip_group = {
33+
}
34+
}
35+
`

0 commit comments

Comments
 (0)