Documentation ¶
Index ¶
- Constants
- Variables
- func AccCheckTencentCloudDataSourceID(n string) resource.TestCheckFunc
- func AccPreCheck(t *testing.T)
- func AccPreCheckBusiness(t *testing.T, accountType string)
- func AccPreCheckCommon(t *testing.T, accountType string)
- func AccStepPreConfigSetTempAKSK(t *testing.T, accountType string)
- func AccStepSetRegion(t *testing.T, region string)
- func AccStepTimeSleepDuration(d time.Duration) resource.TestCheckFunc
- func IsResourcePersist(name string, createdTime *time.Time) bool
- func SharedClientForRegion(region string) (interface{}, error)
- type TencentCloudClient
Constants ¶
View Source
const ( KeepResource = "keep" DefaultResource = "Default" )
View Source
const ( DefaultCosCertificateName = "keep-cos-domain-cert" DefaultCosCertificateBucketPrefix = "keep-cert-test" DefaultCosCertDomainName = "mikatong.com" )
cos
View Source
const ( DefaultSshCertificate = "Bg9KzlUq" DefaultSshCertificateB = "Bg9JKn5V" )
clb
View Source
const ( DefaultRegion = "ap-guangzhou" DefaultVpcId = "vpc-86v957zb" DefaultVpcCidr = "172.16.0.0/16" DefaultVpcCidrLess = "172.16.0.0/18" DefaultCvmAZone = "ap-guangzhou-7" DefaultCvmInternationalZone = "ap-guangzhou-3" DefaultCvmVpcId = "vpc-gmq0mxoj" DefaultCvmSubnetId = "subnet-cpknsqgo" DefaultCvmTestingAZone = "ap-guangzhou-2" DefaultCvmTestingVpcId = "vpc-701bm52d" DefaultCvmTestingSubnetId = "subnet-1q62lj3m" DefaultCvmTestingImgId = "img-eb30mz89" DefaultCvmInternationalVpcId = "vpc-m7ryq37p" DefaultCvmInternationalSubnetId = "subnet-lwrsb7a0" DefaultAZone = "ap-guangzhou-3" DefaultSubnetId = "subnet-enm92y0m" DefaultSubnetCidr = "172.16.0.0/20" DefaultSubnetCidrLess = "172.16.0.0/22" DefaultInsName = "tf-ci-test" DefaultInsNameUpdate = "tf-ci-test-update" DefaultDayuBgp = "bgp-000006mq" DefaultDayuBgpMul = "bgp-0000008o" DefaultDayuBgpIp = "bgpip-00000294" DefaultDayuNet = "net-0000007e" DefaultGaapProxyId = "link-m9t4yho9" DefaultGaapProxyId2 = "link-2rk61jn5" DefaultGaapSecurityPolicyId = "sp-6djzh5hz" DefaultGaapRealserverDomainId1 = "rs-620u0ahd" DefaultGaapRealserverDomain1 = "github.com" DefaultGaapRealserverDomainId2 = "rs-9vkyi1av" DefaultGaapRealserverDomain2 = "www.github.com" DefaultGaapRealserverIpId1 = "rs-4j6rtzqv" DefaultGaapRealserverIp1 = "119.29.29.35" DefaultGaapRealserverIpId2 = "rs-3mlpbuut" DefaultGaapRealserverIp2 = "1.1.1.5" DefaultHttpsDomainCertificateId = "cert-3muob2in" DefaultSecurityGroup = "sg-05f7wnhn" DefaultProjectId = "0" DefaultTkeOSImageId = "img-2lr9q49h" DefaultTkeOSImageName = "tlinux2.2(tkernel3)x86_64" )
View Source
const ( DefaultEMRVpcId = "vpc-axrsmmrv" DefaultEMRSubnetId = "subnet-j5vja918" DefaultEMRSgId = "sg-bzbu5ezt" )
EMR
View Source
const ( DefaultCvmId = "ins-8oqqya08" DefaultDiskId = "disk-5jjrs2lm" DefaultSnapId = "snap-gem0ivcj" )
cvm-image
View Source
const ( DefaultKafkaInstanceId = "ckafka-vv7wpvae" DefaultKafkaVpcId = "vpc-njbzmzyd" DefaultKafkaSubnetId = "subnet-2txtpql8" DefaultKafkaInternationalVpcId = "vpc-ereuklyj" DefaultKafkaInternationalSubnetId = "subnet-e7rvxfx2" )
ckafka
View Source
const ( TkeExclusiveVpcName = "keep_tke_exclusive_vpc" DefaultTkeClusterId = "cls-r8gqwjw6" DefaultTkeClusterName = "keep-tke-cluster" DefaultTkeClusterType = "tke" DefaultPrometheusId = "prom-1lspn8sw" DefaultTemplateId = "temp-gqunlvo1" ClusterPrometheusId = "prom-g261hacc" TkeClusterIdAgent = "cls-9ae9qo9k" TkeClusterTypeAgent = "eks" DefaultAgentId = "agent-q3zy8gt8" )
Tke Exclusive Network Environment
View Source
const ( DefaultGrafanaVpcId = "vpc-axrsmmrv" DefaultGrafanaSubnetId = "subnet-o6qcrhzo" DefaultInternationalGrafanaVpcId = "vpc-dg21ckzx" DefaultInternationalGrafanaSubnetId = "subnet-i5lq9vy4" DefaultGrafanaInstanceId = "grafana-dp2hnnfa" DefaultGrafanaReceiver = "Consumer-nfyxuzmbmq" DefaultGrafanaPlugin = "grafana-clock-panel" DefaultGrafanaVersion = "1.2.0" )
Cloud monitoring grafana visualization
View Source
const ( DefaultTmpVpcId = "vpc-axrsmmrv" DefaultTmpSubnetId = "subnet-j5vja918" )
monitor
View Source
const ( DefaultMeshClusterId = "cls-9ae9qo9k" DefaultMeshVpcId = "vpc-pyyv5k3v" DefaultMeshSubnetId = "subnet-06i8auk6" )
View Source
const ( DefaultDcdbInstanceId = "tdsqlshard-lgz66iqr" DefaultDcdbInstanceName = "keep-dcdb-test" DefaultDcdbInsVpcId = "vpc-4owdpnwr" DefaultDcdbInsIdSubnetId = "subnet-qylstu34" DefaultDcdbSGId = "sg-ijato2x1" DefaultDcdbSGName = "default" )
DCDB
View Source
const ( DefaultMariadbSubnetId = "subnet-jdi5xn22" DefaultMariadbVpcId = "vpc-k1t8ickr" DefaultMariadbSecurityGroupId = "sg-7kpsbxdb" DefaultMariadbInstanceSubnetId = "subnet-8fpt571a" DefaultMariadbInstanceVpcId = "vpc-axrsmmrv" )
End of SES MARIADB
View Source
const ( DefaultPtsProjectId = "project-45vw7v82" DefaultScenarioId = "scenario-gb5ix8m2" DefaultScenarioIdJob = "scenario-22q19f3k" DefaultPtsNoticeId = "notice-tj75hgqj" )
End of MARIADB PTS
View Source
const ( DefaultCSSLiveType = "PullLivePushLive" DefaultCSSDomainName = "177154.push.tlivecloud.com" DefaultCSSStreamName = DefaultCSSPrefix + "test_stream_name" DefaultCSSAppName = "live" DefaultCSSOperator = "tf_admin" DefaultCSSPrefix = "tf_css_" DefaultCSSPlayDomainName = "test122.jingxhu.top" DefaultCSSPushDomainName = "177154.push.tlivecloud.com" DefaultCSSBindingCertName = "keep_ssl_css_domain_test" )
CSS
View Source
const ( DefaultInstanceId = "ins-881b1c8w" DefaultCommandId = "cmd-rxbs7f5z" )
TAT
View Source
const ( DefaultTdcpgClusterId = "tdcpg-m5e26fi8" DefaultTdcpgClusterName = "keep-tdcpg-test" DefaultTdcpgPayMode = "POSTPAID_BY_HOUR" DefaultTdcpgInstanceId = "tdcpg-ins-fc0e5kes" DefaultTdcpgInstanceName = "keep-tdcpg-instance-test" DefaultTdcpgZone = "ap-guangzhou-3" DefaultTdcpgTestNamePrefix = "tf-tdcpg-" )
TDCPG
View Source
const ( DefaultDbBrainsagId = "sag-01z37l4g" DefaultDbBrainInstanceId = "cdb-fitq5t9h" )
DBBRAIN
View Source
const ( DefaultRumInstanceId = "rum-pasZKEI3RLgakj" DefaultRumProjectId = "131407" )
RUM
View Source
const ( DefaultEnvironmentId = "en-85377m6j" DefaultApplicationId = "app-joqr9bd5" DefaultTemVpcId = "vpc-4owdpnwr" DefaultTemSubnetId = "subnet-c1l35990" DefaultLogsetId = "33aaf0ae-6163-411b-a415-9f27450f68db" DefaultTopicId = "88735a07-bea4-4985-8763-e9deb6da4fad" )
TEM
View Source
const ( DefaultCiBucket = "terraform-ci-1308919341" DefaultStyleName = "terraform_test" )
CI
View Source
const ( DefaultCynosdbClusterId = "cynosdbmysql-bws8h88b" DefaultCynosdbClusterInstanceId = "cynosdbmysql-ins-afqx1hy0" DefaultCynosdbSecurityGroup = "sg-baxfiao5" )
Cynosdb
View Source
const ( DefaultNamespaceId = "namespace-aemrg36v" DefaultTsfApplicationId = "application-a24x29xv" DefaultTsfClustId = "cluster-vwgj5e6y" DefaultTsfGroupId = "group-yrjkln9v" DefaultTsfGateway = "gw-ins-lvdypq5k" DefaultTsfDestNamespaceId = "namespace-aemrg36v" DefaultTsfConfigId = "dcfg-y54wzk3a" DefaultTsfApiId = "api-j03q029a" DefaultTsfGWGroupId = "group-vzd97zpy" DefaultTsfFileConfigId = "dcfg-f-ab6l9x5y" DefaultTsfImageId = "img-7r9vq8wd" DefaultTsfGWNamespaceId = "namespace-vwgo38wy" DefaultTsfContainerGroupId = "group-y43x5jpa" DefaultTsfpodName = "keep-terraform-7f4874bc5c-w75q4" )
TSF
View Source
const ( DefaultCrsInstanceId = "crs-jf4ico4v" DefaultCrsVpcId = "vpc-4owdpnwr" DefaultCrsSubnetId = "subnet-4o0zd840" DefaultCrsSecurityGroups = "sg-edmur627" DefaultCrsGroupId = "crs-rpl-orfiwmn5" )
CRS
View Source
const ( DefaultLighthouseInstanceId = "lhins-g4bwdjbf" DefaultLighthoustDiskId = "lhdisk-do4p4hz6" DefaultLighthouseBackupDiskId = "lhdisk-cwodsc4q" DefaultLighthouseBackUpId = "lhbak-bpum3ygx" DefaultLighthouseSnapshotId = "lhsnap-o2mvsvk3" )
View Source
const ( DefaultEngineResourceSpec = "spec-qvj6k7t4q" DefaultTseVpcId = "vpc-4owdpnwr" DefaultTseSubnetId = "subnet-dwj7ipnc" DefaultTseGatewayId = "gateway-ddbb709b" DefaultTseCertId = "vYSQkJ3K" )
TSE
View Source
const ( DefaultEsInstanceId = "es-5wn36he6" DefaultEsSecurityGroup = "sg-edmur627" DefaultEsLogstash = "ls-kru90fkz" DefaultEsVpcId = "vpc-lrj71tt3" DefaultEsSubnetId = "subnet-kggvos8o" )
ES
View Source
const ( DefaultMpsScheduleId = 24685 DefaultMpsScheduleName = "keep_mps_schedule_001" )
MPS
View Source
const ( ACCOUNT_TYPE_INTERNATIONAL = "INTERNATIONAL" ACCOUNT_TYPE_PREPAY = "PREPAY" ACCOUNT_TYPE_COMMON = "COMMON" ACCOUNT_TYPE_PRIVATE = "PRIVATE" ACCOUNT_TYPE_SUB_ACCOUNT = "SUB_ACCOUNT" ACCOUNT_TYPE_SMS = "SMS" ACCOUNT_TYPE_SES = "SES" ACCOUNT_TYPE_TSF = "TSF" ACCOUNT_TYPE_SSL = "SSL" ACCOUNT_TYPE_ORGANIZATION = "ORGANIZATION" INTERNATIONAL_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_INTERNATIONAL" INTERNATIONAL_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_INTERNATIONAL" PREPAY_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_PREPAY" PREPAY_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_PREPAY" PRIVATE_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_PRIVATE" PRIVATE_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_PRIVATE" COMMON_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_COMMON" COMMON_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_COMMON" SUB_ACCOUNT_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_SUB_ACCOUNT" SUB_ACCOUNT_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_SUB_ACCOUNT" SMS_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_SMS" SMS_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_SMS" TSF_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_TSF" TSF_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_TSF" SSL_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_SSL" SSL_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_SSL" ORGANIZATION_PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID_ORGANIZATION" ORGANIZATION_PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY_ORGANIZATION" )
View Source
const CbsBackUp = ` variable "cbs_backup_disk_id" { default = "` + DefaultCbsBackupDiskId + `" } `
View Source
const ClbTargetEniTestCase = InstanceCommonTestCase + `
resource "tencentcloud_eni" "clb_eni_target" {
name = "ci-test-eni"
vpc_id = var.cvm_vpc_id
subnet_id = var.cvm_subnet_id
description = "clb eni backend"
ipv4_count = 1
}
resource "tencentcloud_eni_attachment" "foo" {
eni_id = tencentcloud_eni.clb_eni_target.id
instance_id = tencentcloud_instance.default.id
}
`
CLB
View Source
const CommonCynosdb = ` variable "cynosdb_cluster_id" { default = "` + DefaultCynosdbClusterId + `" } variable "cynosdb_cluster_instance_id" { default = "` + DefaultCynosdbClusterInstanceId + `" } variable "cynosdb_cluster_security_group_id" { default = "` + DefaultCynosdbSecurityGroup + `" } `
View Source
const CommonPresetDcdb = ` variable "availability_zone" { default = "` + DefaultAZone + `" } variable "region" { default = "` + DefaultRegion + `" } data "tencentcloud_dcdb_instances" "dcdb" { search_name = "instancename" search_key = "` + DefaultDcdbInstanceName + `" } locals { dcdb_id = data.tencentcloud_dcdb_instances.dcdb.list.0.instance_id } `
ref with `local.dcdb_id`
View Source
const CommonPresetMysql = ` variable "availability_zone" { default = "` + DefaultAZone + `" } variable "region" { default = "` + DefaultRegion + `" } data "tencentcloud_mysql_instance" "mysql" { instance_name = "` + DefaultMySQLName + `" } locals { mysql_id = data.tencentcloud_mysql_instance.mysql.instance_list.0.mysql_id } `
ref with `local.mysql_id`
View Source
const CommonPresetPGSQL = ` data "tencentcloud_postgresql_instances" "foo" { name = "` + DefaultPGSQLName + `" } locals { pgsql_id = data.tencentcloud_postgresql_instances.foo.instance_list.0.id } `
View Source
const CommonPresetRedis = `
locals {
redis_id = "crs-jf4ico4v"
redis_name = "Keep-terraform"
}
`
ref with `local.redis_id`
View Source
const CommonPresetSQLServer = ` data "tencentcloud_sqlserver_instances" "sqlserver" { name = "` + DefaultSQLServerName + `" } locals { # local.sqlserver_id sqlserver_id = data.tencentcloud_sqlserver_instances.sqlserver.instance_list.0.id sqlserver_db = "` + DefaultSQLServerDB + `" } `
View Source
const CommonPresetSQLServerAccount = CommonPresetSQLServer + ` data "tencentcloud_sqlserver_accounts" "test"{ instance_id = local.sqlserver_id name = "` + DefaultSQLServerAccount + `" } locals { # local.sqlserver_id sqlserver_account = data.tencentcloud_sqlserver_accounts.test.list.0.name sqlserver_pwd = data.tencentcloud_sqlserver_accounts.test.list.0.name } `
View Source
const CommonPubSubSQLServer = ` data "tencentcloud_sqlserver_instances" "pub_sqlserver" { name = "` + DefaultPubSQLServerName + `" } data "tencentcloud_sqlserver_instances" "sub_sqlserver" { name = "` + DefaultSubSQLServerName + `" } locals { pub_sqlserver_id = data.tencentcloud_sqlserver_instances.pub_sqlserver.instance_list.0.id sub_sqlserver_id = data.tencentcloud_sqlserver_instances.sub_sqlserver.instance_list.0.id sqlserver_pubsub_db = "` + DefaultSQLServerPubSubDB + `" sqlserver_pub_db = "` + DefaultSQLServerPubDB + `" sqlserver_sub_db = "` + DefaultSQLServerSubDB + `" } `
View Source
const DefaultAsVariable = ` variable "availability_zone" { default = "` + DefaultCvmAZone + `" } data "tencentcloud_instance_types" "default" { filter { name = "zone" values = [var.availability_zone] } cpu_core_count = 2 exclude_sold_out = true } `
AS
View Source
const DefaultAzVariable = `
variable "default_az" {
default = "ap-guangzhou-3"
}
variable "default_az7" {
default = "ap-guangzhou-7"
}
`
View Source
const DefaultCVMName = "keep-cvm"
View Source
const DefaultCamVariables = `` /* 242-byte string literal not displayed */
View Source
const DefaultCbsBackupDiskId = "disk-r69pg9vw"
CBS
View Source
const DefaultClickhouseInstanceId = "cdwch-pcap78rz"
Clickhouse
View Source
const DefaultClickhouseVariables = ` variable "instance_id" { default = "` + DefaultClickhouseInstanceId + `" } `
View Source
const DefaultCommonCvmId = "ins-cr2rfq78"
cvm-modification
View Source
const DefaultCrsVar = ` variable "vpc_id" { default = "` + DefaultCrsVpcId + `" } variable "subnet_id" { default = "` + DefaultCrsSubnetId + `" } `
View Source
const DefaultCvmImageVariable = ` variable "cvm_id" { default = "` + DefaultCvmId + `" } variable "disk_id" { default = "` + DefaultDiskId + `" } variable "snap_id" { default = "` + DefaultSnapId + `" } `
View Source
const DefaultCvmModificationVariable = ` variable "cvm_id" { default = "` + DefaultCommonCvmId + `" } `
View Source
const (
DefaultDTSJobId = "dts-r5gpejpe"
)
DTS
View Source
const DefaultEMRVariable = ` variable "vpc_id" { default = "` + DefaultEMRVpcId + `" } variable "subnet_id" { default = "` + DefaultEMRSubnetId + `" } variable "sg_id" { default = "` + DefaultEMRSgId + `" } `
View Source
const DefaultEsVariables = ` variable "instance_id" { default = "` + DefaultEsInstanceId + `" } variable "security_group_id" { default = "` + DefaultEsSecurityGroup + `" } variable "logstash_id" { default = "` + DefaultEsLogstash + `" } variable "availability_zone" { default = "ap-guangzhou-3" } variable "vpc_id" { default = "` + DefaultEsVpcId + `" } variable "subnet_id" { default = "` + DefaultEsSubnetId + `" } `
View Source
const DefaultFileSystem = ` data "tencentcloud_cfs_file_systems" "fs" { name = "` + DefaultFileSystemName + `" } # doesn't support datasource for now variable "mount_id" { default = "cfs-iobiaxtj" } locals { cfs = data.tencentcloud_cfs_file_systems.fs.file_system_list.0 cfs_id = local.cfs.file_system_id }`
View Source
const DefaultFileSystemName = "keep_preset_cfs"
View Source
const DefaultImages = ` variable "default_img_id" { default = "` + DefaultTkeOSImageId + `" } variable "default_img" { default = "` + DefaultTkeOSImageName + `" } `
View Source
const DefaultInstanceVariable = DefaultVpcVariable + `
data "tencentcloud_availability_zones" "default" {
}
data "tencentcloud_images" "default" {
image_type = ["PUBLIC_IMAGE"]
image_name_regex = "Final"
}
data "tencentcloud_images" "testing" {
image_type = ["PUBLIC_IMAGE"]
}
data "tencentcloud_instance_types" "default" {
filter {
name = "zone"
values = [var.availability_cvm_zone]
}
filter {
name = "instance-family"
values = ["S1", "S2", "S3", "S4", "S5"]
}
cpu_core_count = 2
memory_size = 2
exclude_sold_out = true
}
`
View Source
const DefaultKafkaVariable = ` variable "instance_id" { default = "` + DefaultKafkaInstanceId + `" } variable "vpc_id" { default = "` + DefaultKafkaVpcId + `" } variable "subnet_id" { default = "` + DefaultKafkaSubnetId + `" } variable "international_vpc_id" { default = "` + DefaultKafkaInternationalVpcId + `" } variable "international_subnet_id" { default = "` + DefaultKafkaInternationalSubnetId + `" } `
View Source
const DefaultLighthoustVariables = ` variable "lighthouse_id" { default = "` + DefaultLighthouseInstanceId + `" } variable "lighthouse_disk_id" { default = "` + DefaultLighthoustDiskId + `" } variable "lighthouse_backup_disk_id" { default = "` + DefaultLighthouseBackupDiskId + `" } variable "lighthouse_backup_id" { default = "` + DefaultLighthouseBackUpId + `" } variable "lighthouse_snapshot_id" { default = "` + DefaultLighthouseSnapshotId + `" } `
View Source
const DefaultMongoDBSpec = `` /* 1802-byte string literal not displayed */
MongoDB
View Source
const (
DefaultMySQLName = "keep_preset_mysql"
)
View Source
const DefaultPGOperationName = "keep-pg-operation"
PostgreSQL
View Source
const DefaultPGSQLName = "keep-postgresql"
View Source
const DefaultProjectVariable = ` variable "default_project" { default = ` + DefaultProjectId + ` } `
Project
View Source
const DefaultPubSQLServerName = "keep-publish-instance"
View Source
const DefaultRebootCvmId = "ins-f9jr4bd2"
cvm-reboot
View Source
const DefaultRebootCvmVariable = ` variable "cvm_id" { default = "` + DefaultRebootCvmId + `" } `
View Source
const (
DefaultRegionSes = "ap-hongkong"
)
End of DCDB SES
View Source
const DefaultSCFCosBucket = `` /* 338-byte string literal not displayed */
View Source
const DefaultSQLServerAccount = "keep_sqlserver_account"
View Source
const DefaultSQLServerDB = "keep_sqlserver_db"
View Source
const DefaultSQLServerName = "keep-preset_sqlserver"
SQLServer
View Source
const DefaultSQLServerPubDB = "keep_pub_db"
View Source
const DefaultSQLServerPubSubDB = "keep_pubsub_db"
View Source
const DefaultSQLServerSubDB = "keep_sub_db"
View Source
const DefaultScfNamespace = "preset-scf-namespace"
View Source
const DefaultSecurityGroupData = FixedTagVariable + `
data "tencentcloud_security_groups" "internal" {
name = "default"
tags = var.fixed_tags
}
data "tencentcloud_security_groups" "exclusive" {
name = "test_preset_sg"
}
locals {
# local.sg_id
sg_id = data.tencentcloud_security_groups.internal.security_groups.0.security_group_id
sg_id2 = data.tencentcloud_security_groups.exclusive.security_groups.0.security_group_id
}
`
View Source
const DefaultSubSQLServerName = "keep-subscribe-instance"
View Source
const DefaultTCRInstanceData = DefaultTCRInstanceVar + `
data "tencentcloud_tcr_instances" "tcr" {
name = var.tcr_name
}
locals {
tcr_id = data.tencentcloud_tcr_instances.tcr.instance_list.0.id
}
`
View Source
const DefaultTCRInstanceId = "tcr-aoz8mxoz"
View Source
const DefaultTCRInstanceName = "keep-tcr-instance-sh"
TCR Service
View Source
const DefaultTCRInstanceVar = ` variable "tcr_name" { default = "` + DefaultTCRInstanceName + `" } variable "tcr_namespace" { default = "` + DefaultTCRNamespace + `" } variable "tcr_repo" { default = "` + DefaultTCRRepoName + `" } `
View Source
const DefaultTCRNamespace = "keep-tcr-namespace-sh"
View Source
const DefaultTCRRepoName = "keep-tcr-repo-sh"
View Source
const DefaultTCRSSL = "zjUMifFK"
View Source
const DefaultTcaPlusClusterName = "keep-tcaplus-cluster"
View Source
const DefaultTcaPlusClusterTable = "keep_players"
View Source
const DefaultTcaPlusClusterTableGroup = "keep_table_group"
View Source
const DefaultTcaPlusData = DefaultTcaPlusVar + `
data "tencentcloud_tcaplus_clusters" "tcaplus" {
cluster_name = var.tcaplus_cluster
}
data "tencentcloud_tcaplus_tablegroups" "group" {
cluster_id = data.tencentcloud_tcaplus_clusters.tcaplus.list.0.cluster_id
tablegroup_name = var.tcaplus_table_group
}
data "tencentcloud_tcaplus_clusters" "tdr_tcaplus" {
cluster_name = "keep_tdr_tcaplus_cluster"
}
data "tencentcloud_tcaplus_tablegroups" "tdr_group" {
cluster_id = data.tencentcloud_tcaplus_clusters.tdr_tcaplus.list.0.cluster_id
tablegroup_name = "keep_tdr_table_group"
}
locals {
tcaplus_id = data.tencentcloud_tcaplus_clusters.tcaplus.list.0.cluster_id
tcr_tcaplus_id = data.tencentcloud_tcaplus_clusters.tdr_tcaplus.list.0.cluster_id
tcaplus_table_group = var.tcaplus_table_group
tcaplus_table_group_id = data.tencentcloud_tcaplus_tablegroups.group.list.0.tablegroup_id
tcr_tcaplus_table_group_id = data.tencentcloud_tcaplus_tablegroups.tdr_group.list.0.tablegroup_id
tcaplus_table = var.tcaplus_table
}
`
View Source
const DefaultTcaPlusTdrClusterName = "keep_tdr_tcaplus_cluster"
View Source
const DefaultTcaPlusTdrClusterTableGroup = "keep_tdr_table_group"
View Source
const DefaultTcaPlusVar = ` variable "tcaplus_cluster" { default = "` + DefaultTcaPlusClusterName + `" } variable "tcaplus_table_group" { default = "` + DefaultTcaPlusClusterTableGroup + `" } variable "tcaplus_table" { default = "` + DefaultTcaPlusClusterTable + `" } variable "tcaplus_tcr_cluster" { default = "` + DefaultTcaPlusTdrClusterName + `" } variable "tcaplus_tcr_table_group" { default = "` + DefaultTcaPlusTdrClusterTableGroup + `" } `
View Source
const DefaultTseVar = ` variable "gateway_id" { default = "` + DefaultTseGatewayId + `" } variable "cert_id" { default = "` + DefaultTseCertId + `" } `
View Source
const DefaultVpcSubnets = DefaultAzVariable + `
data "tencentcloud_vpc_subnets" "gz3" {
availability_zone = var.default_az
is_default = true
}
locals {
vpc_id = data.tencentcloud_vpc_subnets.gz3.instance_list.0.vpc_id
subnet_id = data.tencentcloud_vpc_subnets.gz3.instance_list.0.subnet_id
}`
Default VPC/Subnet datasource
View Source
const DefaultVpcVariable = ` variable "instance_name" { default = "` + DefaultInsName + `" } variable "instance_name_update" { default = "` + DefaultInsNameUpdate + `" } variable "availability_region" { default = "` + DefaultRegion + `" } variable "availability_zone" { default = "` + DefaultAZone + `" } variable "availability_cvm_zone" { default = "` + DefaultCvmAZone + `" } variable "availability_cvm_international_zone" { default = "` + DefaultCvmInternationalZone + `" } variable "availability_cvm_testing_zone" { default = "` + DefaultCvmTestingAZone + `" } variable "cvm_testing_vpc_id" { default = "` + DefaultCvmTestingVpcId + `" } variable "cvm_testing_subnet_id" { default = "` + DefaultCvmTestingSubnetId + `" } variable "cvm_testing_image_id" { default = "` + DefaultCvmTestingImgId + `" } variable "cvm_vpc_id" { default = "` + DefaultCvmVpcId + `" } variable "cvm_subnet_id" { default = "` + DefaultCvmSubnetId + `" } variable "cvm_international_vpc_id" { default = "` + DefaultCvmInternationalVpcId + `" } variable "cvm_international_subnet_id" { default = "` + DefaultCvmInternationalSubnetId + `" } variable "vpc_id" { default = "` + DefaultVpcId + `" } variable "vpc_cidr" { default = "` + DefaultVpcCidr + `" } variable "vpc_cidr_less" { default = "` + DefaultVpcCidrLess + `" } variable "subnet_id" { default = "` + DefaultSubnetId + `" } variable "sg_id" { default = "` + DefaultSecurityGroup + `" } variable "subnet_cidr" { default = "` + DefaultSubnetCidr + `" } variable "subnet_cidr_less" { default = "` + DefaultSubnetCidrLess + `" } `
View Source
const DefaultVpnDataSource = `` /* 141-byte string literal not displayed */
vpn
View Source
const FixedTagVariable = `
variable "fixed_tags" {
default = {
fixed_resource: "do_not_remove"
}
}
`
View Source
const InstanceCommonTestCase = DefaultInstanceVariable + `
resource "tencentcloud_instance" "default" {
instance_name = var.instance_name
availability_zone = var.availability_cvm_zone
image_id = data.tencentcloud_images.default.images.0.image_id
instance_type = data.tencentcloud_instance_types.default.instance_types.0.instance_type
system_disk_type = "CLOUD_PREMIUM"
system_disk_size = 50
allocate_public_ip = true
internet_max_bandwidth_out = 10
vpc_id = var.cvm_vpc_id
subnet_id = var.cvm_subnet_id
}
`
View Source
const OperationPresetPGSQL = ` data "tencentcloud_postgresql_instances" "foo" { name = "` + DefaultPGOperationName + `" } data "tencentcloud_postgresql_readonly_groups" "ro_groups" { filters { name = "db-master-instance-id" values = [data.tencentcloud_postgresql_instances.foo.instance_list.0.id] } order_by = "CreateTime" order_by_type = "asc" } locals { pgsql_id = data.tencentcloud_postgresql_instances.foo.instance_list.0.id pgrogroup_id = data.tencentcloud_postgresql_readonly_groups.ro_groups.read_only_group_list.0.read_only_group_id } `
View Source
const PresetCVM = ` data "tencentcloud_instances" "instance" { instance_name = "` + DefaultCVMName + `" } locals { cvm_id = data.tencentcloud_instances.instance.instance_list.0.instance_id cvm_az = "` + DefaultAZone + `" cvm_private_ip = data.tencentcloud_instances.instance.instance_list.0.private_ip } `
View Source
const TestAccSqlserverAZ = `` /* 271-byte string literal not displayed */
View Source
const TkeCIDRs = `` /* 437-byte string literal not displayed */
List sample CIDRs to avoid conflict when running multiple cluster testcase parallel
View Source
const TkeDataSource = ` data "tencentcloud_kubernetes_clusters" "tke" { cluster_name = "` + DefaultTkeClusterName + `" } locals { cluster_id = data.tencentcloud_kubernetes_clusters.tke.list.0.cluster_id } `
View Source
const TkeDefaultNodeInstanceVar = `
variable "ins_type" {
//default = "SA2.LARGE8"
default = "S2.MEDIUM2"
}
`
View Source
const TkeExclusiveNetwork = DefaultAzVariable + ` data "tencentcloud_vpc_instances" "vpc" { name = "` + TkeExclusiveVpcName + `" } data "tencentcloud_vpc_subnets" "subnet" { vpc_id = data.tencentcloud_vpc_instances.vpc.instance_list.0.vpc_id } data "tencentcloud_instance_types" "default" { filter { name = "zone" values = [var.default_az] } filter { name = "instance-charge-type" values = ["POSTPAID_BY_HOUR"] } cpu_core_count = 2 exclude_sold_out = true } locals { vpc_id = data.tencentcloud_vpc_subnets.subnet.instance_list.0.vpc_id subnet_id = data.tencentcloud_vpc_subnets.subnet.instance_list.0.subnet_id scale_instance_type = data.tencentcloud_instance_types.default.instance_types.0.instance_type } `
View Source
const TkeInstanceType = ` data "tencentcloud_instance_types" "ins_type" { availability_zone = "` + DefaultCvmAZone + `" cpu_core_count = 2 exclude_sold_out = true } locals { ins_az = "` + DefaultCvmAZone + `" type1 = [for i in data.tencentcloud_instance_types.ins_type.instance_types: i if lookup(i, "instance_charge_type") == "POSTPAID_BY_HOUR"] type2 = [for i in data.tencentcloud_instance_types.ins_type.instance_types: i] final_type = concat(local.type1, local.type2)[0].instance_type } `
@deprecated. Avoid using this because it may return diff results
View Source
const UserInfoData = `` /* 206-byte string literal not displayed */
Variables ¶
View Source
var AccProvider *schema.Provider
View Source
var AccProviders map[string]*schema.Provider
View Source
var Appid string = os.Getenv("TENCENTCLOUD_APPID")
View Source
var OwnerUin string = os.Getenv("TENCENTCLOUD_OWNER_UIN")
View Source
var PersistResource = regexp.MustCompile("^(keep|Default)")
Functions ¶
func AccCheckTencentCloudDataSourceID ¶
func AccCheckTencentCloudDataSourceID(n string) resource.TestCheckFunc
func AccPreCheck ¶
func AccPreCheckBusiness ¶
func AccPreCheckCommon ¶
func AccStepSetRegion ¶
func AccStepTimeSleepDuration ¶ added in v1.81.101
func AccStepTimeSleepDuration(d time.Duration) resource.TestCheckFunc
func IsResourcePersist ¶
Check if resource should persist instead of recycled
func SharedClientForRegion ¶ added in v1.81.60
Types ¶
type TencentCloudClient ¶ added in v1.81.60
type TencentCloudClient struct {
// contains filtered or unexported fields
}
func (*TencentCloudClient) GetAPIV3Conn ¶ added in v1.81.60
func (meta *TencentCloudClient) GetAPIV3Conn() *connectivity.TencentCloudClient
GetAPIV3Conn 返回访问云 API 的客户端连接对象
Click to show internal directories.
Click to hide internal directories.