Provides a resource to create a CynosDB cluster slave zone.
NOTE: If you use resource
tencentcloud.CynosdbClusterSlaveZoneto configureslave_zonefortencentcloud.CynosdbCluster, then you cannot simultaneously set theslave_zonefield of resourcetencentcloud.CynosdbCluster.
Example Usage
Set a new slave zone for a cynosdb cluster
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.CynosdbCluster("example", {
availableZone: "ap-guangzhou-6",
vpcId: "vpc-i5yyodl9",
subnetId: "subnet-hhi88a58",
dbMode: "NORMAL",
dbType: "MYSQL",
dbVersion: "5.7",
port: 3306,
clusterName: "tf-example",
password: "CynosDB@123",
instanceMaintainDuration: 7200,
instanceMaintainStartTime: 10800,
instanceCpuCore: 2,
instanceMemorySize: 4,
forceDelete: true,
instanceMaintainWeekdays: [
"Fri",
"Mon",
"Sat",
"Sun",
"Thu",
"Wed",
"Tue",
],
paramItems: [
{
name: "character_set_server",
currentValue: "utf8mb4",
},
{
name: "lower_case_table_names",
currentValue: "0",
},
],
tags: {
createBy: "Terraform",
},
});
const exampleCynosdbClusterSlaveZone = new tencentcloud.CynosdbClusterSlaveZone("example", {
clusterId: example.cynosdbClusterId,
slaveZone: "ap-guangzhou-7",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.CynosdbCluster("example",
available_zone="ap-guangzhou-6",
vpc_id="vpc-i5yyodl9",
subnet_id="subnet-hhi88a58",
db_mode="NORMAL",
db_type="MYSQL",
db_version="5.7",
port=3306,
cluster_name="tf-example",
password="CynosDB@123",
instance_maintain_duration=7200,
instance_maintain_start_time=10800,
instance_cpu_core=2,
instance_memory_size=4,
force_delete=True,
instance_maintain_weekdays=[
"Fri",
"Mon",
"Sat",
"Sun",
"Thu",
"Wed",
"Tue",
],
param_items=[
{
"name": "character_set_server",
"current_value": "utf8mb4",
},
{
"name": "lower_case_table_names",
"current_value": "0",
},
],
tags={
"createBy": "Terraform",
})
example_cynosdb_cluster_slave_zone = tencentcloud.CynosdbClusterSlaveZone("example",
cluster_id=example.cynosdb_cluster_id,
slave_zone="ap-guangzhou-7")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := tencentcloud.NewCynosdbCluster(ctx, "example", &tencentcloud.CynosdbClusterArgs{
AvailableZone: pulumi.String("ap-guangzhou-6"),
VpcId: pulumi.String("vpc-i5yyodl9"),
SubnetId: pulumi.String("subnet-hhi88a58"),
DbMode: pulumi.String("NORMAL"),
DbType: pulumi.String("MYSQL"),
DbVersion: pulumi.String("5.7"),
Port: pulumi.Float64(3306),
ClusterName: pulumi.String("tf-example"),
Password: pulumi.String("CynosDB@123"),
InstanceMaintainDuration: pulumi.Float64(7200),
InstanceMaintainStartTime: pulumi.Float64(10800),
InstanceCpuCore: pulumi.Float64(2),
InstanceMemorySize: pulumi.Float64(4),
ForceDelete: pulumi.Bool(true),
InstanceMaintainWeekdays: pulumi.StringArray{
pulumi.String("Fri"),
pulumi.String("Mon"),
pulumi.String("Sat"),
pulumi.String("Sun"),
pulumi.String("Thu"),
pulumi.String("Wed"),
pulumi.String("Tue"),
},
ParamItems: tencentcloud.CynosdbClusterParamItemArray{
&tencentcloud.CynosdbClusterParamItemArgs{
Name: pulumi.String("character_set_server"),
CurrentValue: pulumi.String("utf8mb4"),
},
&tencentcloud.CynosdbClusterParamItemArgs{
Name: pulumi.String("lower_case_table_names"),
CurrentValue: pulumi.String("0"),
},
},
Tags: pulumi.StringMap{
"createBy": pulumi.String("Terraform"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewCynosdbClusterSlaveZone(ctx, "example", &tencentcloud.CynosdbClusterSlaveZoneArgs{
ClusterId: example.CynosdbClusterId,
SlaveZone: pulumi.String("ap-guangzhou-7"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.CynosdbCluster("example", new()
{
AvailableZone = "ap-guangzhou-6",
VpcId = "vpc-i5yyodl9",
SubnetId = "subnet-hhi88a58",
DbMode = "NORMAL",
DbType = "MYSQL",
DbVersion = "5.7",
Port = 3306,
ClusterName = "tf-example",
Password = "CynosDB@123",
InstanceMaintainDuration = 7200,
InstanceMaintainStartTime = 10800,
InstanceCpuCore = 2,
InstanceMemorySize = 4,
ForceDelete = true,
InstanceMaintainWeekdays = new[]
{
"Fri",
"Mon",
"Sat",
"Sun",
"Thu",
"Wed",
"Tue",
},
ParamItems = new[]
{
new Tencentcloud.Inputs.CynosdbClusterParamItemArgs
{
Name = "character_set_server",
CurrentValue = "utf8mb4",
},
new Tencentcloud.Inputs.CynosdbClusterParamItemArgs
{
Name = "lower_case_table_names",
CurrentValue = "0",
},
},
Tags =
{
{ "createBy", "Terraform" },
},
});
var exampleCynosdbClusterSlaveZone = new Tencentcloud.CynosdbClusterSlaveZone("example", new()
{
ClusterId = example.CynosdbClusterId,
SlaveZone = "ap-guangzhou-7",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.CynosdbCluster;
import com.pulumi.tencentcloud.CynosdbClusterArgs;
import com.pulumi.tencentcloud.inputs.CynosdbClusterParamItemArgs;
import com.pulumi.tencentcloud.CynosdbClusterSlaveZone;
import com.pulumi.tencentcloud.CynosdbClusterSlaveZoneArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CynosdbCluster("example", CynosdbClusterArgs.builder()
.availableZone("ap-guangzhou-6")
.vpcId("vpc-i5yyodl9")
.subnetId("subnet-hhi88a58")
.dbMode("NORMAL")
.dbType("MYSQL")
.dbVersion("5.7")
.port(3306.0)
.clusterName("tf-example")
.password("CynosDB@123")
.instanceMaintainDuration(7200.0)
.instanceMaintainStartTime(10800.0)
.instanceCpuCore(2.0)
.instanceMemorySize(4.0)
.forceDelete(true)
.instanceMaintainWeekdays(
"Fri",
"Mon",
"Sat",
"Sun",
"Thu",
"Wed",
"Tue")
.paramItems(
CynosdbClusterParamItemArgs.builder()
.name("character_set_server")
.currentValue("utf8mb4")
.build(),
CynosdbClusterParamItemArgs.builder()
.name("lower_case_table_names")
.currentValue("0")
.build())
.tags(Map.of("createBy", "Terraform"))
.build());
var exampleCynosdbClusterSlaveZone = new CynosdbClusterSlaveZone("exampleCynosdbClusterSlaveZone", CynosdbClusterSlaveZoneArgs.builder()
.clusterId(example.cynosdbClusterId())
.slaveZone("ap-guangzhou-7")
.build());
}
}
resources:
example:
type: tencentcloud:CynosdbCluster
properties:
availableZone: ap-guangzhou-6
vpcId: vpc-i5yyodl9
subnetId: subnet-hhi88a58
dbMode: NORMAL
dbType: MYSQL
dbVersion: '5.7'
port: 3306
clusterName: tf-example
password: CynosDB@123
instanceMaintainDuration: 7200
instanceMaintainStartTime: 10800
instanceCpuCore: 2
instanceMemorySize: 4
forceDelete: true
instanceMaintainWeekdays:
- Fri
- Mon
- Sat
- Sun
- Thu
- Wed
- Tue
paramItems:
- name: character_set_server
currentValue: utf8mb4
- name: lower_case_table_names
currentValue: '0'
tags:
createBy: Terraform
exampleCynosdbClusterSlaveZone:
type: tencentcloud:CynosdbClusterSlaveZone
name: example
properties:
clusterId: ${example.cynosdbClusterId}
slaveZone: ap-guangzhou-7
Create CynosdbClusterSlaveZone Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CynosdbClusterSlaveZone(name: string, args: CynosdbClusterSlaveZoneArgs, opts?: CustomResourceOptions);@overload
def CynosdbClusterSlaveZone(resource_name: str,
args: CynosdbClusterSlaveZoneArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CynosdbClusterSlaveZone(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
slave_zone: Optional[str] = None,
cynosdb_cluster_slave_zone_id: Optional[str] = None,
timeouts: Optional[CynosdbClusterSlaveZoneTimeoutsArgs] = None)func NewCynosdbClusterSlaveZone(ctx *Context, name string, args CynosdbClusterSlaveZoneArgs, opts ...ResourceOption) (*CynosdbClusterSlaveZone, error)public CynosdbClusterSlaveZone(string name, CynosdbClusterSlaveZoneArgs args, CustomResourceOptions? opts = null)
public CynosdbClusterSlaveZone(String name, CynosdbClusterSlaveZoneArgs args)
public CynosdbClusterSlaveZone(String name, CynosdbClusterSlaveZoneArgs args, CustomResourceOptions options)
type: tencentcloud:CynosdbClusterSlaveZone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CynosdbClusterSlaveZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CynosdbClusterSlaveZoneArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CynosdbClusterSlaveZoneArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CynosdbClusterSlaveZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CynosdbClusterSlaveZoneArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CynosdbClusterSlaveZone Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CynosdbClusterSlaveZone resource accepts the following input properties:
- Cluster
Id string - The ID of cluster.
- Slave
Zone string - Slave zone.
- Cynosdb
Cluster stringSlave Zone Id - ID of the resource.
- Timeouts
Cynosdb
Cluster Slave Zone Timeouts
- Cluster
Id string - The ID of cluster.
- Slave
Zone string - Slave zone.
- Cynosdb
Cluster stringSlave Zone Id - ID of the resource.
- Timeouts
Cynosdb
Cluster Slave Zone Timeouts Args
- cluster
Id String - The ID of cluster.
- slave
Zone String - Slave zone.
- cynosdb
Cluster StringSlave Zone Id - ID of the resource.
- timeouts
Cynosdb
Cluster Slave Zone Timeouts
- cluster
Id string - The ID of cluster.
- slave
Zone string - Slave zone.
- cynosdb
Cluster stringSlave Zone Id - ID of the resource.
- timeouts
Cynosdb
Cluster Slave Zone Timeouts
- cluster_
id str - The ID of cluster.
- slave_
zone str - Slave zone.
- cynosdb_
cluster_ strslave_ zone_ id - ID of the resource.
- timeouts
Cynosdb
Cluster Slave Zone Timeouts Args
- cluster
Id String - The ID of cluster.
- slave
Zone String - Slave zone.
- cynosdb
Cluster StringSlave Zone Id - ID of the resource.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the CynosdbClusterSlaveZone resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CynosdbClusterSlaveZone Resource
Get an existing CynosdbClusterSlaveZone resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CynosdbClusterSlaveZoneState, opts?: CustomResourceOptions): CynosdbClusterSlaveZone@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
cynosdb_cluster_slave_zone_id: Optional[str] = None,
slave_zone: Optional[str] = None,
timeouts: Optional[CynosdbClusterSlaveZoneTimeoutsArgs] = None) -> CynosdbClusterSlaveZonefunc GetCynosdbClusterSlaveZone(ctx *Context, name string, id IDInput, state *CynosdbClusterSlaveZoneState, opts ...ResourceOption) (*CynosdbClusterSlaveZone, error)public static CynosdbClusterSlaveZone Get(string name, Input<string> id, CynosdbClusterSlaveZoneState? state, CustomResourceOptions? opts = null)public static CynosdbClusterSlaveZone get(String name, Output<String> id, CynosdbClusterSlaveZoneState state, CustomResourceOptions options)resources: _: type: tencentcloud:CynosdbClusterSlaveZone get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Cluster
Id string - The ID of cluster.
- Cynosdb
Cluster stringSlave Zone Id - ID of the resource.
- Slave
Zone string - Slave zone.
- Timeouts
Cynosdb
Cluster Slave Zone Timeouts
- Cluster
Id string - The ID of cluster.
- Cynosdb
Cluster stringSlave Zone Id - ID of the resource.
- Slave
Zone string - Slave zone.
- Timeouts
Cynosdb
Cluster Slave Zone Timeouts Args
- cluster
Id String - The ID of cluster.
- cynosdb
Cluster StringSlave Zone Id - ID of the resource.
- slave
Zone String - Slave zone.
- timeouts
Cynosdb
Cluster Slave Zone Timeouts
- cluster
Id string - The ID of cluster.
- cynosdb
Cluster stringSlave Zone Id - ID of the resource.
- slave
Zone string - Slave zone.
- timeouts
Cynosdb
Cluster Slave Zone Timeouts
- cluster_
id str - The ID of cluster.
- cynosdb_
cluster_ strslave_ zone_ id - ID of the resource.
- slave_
zone str - Slave zone.
- timeouts
Cynosdb
Cluster Slave Zone Timeouts Args
- cluster
Id String - The ID of cluster.
- cynosdb
Cluster StringSlave Zone Id - ID of the resource.
- slave
Zone String - Slave zone.
- timeouts Property Map
Supporting Types
CynosdbClusterSlaveZoneTimeouts, CynosdbClusterSlaveZoneTimeoutsArgs
Import
CynosDB cluster slave zone can be imported using the clusterId#slaveZone, e.g.
$ pulumi import tencentcloud:index/cynosdbClusterSlaveZone:CynosdbClusterSlaveZone example cynosdbmysql-g76di9j5#ap-guangzhou-7
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
