Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions examples/tencentcloud-tcaplus/main.tf
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
locals {
vpc_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_id
subnet_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.subnet_id
}

data "tencentcloud_vpc_subnets" "vpc" {
is_default = true
availability_zone = var.availability_zone
}

resource "tencentcloud_tcaplus_cluster" "test_cluster" {
resource "tencentcloud_tcaplus_cluster" "example" {
idl_type = "PROTO"
cluster_name = "tf_tcaplus_g_table"
vpc_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_id
subnet_id = data.tencentcloud_vpc_subnets.vpc.instance_list.0.subnet_id
password = "1qaA2k1wgvfa3ZZZ"
cluster_name = "tf_example_tcaplus_cluster"
vpc_id = local.vpc_id
subnet_id = local.subnet_id
password = "your_pw_123111"
old_password_expire_last = 3600
}

resource "tencentcloud_tcaplus_idl" "test_idl" {
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
tablegroup_id = tencentcloud_tcaplus_tablegroup.test_tablegroup.id
file_name = "tf_idl_test_guagua"
resource "tencentcloud_tcaplus_tablegroup" "example" {
cluster_id = tencentcloud_tcaplus_cluster.example.id
tablegroup_name = "tf_example_group_name"
}

resource "tencentcloud_tcaplus_idl" "main" {
cluster_id = tencentcloud_tcaplus_cluster.example.id
tablegroup_id = tencentcloud_tcaplus_tablegroup.example.id
file_name = "tf_example_tcaplus_idl"
file_type = "PROTO"
file_ext_type = "proto"
file_content = <<EOF
syntax = "proto2";
package myTcaplusTable;
import "tcaplusservice.optionv1.proto";
message tb_online_guagua {
message tb_online {
option(tcaplusservice.tcaplus_primary_key) = "uin,name,region";
required int64 uin = 1;
required string name = 2;
Expand All @@ -46,21 +56,3 @@ resource "tencentcloud_tcaplus_idl" "test_idl" {
}
EOF
}

resource "tencentcloud_tcaplus_tablegroup" "test_tablegroup" {
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
tablegroup_name = "tf_test_tablegroup"
}

resource "tencentcloud_tcaplus_table" "test_table" {
cluster_id = tencentcloud_tcaplus_cluster.test_cluster.id
tablegroup_id = tencentcloud_tcaplus_tablegroup.test_tablegroup.id
table_name = "tb_online_guagua"
table_type = "GENERIC"
description = "test"
idl_id = tencentcloud_tcaplus_idl.test_idl.id
table_idl_type = "PROTO"
reserved_read_cu = 1000
reserved_write_cu = 20
reserved_volume = 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlBackupDownloadUrlsDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
// loc, _ := time.LoadLocation("Asia/Chongqing")
// startTime := time.Now().AddDate(0, 0, -7).In(loc).Format("2006-01-02 15:04:05")
// endTime := time.Now().AddDate(0, 0, 1).In(loc).Format("2006-01-02 15:04:05")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const testAccPostgresqlBaseBackupsObject = "data.tencentcloud_postgresql_base_backups.base_backups"

func TestAccTencentCloudPostgresqlBaseBackupsDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
loc, _ := time.LoadLocation("Asia/Chongqing")
startTime := time.Now().AddDate(0, 0, -7).In(loc).Format("2006-01-02 15:04:05")
endTime := time.Now().AddDate(0, 0, 1).In(loc).Format("2006-01-02 15:04:05")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlDbInstanceClassesDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlDbInstanceVersionsDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlDefaultParametersDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/data_source_tc_postgresql_instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
var testDataPostgresqlInstancesName = "data.tencentcloud_postgresql_instances.id_test"

func TestAccTencentCloudPostgresqlInstancesDataSource(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
4 changes: 2 additions & 2 deletions tencentcloud/data_source_tc_postgresql_log_backups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestAccTencentCloudPostgresqlLogBackupsDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
loc, _ := time.LoadLocation("Asia/Chongqing")
startTime := time.Now().AddDate(0, 0, -7).In(loc).Format("2006-01-02 15:04:05")
endTime := time.Now().AddDate(0, 0, 1).In(loc).Format("2006-01-02 15:04:05")
Expand Down Expand Up @@ -52,7 +52,7 @@ func TestAccTencentCloudPostgresqlLogBackupsDataSource_basic(t *testing.T) {
})
}

const testAccPostgresqlLogBackupsDataSource = CommonPresetPGSQL + `
const testAccPostgresqlLogBackupsDataSource = OperationPresetPGSQL + `

data "tencentcloud_postgresql_log_backups" "log_backups" {
min_finish_time = "%s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlParameterTemplatesDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
const testAccPostgresqlReadonlyGroupsObject = "data.tencentcloud_postgresql_readonly_groups.read_only_groups"

func TestAccTencentCloudPostgresqlReadonlyGroupsDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
const testAccPostgresqlrecoverytimeObject = "data.tencentcloud_postgresql_recovery_time.recovery_time"

func TestAccTencentCloudPostgresqlRecoveryTimeDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/data_source_tc_postgresql_regions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlRegionsDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/data_source_tc_postgresql_specinfos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlSpecinfosDataSource(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/data_source_tc_postgresql_xlogs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestAccTencentCloudPostgresqlXlogsDataSource(t *testing.T) {
t.Parallel()
// t.Parallel()

startTime := time.Now().AddDate(0, 0, -7).Format("2006-01-02 15:04:05")
endTime := time.Now().Format("2006-01-02 15:04:05")
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/data_source_tc_postgresql_zones_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestAccTencentCloudPostgresqlZonesDataSource_basic(t *testing.T) {
t.Parallel()
// t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccStepSetRegion(t, "ap-guangzhou")
Expand Down
Loading