tencentcloud

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2019 License: MPL-2.0 Imports: 39 Imported by: 5

Documentation

Overview

Use this data source to query scaling configuration information.

Example Usage

```hcl

data "tencentcloud_as_scaling_configs" "as_configs" {
    configuration_id   = "asc-oqio4yyj"
    result_output_file = "my_test_path"
}

```

Use this data source to query the detail information of an existing autoscaling group.

Example Usage

```hcl

data "tencentcloud_as_scaling_groups" "as_scaling_groups" {
    scaling_group_name  = "myasgroup"
    configureation_id   = "asc-oqio4yyj"
    result_output_file  = "my_test_path"
}

```

Use this data source to query detailed information of scaling policy.

Example Usage

```hcl

data "tencentcloud_as_scaling_policies" "as_scaling_policies" {
    scaling_policy_id      = "asg-mvyghxu7"
    result_output_file    = "mytestpath"
}

```

Use this data source to query the metadata of an object stored inside a bucket.

Example Usage

```hcl

data "tencentcloud_cos_bucket_object" "mycos" {
    bucket = "mycos-test-1258798060"
    key    = "hello-world.py"
    result_output_file  = "TFresults"
}

```

Use this data source to query the COS buckets of the current Tencent Cloud user.

Example Usage

```hcl

data "tencentcloud_cos_buckets" "cos_buckets" {
	bucket_prefix = "tf-bucket-"
    result_output_file = "mytestpath"
}

```

Use this data source to query the list of backup databases.

Example Usage

```hcl

resource "tencentcloud_mysql_backup_list" "default" {
  mysql_id = "my-test-database"
  max_number = 10
  result_output_file = "mytestpath"
}

```

Use this data source to get information about a MySQL instance.

Example Usage

```hcl

data "tencentcloud_mysql_instance" "database"{
  mysql_id = "my-test-database"
  result_output_file = "mytestpath"
}

```

Use this data source to get information about a parameter group of a database instance.

Example Usage

```hcl

data "tencentcloud_mysql_parameter_list" "mysql" {
  mysql_id = "my-test-database"
  engine_version = "5.5"
  result_output_file = "mytestpath"
}

```

Use this data source to query the available database specifications for different regions. And a maximum of 20 requests can be initiated per second for this query.

Example Usage

```hcl

data "tencentcloud_mysql_zone_config" "mysql" {
  region = "ap-guangzhou"
  result_output_file = "mytestpath"
}

```

Use this data source to query the detail information of redis instance.

Example Usage

```hcl

data "tencentcloud_redis_instances" "redislab" {
    zone                = "ap-hongkong-1"
    search_key          = "myredis"
    project_id          = 0
    limit               = 20
    result_output_file  = "/tmp/redis_instances"
}

```

Use this data source to query which instance types of Redis are available in a specific region.

Example Usage

```hcl

data "tencentcloud_redis_zone_config" "redislab" {
    region             = "ap-hongkong"
    result_output_file = "/temp/mytestpath"
}

```

The TencentCloud provider is used to interact with many resources supported by TencentCloud. The provider needs to be configured with the proper credentials before it can be used.

The TencentCloud provider is used to interact with the many resources supported by [TencentCloud](https://intl.cloud.tencent.com). The provider needs to be configured with the proper credentials before it can be used.

Use the navigation to the left to read about the available resources.

Example Usage

```hcl # Configure the TencentCloud Provider

provider "tencentcloud" {
  secret_id  = "${var.secret_id}"
  secret_key = "${var.secret_key}"
  region     = "${var.region}"
}

```

Resources List

Data Sources

tencentcloud_availability_zones
tencentcloud_container_clusters
tencentcloud_container_cluster_instances
tencentcloud_instance_types
tencentcloud_image
tencentcloud_eip
tencentcloud_vpc
tencentcloud_subnet
tencentcloud_route_table
tencentcloud_security_group
tencentcloud_nats
tencentcloud_mysql_instance
tencentcloud_mysql_backup_list
tencentcloud_mysql_parameter_list
tencentcloud_mysql_zone_config
tencentcloud_cos_buckets
tencentcloud_cos_bucket_object
tencentcloud_redis_zone_config
tencentcloud_redis_instances
tencentcloud_as_scaling_configs
tencentcloud_as_scaling_groups
tencentcloud_as_scaling_policies

CBS Resources

tencentcloud_cbs_storage
tencentcloud_cbs_storage_attachment
tencentcloud_cbs_snapshot

Container Cluster Resources

tencentcloud_container_cluster
tencentcloud_container_cluster_instance

CVM Resources

tencentcloud_instance
tencentcloud_eip
tencentcloud_eip_association
tencentcloud_key_pair

LB Resources

tencentcloud_lb
tencentcloud_alb_server_attachment

VPC Resources

tencentcloud_vpc
tencentcloud_subnet
tencentcloud_security_group
tencentcloud_security_group_rule
tencentcloud_route_table
tencentcloud_route_entry
tencentcloud_dnat
tencentcloud_nat_gateway

MySQL Resources

tencentcloud_mysql_instance
tencentcloud_mysql_readonly_instance
tencentcloud_mysql_account
tencentcloud_mysql_account_privilege
tencentcloud_mysql_backup_policy

COS Resources

tencentcloud_cos_bucket
tencentcloud_cos_bucket_object

Redis Resources

tencentcloud_redis_instance
tencentcloud_redis_backup_config

AS Resources

tencentcloud_as_scaling_config
tencentcloud_as_scaling_group
tencentcloud_as_attachment
tencentcloud_as_scaling_policy
tencentcloud_as_schedule
tencentcloud_as_lifecycle_hook
tencentcloud_as_notification

Provides a resource to attach or detach CVM instances to a specified scaling group.

Example Usage

```hcl

resource "tencentcloud_as_attachment" "attachment" {
  scaling_group_id           = "sg-afasfa"
  instance_id                = ["ins-01", "ins-02"]
}

```

Provides a resource for an AS (Auto scaling) lifecycle hook.

Example Usage

```hcl

resource "tencentcloud_as_lifecycle_hook" "lifecycle_hook" {
	scaling_group_id = "sg-12af45"
	lifecycle_hook_name = "tf-as-lifecycle-hook"
	lifecycle_transition = "INSTANCE_LAUNCHING"
	default_result = "CONTINUE"
	heartbeat_timeout = 500
	notification_metadata = "tf test"
	notification_target_type = "CMQ_QUEUE"
	notification_queue_name = "lifcyclehook"
}

```

Provides a resource for an AS (Auto scaling) notification.

Example Usage

```hcl

resource "tencentcloud_as_notification" "as_notification" {
  scaling_group_id              = "sg-12af45"
  notification_type             = ["SCALE_OUT_FAILED", "SCALE_IN_SUCCESSFUL", "SCALE_IN_FAILED", "REPLACE_UNHEALTHY_INSTANCE_FAILED"]
  notification_user_group_ids   = ["76955"]
}

```

Provides a resource to create a configuration for an AS (Auto scaling) instance.

Example Usage

```hcl

resource "tencentcloud_as_scaling_config" "launch_configuration" {
	configuration_name = "launch-configuration"
	image_id = "img-9qabwvbn"
	instance_types = ["SA1.SMALL1"]
	project_id = 0
	system_disk_type = "CLOUD_PREMIUM"
	system_disk_size = "50"
	data_disk = {
		disk_type = "CLOUD_PREMIUM"
		disk_size = 50
	}
	internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
	internet_max_bandwidth_out = 10
	public_ip_assigned = true
	password = "test123#"
	enhanced_security_service = false
	enhanced_monitor_service = false
	user_data = "dGVzdA=="
	instance_tags = {
		tag = "as"
	}
}

```

Import

AutoScaling Configuration can be imported using the id, e.g.

```hcl $ terraform import tencentcloud_as_scaling_config.scaling_config asc-n32ymck2 ```

Provides a resource to create a group of AS (Auto scaling) instances.

Example Usage

```hcl

resource "tencentcloud_as_scaling_group" "scaling_group" {
	scaling_group_name = "tf-as-scaling-group"
	configuration_id = "asc-oqio4yyj"
	max_size = 1
	min_size = 0
	vpc_id = "vpc-3efmz0z"
	subnet_ids = ["subnet-mc3egos"]
	project_id = 0
	default_cooldown = 400
	desired_capacity = 1
	termination_policies = ["NEWEST_INSTANCE"]
	retry_policy = "INCREMENTAL_INTERVALS"
}

```

Import

AutoScaling Groups can be imported using the id, e.g.

```hcl $ terraform import tencentcloud_as_scaling_group.scaling_group asg-n32ymck2 ```

Provides a resource for an AS (Auto scaling) policy.

Example Usage

```hcl

resource "tencentcloud_as_scaling_policy" "scaling_policy" {
	scaling_group_id = "asg-n32ymck2"
	policy_name = "tf-as-scaling-policy"
	adjustment_type = "EXACT_CAPACITY"
	adjustment_value = 0
	comparison_operator = "GREATER_THAN"
	metric_name = "CPU_UTILIZATION"
	threshold = 80
	period = 300
	continuous_time = 10
	statistic = "AVERAGE"
	cooldown = 360
}

```

Provides a resource for an AS (Auto scaling) schedule.

Example Usage

```hcl

resource "tencentcloud_as_schedule" "schedule" {
	scaling_group_id = "sg-12af45"
	schedule_action_name = "tf-as-schedule"
	max_size = 10
	min_size = 0
	desired_capacity = 0
	start_time = "2019-01-01T00:00:00+08:00"
	end_time = "2019-12-01T00:00:00+08:00"
	recurrence = "0 0 * * *"
}

```

Provides a COS resource to create a COS bucket and set its attributes.

Example Usage

Private Bucket

```hcl

resource "tencentcloud_cos_bucket" "mycos" {
  bucket = "mycos-1258798060"
  acl    = "private"
}

```

Static Website

```hcl

resource "tencentcloud_cos_bucket" "mycos" {
  bucket = "mycos-1258798060"

  website = {
    index_document = "index.html"
    error_document = "error.html"
  }
}

```

Using CORS

```hcl

resource "tencentcloud_cos_bucket" "mycos" {
  bucket = "mycos-1258798060"
  acl    = "public-read-write"

  cors_rule {
    allowed_origins = ["http://*.abc.com"]
    allowed_methods = ["PUT", "POST"]
    allowed_headers = ["*"]
    max_age_seconds = 300
    expose_headers  = ["Etag"]
  }
}

```

Using object lifecycle

```hcl

resource "tencentcloud_cos_bucket" "mycos" {
  bucket = "mycos-1258798060"
  acl    = "public-read-write"

  lifecycle_rules {
    filter_prefix = "path1/"
    transition {
      data          = "2019-06-01"
      storage_class = "STANDARD_IA"
    }
    expiration {
      days = 90
    }
  }
}

```

Import

COS bucket can be imported, e.g.

``` $ terraform import tencentcloud_cos_bucket.bucket bucket-name ```

Provides a COS object resource to put an object(content or file) to the bucket.

Example Usage

Uploading a file to a bucket

```hcl

resource "tencentcloud_cos_bucket_object" "myobject" {
  bucket = "mycos-1258798060"
  key    = "new_object_key"
  source = "path/to/file"
}

```

Uploading a content to a bucket

```hcl

resource "tencentcloud_cos_bucket" "mycos" {
  bucket = "mycos-1258798060"
  acl = "public-read"
}
resource "tencentcloud_cos_bucket_object" "myobject" {
  bucket = "${tencentcloud_cos_bucket.mycos.bucket}"
  key    = "new_object_key"
  content = "the content that you want to upload."
}

```

Provides a MySQL account resource for database management. A MySQL instance supports multiple database account.

Example Usage

```hcl

resource "tencentcloud_mysql_account" "default" {
  mysql_id = "my-test-database"
  name = "tf_account"
  password = "********"
  description = "My test account"
}

```

Provides a mysql account privilege resource to grant different access privilege to different database. A database can be granted by multiple account.

Example Usage

```hcl

resource "tencentcloud_mysql_account_privilege" "default" {
  mysql_id = "my-test-database"
  account_name= "tf_account"
  privileges = ["SELECT"]
  database_names = ["instance.name"]
}

```

Provides a mysql policy resource to create a backup policy.

Example Usage

```hcl

resource "tencentcloud_mysql_backup_policy" "default" {
  mysql_id = "cdb-dnqksd9f"
  retention_period = 7
  backup_model = "logical"
  backup_time ="02:00–06:00"
}

```

Provides a mysql instance resource to create master database instances.

~> **NOTE:** The terminate operation of mysql does NOT take effect immediately,maybe takes for several hours. so during that time, VPCs associated with that mysql instance can't be terminated also.

Example Usage

```hcl

resource "tencentcloud_mysql_instance" "default" {
  internet_service = 1
  engine_version = "5.7"
  parameters = {
    max_connections = "1000"
  }
  root_password = "********"
  slave_deploy_mode = 0
  first_slave_zone = "ap-guangzhou-4"
  second_slave_zone = "ap-guangzhou-4"
  slave_sync_mode = 1
  availability_zone = "ap-guangzhou-4"
  project_id = 201901010001
  instance_name = "myTestMysql"
  mem_size = 128000
  volume_size = 250
  vpc_id = "vpc-12mt3l31"
  subnet_id = "subnet-9uivyb1g"
  intranet_port = 3306
  security_groups = ["sg-ot8eclwz"]
  tags = {
    name ="test"
  }
}

```

Provides a mysql instance resource to create read-only database instances.

~> **NOTE:** The terminate operation of mysql does NOT take effect immediately,maybe takes for several hours. so during that time, VPCs associated with that mysql instance can't be terminated also.

Example Usage

```hcl

resource "tencentcloud_mysql_readonly_instance" "default" {
  master_instance_id = "cdb-dnqksd9f"
  instance_name ="myTestMysql"
  mem_size = 128000
  volume_size = 255
  vpc_id = "vpc-12mt3l31"
  subnet_id = "subnet-9uivyb1g"
  intranet_port = 3306
  security_groups = ["sg-ot8eclwz"]
  tags = {
    name ="test"
  }
}

```

Use this data source to query which instance types of Redis are available in a specific region.

Example Usage

```hcl

resource "tencentcloud_redis_backup_config" "redislab" {
  redis_id       = "crs-7yl0q0dd"
  backup_time    = "04:00-05:00"
  backup_period  = "Monday"
}

```

Import

Redis backup config can be imported, e.g.

```hcl $ terraform import tencentcloud_redis_backup_config.redisconfig redis-id ```

Provides a resource to create a Redis instance and set its attributes.

Example Usage

```hcl

resource "tencentcloud_redis_instance" "redis_instance_test"{
	availability_zone="ap-hongkong-3"
	type="master_slave_redis"
	password="test12345789"
	mem_size=8192
	name="terrform_test"
	port=6379
}

```

Import

Redis instance can be imported, e.g.

```hcl $ terraform import tencentcloud_redis_instance.redislab redis-id ```

Index

Constants

View Source
const (
	// mysql
	MysqlInstanceIdNotFound  = "InvalidParameter.InstanceNotFound"
	MysqlInstanceIdNotFound2 = "InvalidParameter"
	MysqlInstanceIdNotFound3 = "InternalError.DatabaseAccessError"

	// as
	AsScalingGroupInProgress      = "ResourceInUse.ActivityInProgress"
	AsScalingGroupInstanceInGroup = "ResourceInUse.InstanceInGroup"
	AsScalingGroupNotFound        = "ResourceNotFound.AutoScalingGroupNotFound"
)
View Source
const (
	SYSTEM_DISK_TYPE_LOCAL_BASIC   = "LOCAL_BASIC"
	SYSTEM_DISK_TYPE_LOCAL_SSD     = "LOCAL_SSD"
	SYSTEM_DISK_TYPE_CLOUD_BASIC   = "CLOUD_BASIC"
	SYSTEM_DISK_TYPE_CLOUD_PREMIUM = "CLOUD_PREMIUM"
	SYSTEM_DISK_TYPE_CLOUD_SSD     = "CLOUD_SSD"
)
View Source
const (
	INTERNET_CHARGE_TYPE_BANDWIDTH_PREPAID          = "BANDWIDTH_PREPAID"
	INTERNET_CHARGE_TYPE_TRAFFIC_POSTPAID_BY_HOUR   = "TRAFFIC_POSTPAID_BY_HOUR"
	INTERNET_CHARGE_TYPE_BANDWIDTH_POSTPAID_BY_HOUR = "BANDWIDTH_POSTPAID_BY_HOUR"
	INTERNET_CHARGE_TYPE_BANDWIDTH_PACKAGE          = "BANDWIDTH_PACKAGE"
)
View Source
const (
	INSTANCE_CHARGE_TYPE_POSTPAID = "POSTPAID_BY_HOUR"
	INSTANCE_CHARGE_TYPE_SPOTPAID = "SPOTPAID"
)
View Source
const (
	SCALING_GROUP_TERMINATION_POLICY_NEWEST_INSTANCE = "NEWEST_INSTANCE"
	SCALING_GROUP_TERMINATION_POLICY_OLDEST_INSTANCE = "OLDEST_INSTANCE"
)
View Source
const (
	SCALING_GROUP_RETRY_POLICY_IMMEDIATE_RETRY       = "IMMEDIATE_RETRY"
	SCALING_GROUP_RETRY_POLICY_INCREMENTAL_INTERVALS = "INCREMENTAL_INTERVALS"
)
View Source
const (
	SCALING_GROUP_ADJUSTMENT_TYPE_CHANGE_IN_CAPACITY         = "CHANGE_IN_CAPACITY"
	SCALING_GROUP_ADJUSTMENT_TYPE_EXACT_CAPACITY             = "EXACT_CAPACITY"
	SCALING_GROUP_ADJUSTMENT_TYPE_PERCENT_CHANGE_IN_CAPACITY = "PERCENT_CHANGE_IN_CAPACITY"
)
View Source
const (
	SCALING_GROUP_COMPARISON_OPERATOR_GREATER       = "GREATER_THAN"
	SCALING_GROUP_COMPARISON_OPERATOR_GREATER_EQUAL = "GREATER_THAN_OR_EQUAL_TO"
	SCALING_GROUP_COMPARISON_OPERATOR_LESS          = "LESS_THAN"
	SCALING_GROUP_COMPARISON_OPERATOR_LESS_EQUAL    = "LESS_THAN_OR_EQUAL_TO"
	SCALING_GROUP_COMPARISON_OPERATOR_EQUAL         = "EQUAL_TO"
	SCALING_GROUP_COMPARISON_OPERATOR_NOT_EQUAL     = "NOT_EQUAL_TO"
)
View Source
const (
	SCALING_GROUP_METRIC_NAME_CPU_UTILIZATION = "CPU_UTILIZATION"
	SCALING_GROUP_METRIC_NAME_MEM_UTILIZATION = "MEM_UTILIZATION"
	SCALING_GROUP_METRIC_NAME_LAN_TRAFFIC_OUT = "LAN_TRAFFIC_OUT"
	SCALING_GROUP_METRIC_NAME_LAN_TRAFFIC_IN  = "LAN_TRAFFIC_IN"
	SCALING_GROUP_METRIC_NAME_WAN_TRAFFIC_OUT = "WAN_TRAFFIC_OUT"
	SCALING_GROUP_METRIC_NAME_WAN_TRAFFIC_IN  = "WAN_TRAFFIC_IN"
)
View Source
const (
	SCALING_GROUP_STATISTIC_AVERAGE = "AVERAGE"
	SCALING_GROUP_STATISTIC_MAXIMUM = "MAXIMUM"
	SCALING_GROUP_STATISTIC_MINIMUM = "MINIMUM"
)
View Source
const (
	SCALING_GROUP_NOTIFICATION_TYPE_SCALE_OUT_SUCCESS = "SCALE_OUT_SUCCESSFUL"
	SCALING_GROUP_NOTIFICATION_TYPE_SCALE_OUT_FAILED  = "SCALE_OUT_FAILED"
	SCALING_GROUP_NOTIFICATION_TYPE_SCALE_IN_SUCCESS  = "SCALE_IN_SUCCESSFUL"
	SCALING_GROUP_NOTIFICATION_TYPE_SCALE_IN_FAILED   = "SCALE_IN_FAILED"
	SCALING_GROUP_NOTIFICATION_TYPE_REPLACE_SUCCESS   = "REPLACE_UNHEALTHY_INSTANCE_SUCCESSFUL"
	SCALING_GROUP_NOTIFICATION_TYPE_REPLACE_FAILED    = "REPLACE_UNHEALTHY_INSTANCE_FAILED"
)
View Source
const (
	SCALING_GROUP_ACTIVITY_STATUS_INIT                 = "INIT"
	SCALING_GROUP_ACTIVITY_STATUS_RUNNING              = "RUNNING"
	SCALING_GROUP_ACTIVITY_STATUS_SUCCESSFUL           = "SUCCESSFUL"
	SCALING_GROUP_ACTIVITY_STATUS_PARTIALLY_SUCCESSFUL = "PARTIALLY_SUCCESSFUL"
	SCALING_GROUP_ACTIVITY_STATUS_FAILED               = "FAILED"
	SCALING_GROUP_ACTIVITY_STATUS_CANCELLED            = "CANCELLED"
)
View Source
const (
	ZONE_SELL_STATUS_ONLINE = 1
	ZONE_SELL_STATUS_NEW    = 2
)
View Source
const (
	MYSQL_STATUS_DELIVING  = 0
	MYSQL_STATUS_RUNNING   = 1
	MYSQL_STATUS_ISOLATING = 4
	MYSQL_STATUS_ISOLATED  = 5
)

mysql Status https://cloud.tencent.com/document/api/236/15872

View Source
const (
	MYSQL_TASK_STATUS_INITIAL = "INITIAL"
	MYSQL_TASK_STATUS_RUNNING = "RUNNING"
	MYSQL_TASK_STATUS_SUCCESS = "SUCCESS"
	MYSQL_TASK_STATUS_FAILED  = "FAILED"
	MYSQL_TASK_STATUS_REMOVED = "REMOVED"
	MYSQL_TASK_STATUS_PAUSED  = "PAUSED "
)

Async task status, from https://cloud.tencent.com/document/api/236/20410

View Source
const (
	MYSQL_RENEW_NOUSE = 0
	MYSQL_RENEW_OPEN  = 1
	MYSQL_RENEW_CLOSE = 2
)

automatic renewal status code

View Source
const (
	REDIS_VERSION_MASTER_SLAVE_REDIS = 2
	REDIS_VERSION_MASTER_SLAVE_CKV   = 3
	REDIS_VERSION_CLUSTER_CKV        = 4
	REDIS_VERSION_STANDALONE_REDIS   = 5
	REDIS_VERSION_CLUSTER_REDIS      = 7
)

redis version https://cloud.tencent.com/document/api/239/20022#ProductConf

View Source
const (
	REDIS_STATUS_INIT       = 0
	REDIS_STATUS_PROCESSING = 1
	REDIS_STATUS_ONLINE     = 2
	REDIS_STATUS_ISOLATE    = -2
	REDIS_STATUS_TODELETE   = -3
)

redis status https://cloud.tencent.com/document/product/239/20018

View Source
const (
	REDIS_ORDER_SUCCESS_DELIVERY = 4
	REDIS_ORDER_PAYMENT          = 12
)

https://cloud.tencent.com/document/api/239/20022#TradeDealDetail Order status 1: unpaid 2: paid, not shipped 3: in shipment 4: successfully 5: shipped failed 6: refunded 7: closed order 8: expired 9: order no longer valid 10: product no longer valid 11: payment refused 12: in payment

View Source
const (
	REDIS_TASK_PREPARING = "preparing"
	REDIS_TASK_RUNNING   = "running"
	REDIS_TASK_SUCCEED   = "succeed"
	REDIS_TASK_FAILED    = "failed"
	REDIS_TASK_ERROR     = "error"
)

https://cloud.tencent.com/document/api/239/30601

View Source
const (
	PROVIDER_SECRET_ID  = "TENCENTCLOUD_SECRET_ID"
	PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY"
	PROVIDER_REGION     = "TENCENTCLOUD_REGION"
)
View Source
const (
	BasicStorageMinimumSize   = 10
	PremiumStorageMinimumSize = 50
	SsdStorageMinimumSize     = 100
	StorageMaxSize            = 4000
)
View Source
const (
	CLUSTER_NOT_FOUND_CODE    = -16009
	CLUSTER_LIFESTATE_RUNNING = "Running"
)
View Source
const FILED_SP = "#"
View Source
const (
	INSTANCE_NOT_FOUND_CODE = -1
)
View Source
const MaxStorageNameLength = 60

Variables

View Source
var (
	MysqlPayByMonth = 0
	MysqlPayByUse   = 1
)

type of pay

View Source
var INTERNET_CHARGE_ALLOW_TYPE = []string{
	INTERNET_CHARGE_TYPE_TRAFFIC_POSTPAID_BY_HOUR,
}
View Source
var MYSQL_ALLOW_BACKUP_MODEL = []string{"logical", "physical"}
View Source
var MYSQL_ALLOW_BACKUP_TIME = []string{"02:00-06:00", "06:00-10:00", "10:00-14:00", "14:00-18:00", "18:00-22:00", "22:00-02:00"}
View Source
var MYSQL_AVAILABLE_PERIOD = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36}

mysql available period value

View Source
var MYSQL_DATABASE_MUST_PRIVILEGE = "SHOW VIEW"
View Source
var MYSQL_DATABASE_PRIVILEGE = []string{"SELECT", "INSERT", "UPDATE", "DELETE",
	"CREATE", "DROP", "REFERENCES", "INDEX",
	"ALTER", "CREATE TEMPORARY TABLES", "LOCK TABLES",
	"EXECUTE", "CREATE VIEW", "SHOW VIEW",
	"CREATE ROUTINE", "ALTER ROUTINE", "EVENT", "TRIGGER"}
View Source
var MYSQL_DEFAULT_ACCOUNT_HOST = "%"

default to all host

View Source
var MYSQL_ROLE_MAP = map[int64]string{
	1: "master",
	2: "ro",
	3: "dr",
}
View Source
var MYSQL_SUPPORTS_ENGINE = []string{"5.5", "5.6", "5.7"}
View Source
var REDIS_NAMES = map[int64]string{
	REDIS_VERSION_MASTER_SLAVE_REDIS: "master_slave_redis",
	REDIS_VERSION_MASTER_SLAVE_CKV:   "master_slave_ckv",
	REDIS_VERSION_CLUSTER_REDIS:      "cluster_redis",
	REDIS_VERSION_CLUSTER_CKV:        "cluster_ckv",
	REDIS_VERSION_STANDALONE_REDIS:   "standalone_redis",
}
View Source
var REDIS_STATUS = map[int64]string{
	REDIS_STATUS_INIT:       "init",
	REDIS_STATUS_PROCESSING: "processing",
	REDIS_STATUS_ONLINE:     "online",
	REDIS_STATUS_ISOLATE:    "isolate",
	REDIS_STATUS_TODELETE:   "todelete",
}
View Source
var REDIS_ZONE_ID2NAME = map[int64]string{
	100001: "ap-guangzhou-1",
	100002: "ap-guangzhou-2",
	100003: "ap-guangzhou-3",
	100004: "ap-guangzhou-4",
	200001: "ap-shanghai-1",
	200002: "ap-shanghai-2",
	200003: "ap-shanghai-3",
	200004: "ap-shanghai-4",
	300001: "ap-hongkong-1",
	300002: "ap-hongkong-2",
	400001: "na-toronto-1",
	700001: "ap-shanghai-fsi-1",
	700002: "ap-shanghai-fsi-2",
	800001: "ap-beijing-1",
	800002: "ap-beijing-2",
	800003: "ap-beijing-3",
	800004: "ap-beijing-4",
	900001: "ap-singapore-1",
	110001: "ap-shenzhen-fsi-1",
	110002: "ap-shenzhen-fsi-2",
	150001: "na-siliconvalley-1",
	150002: "na-siliconvalley-2",
	160001: "ap-chengdu-1",
	160002: "ap-chengdu-2",
	170001: "en-frankfurt-1",
	180001: "ap-seoul-1",
	190001: "ap-chongqing-1",
	210001: "ap-mumbai-1",
	220001: "na-ashburn-1",
	230001: "ap-bangkok-1",
	240001: "eu-moscow-1",
	250001: "ap-tokyo-1",
}

Functions

func GetLogId added in v1.5.0

func GetLogId(ctx context.Context) string

get logid for trace, return a new logid if ctx is nil

func LogElapsed added in v1.5.0

func LogElapsed(mark ...string) func()

LogElapsed log elapsed time, using in defer

func Provider

func Provider() *schema.Provider

func TencentCloudMysqlParameterDetail added in v1.5.0

func TencentCloudMysqlParameterDetail() map[string]*schema.Schema

func TencentMsyqlBasicInfo added in v1.5.0

func TencentMsyqlBasicInfo() map[string]*schema.Schema

func TencentMysqlSellType added in v1.5.0

func TencentMysqlSellType() map[string]*schema.Schema

func TencentMysqlZoneConfig added in v1.5.0

func TencentMysqlZoneConfig() map[string]*schema.Schema

Types

type AsService added in v1.8.0

type AsService struct {
	// contains filtered or unexported fields
}

func (*AsService) AttachInstances added in v1.8.0

func (me *AsService) AttachInstances(ctx context.Context, scalingGroupId string, instanceIds []string) error

func (*AsService) ClearScalingGroupInstance added in v1.8.0

func (me *AsService) ClearScalingGroupInstance(ctx context.Context, scalingGroupId string) error

set the scaling group desired capacity to 0

func (*AsService) DeleteLaunchConfiguration added in v1.8.0

func (me *AsService) DeleteLaunchConfiguration(ctx context.Context, configurationId string) error

func (*AsService) DeleteLifecycleHook added in v1.8.0

func (me *AsService) DeleteLifecycleHook(ctx context.Context, lifecycleHookId string) error

func (*AsService) DeleteNotification added in v1.8.0

func (me *AsService) DeleteNotification(ctx context.Context, notificationId string) error

func (*AsService) DeleteScalingGroup added in v1.8.0

func (me *AsService) DeleteScalingGroup(ctx context.Context, scalingGroupId string) error

func (*AsService) DeleteScalingPolicy added in v1.8.0

func (me *AsService) DeleteScalingPolicy(ctx context.Context, scalingPolicyId string) error

func (*AsService) DeleteScheduledAction added in v1.8.0

func (me *AsService) DeleteScheduledAction(ctx context.Context, scheduledActonId string) error

func (*AsService) DescribeActivityById added in v1.8.0

func (me *AsService) DescribeActivityById(ctx context.Context, activityId string) (status string, errRet error)

func (*AsService) DescribeAutoScalingAttachment added in v1.8.0

func (me *AsService) DescribeAutoScalingAttachment(ctx context.Context, scalingGroupId string) (instanceIds []string, errRet error)

func (*AsService) DescribeAutoScalingGroupByFilter added in v1.8.0

func (me *AsService) DescribeAutoScalingGroupByFilter(ctx context.Context, scalingGroupId, configurationId, scalingGroupName string) (scalingGroups []*as.AutoScalingGroup, errRet error)

func (*AsService) DescribeAutoScalingGroupById added in v1.8.0

func (me *AsService) DescribeAutoScalingGroupById(ctx context.Context, scalingGroupId string) (scalingGroup *as.AutoScalingGroup, errRet error)

func (*AsService) DescribeLaunchConfigurationByFilter added in v1.8.0

func (me *AsService) DescribeLaunchConfigurationByFilter(ctx context.Context, configurationId, configurationName string) (configs []*as.LaunchConfiguration, errRet error)

func (*AsService) DescribeLaunchConfigurationById added in v1.8.0

func (me *AsService) DescribeLaunchConfigurationById(ctx context.Context, configurationId string) (config *as.LaunchConfiguration, errRet error)

func (*AsService) DescribeLifecycleHookById added in v1.8.0

func (me *AsService) DescribeLifecycleHookById(ctx context.Context, lifecycleHookId string) (lifecycleHook *as.LifecycleHook, errRet error)

func (*AsService) DescribeNotificationById added in v1.8.0

func (me *AsService) DescribeNotificationById(ctx context.Context, notificationId string) (notification *as.AutoScalingNotification, errRet error)

func (*AsService) DescribeScalingPolicyByFilter added in v1.8.0

func (me *AsService) DescribeScalingPolicyByFilter(ctx context.Context, policyId, policyName, scalingGroupId string) (scalingPolicies []*as.ScalingPolicy, errRet error)

func (*AsService) DescribeScalingPolicyById added in v1.8.0

func (me *AsService) DescribeScalingPolicyById(ctx context.Context, scalingPolicyId string) (scalingPolicy *as.ScalingPolicy, errRet error)

func (*AsService) DescribeScheduledActionById added in v1.8.0

func (me *AsService) DescribeScheduledActionById(ctx context.Context, scheduledActionId string) (scheduledAction *as.ScheduledAction, errRet error)

func (*AsService) DetachInstances added in v1.8.0

func (me *AsService) DetachInstances(ctx context.Context, scalingGroupId string, instanceIds []string) error

type Config

type Config struct {
	SecretId  string
	SecretKey string
	Region    string
}

func (*Config) Client

func (c *Config) Client() (interface{}, error)

type CosService added in v1.6.0

type CosService struct {
	// contains filtered or unexported fields
}

func (*CosService) DeleteBucket added in v1.6.0

func (me *CosService) DeleteBucket(ctx context.Context, bucket string) (errRet error)

func (*CosService) DeleteObject added in v1.6.0

func (me *CosService) DeleteObject(ctx context.Context, bucket, key string) (errRet error)

func (*CosService) GetBucketCors added in v1.6.0

func (me *CosService) GetBucketCors(ctx context.Context, bucket string) (corsRules []map[string]interface{}, errRet error)

func (*CosService) GetBucketLifecycle added in v1.6.0

func (me *CosService) GetBucketLifecycle(ctx context.Context, bucket string) (lifecycleRules []map[string]interface{}, errRet error)

func (*CosService) GetBucketWebsite added in v1.6.0

func (me *CosService) GetBucketWebsite(ctx context.Context, bucket string) (websites []map[string]interface{}, errRet error)

func (*CosService) GetDataSourceBucketLifecycle added in v1.6.0

func (me *CosService) GetDataSourceBucketLifecycle(ctx context.Context, bucket string) (lifecycleRules []map[string]interface{}, errRet error)

func (*CosService) HeadBucket added in v1.6.0

func (me *CosService) HeadBucket(ctx context.Context, bucket string) (errRet error)

func (*CosService) HeadObject added in v1.6.0

func (me *CosService) HeadObject(ctx context.Context, bucket, key string) (info *s3.HeadObjectOutput, errRet error)

func (*CosService) ListBuckets added in v1.6.0

func (me *CosService) ListBuckets(ctx context.Context) (buckets []*s3.Bucket, errRet error)

func (*CosService) ListObjects added in v1.6.0

func (me *CosService) ListObjects(ctx context.Context, bucket string) (objects []*s3.Object, errRet error)

func (*CosService) PutBucket added in v1.6.0

func (me *CosService) PutBucket(ctx context.Context, bucket, acl string) (errRet error)

func (*CosService) PutObjectAcl added in v1.6.0

func (me *CosService) PutObjectAcl(ctx context.Context, bucket, key, acl string) (errRet error)

type MysqlService added in v1.5.0

type MysqlService struct {
	// contains filtered or unexported fields
}

func (*MysqlService) CheckDBGTIDOpen added in v1.5.0

func (me *MysqlService) CheckDBGTIDOpen(ctx context.Context, mysqlId string) (open int64, errRet error)

func (*MysqlService) CloseWanService added in v1.5.0

func (me *MysqlService) CloseWanService(ctx context.Context, mysqlId string) (asyncRequestId string, errRet error)

func (*MysqlService) CreateAccount added in v1.5.0

func (me *MysqlService) CreateAccount(ctx context.Context, mysqlId string,
	accountName, accountPassword, accountDescription string) (asyncRequestId string, errRet error)

func (*MysqlService) CreateBackup added in v1.5.0

func (me *MysqlService) CreateBackup(ctx context.Context, mysqlId string) (backupId int64, errRet error)

func (*MysqlService) DeleteAccount added in v1.5.0

func (me *MysqlService) DeleteAccount(ctx context.Context, mysqlId string,
	accountName string) (asyncRequestId string, errRet error)

func (*MysqlService) DescribeAccountPrivileges added in v1.5.0

func (me *MysqlService) DescribeAccountPrivileges(ctx context.Context, mysqlId string,
	accountName string, databaseNames []string) (privileges []string, errRet error)

func (*MysqlService) DescribeAccounts added in v1.5.0

func (me *MysqlService) DescribeAccounts(ctx context.Context, mysqlId string) (accountInfos []*cdb.AccountInfo, errRet error)

func (*MysqlService) DescribeAsyncRequestInfo added in v1.5.0

func (me *MysqlService) DescribeAsyncRequestInfo(ctx context.Context, asyncRequestId string) (status, message string, errRet error)

func (*MysqlService) DescribeBackupConfigByMysqlId added in v1.5.0

func (me *MysqlService) DescribeBackupConfigByMysqlId(ctx context.Context, mysqlId string) (desResponse *cdb.DescribeBackupConfigResponse, errRet error)

func (*MysqlService) DescribeBackupsByMysqlId added in v1.5.0

func (me *MysqlService) DescribeBackupsByMysqlId(ctx context.Context,
	mysqlId string,
	leftNumber int64) (backupInfos []*cdb.BackupInfo, errRet error)

func (*MysqlService) DescribeCaresParameters added in v1.5.0

func (me *MysqlService) DescribeCaresParameters(ctx context.Context, instanceId string, cares []string) (caresKv map[string]interface{}, errRet error)

func (*MysqlService) DescribeDBInstanceById added in v1.5.0

func (me *MysqlService) DescribeDBInstanceById(ctx context.Context, mysqlId string) (mysqlInfo *cdb.InstanceInfo, errRet error)

func (*MysqlService) DescribeDBInstanceConfig added in v1.5.0

func (me *MysqlService) DescribeDBInstanceConfig(ctx context.Context, mysqlId string) (backupConfig *cdb.DescribeDBInstanceConfigResponse,
	errRet error)

func (*MysqlService) DescribeDBSecurityGroups added in v1.5.0

func (me *MysqlService) DescribeDBSecurityGroups(ctx context.Context, mysqlId string) (securityGroups []string, errRet error)

func (*MysqlService) DescribeDBZoneConfig added in v1.5.0

func (me *MysqlService) DescribeDBZoneConfig(ctx context.Context) (sellConfigures []*cdb.RegionSellConf, errRet error)

func (*MysqlService) DescribeDefaultParameters added in v1.5.0

func (me *MysqlService) DescribeDefaultParameters(ctx context.Context, engineVersion string) (parameterList []*cdb.ParameterDetail, errRet error)

func (*MysqlService) DescribeInstanceParameters added in v1.5.0

func (me *MysqlService) DescribeInstanceParameters(ctx context.Context, instanceId string) (parameterList []*cdb.ParameterDetail, errRet error)

func (*MysqlService) DescribeRunningDBInstanceById added in v1.5.0

func (me *MysqlService) DescribeRunningDBInstanceById(ctx context.Context, mysqlId string) (mysqlInfo *cdb.InstanceInfo, errRet error)

func (*MysqlService) DescribeTagsOfInstanceId added in v1.5.0

func (me *MysqlService) DescribeTagsOfInstanceId(ctx context.Context, mysqlId string) (tags map[string]string, errRet error)

func (*MysqlService) DisassociateSecurityGroup added in v1.5.0

func (me *MysqlService) DisassociateSecurityGroup(ctx context.Context, mysqlId string, securityGroup string) (errRet error)

func (*MysqlService) InitDBInstances added in v1.5.0

func (me *MysqlService) InitDBInstances(ctx context.Context, mysqlId string, password string) (asyncRequestId string, errRet error)

func (*MysqlService) IsolateDBInstance added in v1.5.0

func (me *MysqlService) IsolateDBInstance(ctx context.Context, mysqlId string) (asyncRequestId string, errRet error)

func (*MysqlService) ModifyAccountDescription added in v1.5.0

func (me *MysqlService) ModifyAccountDescription(ctx context.Context, mysqlId string,
	accountName, accountDescription string) (asyncRequestId string, errRet error)

func (*MysqlService) ModifyAccountPassword added in v1.5.0

func (me *MysqlService) ModifyAccountPassword(ctx context.Context, mysqlId string,
	accountName, accountPassword string) (asyncRequestId string, errRet error)

func (*MysqlService) ModifyAccountPrivileges added in v1.5.0

func (me *MysqlService) ModifyAccountPrivileges(ctx context.Context, mysqlId string,
	accountName string, databaseNames []string, privileges []string) (asyncRequestId string, errRet error)

func (*MysqlService) ModifyAutoRenewFlag added in v1.5.0

func (me *MysqlService) ModifyAutoRenewFlag(ctx context.Context, mysqlId string, newRenewFlag int64) (errRet error)

func (*MysqlService) ModifyBackupConfigByMysqlId added in v1.5.0

func (me *MysqlService) ModifyBackupConfigByMysqlId(ctx context.Context, mysqlId string,
	retentionPeriod int64, backupModel, backupTime string) (errRet error)

func (*MysqlService) ModifyDBInstanceName added in v1.5.0

func (me *MysqlService) ModifyDBInstanceName(ctx context.Context, mysqlId,
	newInstanceName string) (errRet error)

func (*MysqlService) ModifyDBInstanceProject added in v1.5.0

func (me *MysqlService) ModifyDBInstanceProject(ctx context.Context, mysqlId string, newProjectId int64) (errRet error)

func (*MysqlService) ModifyDBInstanceSecurityGroups added in v1.5.0

func (me *MysqlService) ModifyDBInstanceSecurityGroups(ctx context.Context, mysqlId string, securityGroups []string) (errRet error)

func (*MysqlService) ModifyDBInstanceVipVport added in v1.5.0

func (me *MysqlService) ModifyDBInstanceVipVport(ctx context.Context, mysqlId, vpcId, subnetId string, port int64) (errRet error)

func (*MysqlService) ModifyInstanceParam added in v1.5.0

func (me *MysqlService) ModifyInstanceParam(ctx context.Context, instanceId string, params map[string]string) (asyncRequestId string, errRet error)

func (*MysqlService) ModifyInstanceTag added in v1.5.0

func (me *MysqlService) ModifyInstanceTag(ctx context.Context, mysqlId string, deleteTags, modifyTags map[string]string) (errRet error)

func (*MysqlService) NotFoundMysqlInstance added in v1.5.0

func (me *MysqlService) NotFoundMysqlInstance(err error) bool

check if the err means the mysql_id is not found

func (*MysqlService) OpenDBInstanceGTID added in v1.5.0

func (me *MysqlService) OpenDBInstanceGTID(ctx context.Context, mysqlId string) (asyncRequestId string, errRet error)

func (*MysqlService) OpenWanService added in v1.5.0

func (me *MysqlService) OpenWanService(ctx context.Context, mysqlId string) (asyncRequestId string, errRet error)

func (*MysqlService) UpgradeDBInstance added in v1.5.0

func (me *MysqlService) UpgradeDBInstance(ctx context.Context, mysqlId string,
	memSize, volumeSize int64) (asyncRequestId string, errRet error)

type RedisService added in v1.7.0

type RedisService struct {
	// contains filtered or unexported fields
}

func (*RedisService) CheckRedisCreateOk added in v1.7.0

func (me *RedisService) CheckRedisCreateOk(ctx context.Context, redisId string) (has bool,
	online bool,
	info *redis.InstanceSet,
	errRet error)

func (*RedisService) CreateInstances added in v1.7.0

func (me *RedisService) CreateInstances(ctx context.Context,
	zoneName, typeId, password, vpcId, subnetId, redisName string,
	memSize, projectId, port int64,
	securityGroups []string) (dealId string, errRet error)

func (*RedisService) DescribeAutoBackupConfig added in v1.7.0

func (me *RedisService) DescribeAutoBackupConfig(ctx context.Context, redisId string) (weekDays []string, timePeriod string, errRet error)

func (*RedisService) DescribeInstanceDealDetail added in v1.7.0

func (me *RedisService) DescribeInstanceDealDetail(ctx context.Context, dealId string) (done bool, redisId string, errRet error)

func (*RedisService) DescribeInstanceSecurityGroup added in v1.7.0

func (me *RedisService) DescribeInstanceSecurityGroup(ctx context.Context, redisId string) (sg []string, errRet error)

func (*RedisService) DescribeInstances added in v1.7.0

func (me *RedisService) DescribeInstances(ctx context.Context, zoneName, searchKey string,
	projectId, needLimit int64) (instances []TencentCloudRedisDetail, errRet error)

func (*RedisService) DescribeRedisZoneConfig added in v1.7.0

func (me *RedisService) DescribeRedisZoneConfig(ctx context.Context) (sellConfigures []*redis.RegionConf, errRet error)

func (*RedisService) DescribeTaskInfo added in v1.7.0

func (me *RedisService) DescribeTaskInfo(ctx context.Context, redisId string, taskId int64) (ok bool, errRet error)

func (*RedisService) DestroyPostpaidInstance added in v1.7.0

func (me *RedisService) DestroyPostpaidInstance(ctx context.Context, redisId string) (taskId int64, errRet error)

func (*RedisService) ModifyAutoBackupConfig added in v1.7.0

func (me *RedisService) ModifyAutoBackupConfig(ctx context.Context, redisId string, weekDays []string, timePeriod string) (errRet error)

func (*RedisService) ModifyInstanceName added in v1.7.0

func (me *RedisService) ModifyInstanceName(ctx context.Context, redisId string, name string) (errRet error)

func (*RedisService) ModifyInstanceProjectId added in v1.7.0

func (me *RedisService) ModifyInstanceProjectId(ctx context.Context, redisId string, projectId int64) (errRet error)

func (*RedisService) ResetPassword added in v1.7.0

func (me *RedisService) ResetPassword(ctx context.Context, redisId string, newPassword string) (taskId int64, errRet error)

func (*RedisService) UpgradeInstance added in v1.7.0

func (me *RedisService) UpgradeInstance(ctx context.Context, redisId string, newMemSize int64) (dealId string, errRet error)

type TencentCloudClient

type TencentCloudClient struct {
	// contains filtered or unexported fields
}

func (*TencentCloudClient) DescribeDnat

func (client *TencentCloudClient) DescribeDnat(entry *vpc.DnaptRule) (response *vpc.DnaptRule, err error)

func (*TencentCloudClient) PollingVpcBillResult

func (client *TencentCloudClient) PollingVpcBillResult(billId *string) (status bool, err error)

func (*TencentCloudClient) PollingVpcTaskResult

func (client *TencentCloudClient) PollingVpcTaskResult(taskId *int) (status bool, err error)

type TencentCloudRedisDetail added in v1.7.0

type TencentCloudRedisDetail struct {
	RedisId    string
	Name       string
	Zone       string
	ProjectId  int64
	Type       string
	MemSize    int64
	Status     string
	VpcId      string
	SubnetId   string
	Ip         string
	Port       int64
	CreateTime string
}

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL