tencentcloud.MysqlRoInstanceIp
Explore with Pulumi AI
Provides a resource to create a mysql ro_instance_ip
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const zones = tencentcloud.getAvailabilityZonesByProduct({
product: "cdb",
});
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const subnet = new tencentcloud.Subnet("subnet", {
availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
vpcId: vpc.vpcId,
cidrBlock: "10.0.0.0/16",
isMulticast: false,
});
const example = new tencentcloud.MysqlRoInstanceIp("example", {
instanceId: "cdbro-bdlvcfpj",
uniqSubnetId: subnet.subnetId,
uniqVpcId: vpc.vpcId,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
zones = tencentcloud.get_availability_zones_by_product(product="cdb")
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
subnet = tencentcloud.Subnet("subnet",
availability_zone=zones.zones[0].name,
vpc_id=vpc.vpc_id,
cidr_block="10.0.0.0/16",
is_multicast=False)
example = tencentcloud.MysqlRoInstanceIp("example",
instance_id="cdbro-bdlvcfpj",
uniq_subnet_id=subnet.subnet_id,
uniq_vpc_id=vpc.vpc_id)
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 {
zones, err := tencentcloud.GetAvailabilityZonesByProduct(ctx, &tencentcloud.GetAvailabilityZonesByProductArgs{
Product: "cdb",
}, nil)
if err != nil {
return err
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
AvailabilityZone: pulumi.String(zones.Zones[0].Name),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.0.0/16"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = tencentcloud.NewMysqlRoInstanceIp(ctx, "example", &tencentcloud.MysqlRoInstanceIpArgs{
InstanceId: pulumi.String("cdbro-bdlvcfpj"),
UniqSubnetId: subnet.SubnetId,
UniqVpcId: vpc.VpcId,
})
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 zones = Tencentcloud.GetAvailabilityZonesByProduct.Invoke(new()
{
Product = "cdb",
});
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
AvailabilityZone = zones.Apply(getAvailabilityZonesByProductResult => getAvailabilityZonesByProductResult.Zones[0]?.Name),
VpcId = vpc.VpcId,
CidrBlock = "10.0.0.0/16",
IsMulticast = false,
});
var example = new Tencentcloud.MysqlRoInstanceIp("example", new()
{
InstanceId = "cdbro-bdlvcfpj",
UniqSubnetId = subnet.SubnetId,
UniqVpcId = vpc.VpcId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesByProductArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.MysqlRoInstanceIp;
import com.pulumi.tencentcloud.MysqlRoInstanceIpArgs;
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) {
final var zones = TencentcloudFunctions.getAvailabilityZonesByProduct(GetAvailabilityZonesByProductArgs.builder()
.product("cdb")
.build());
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.availabilityZone(zones.applyValue(getAvailabilityZonesByProductResult -> getAvailabilityZonesByProductResult.zones()[0].name()))
.vpcId(vpc.vpcId())
.cidrBlock("10.0.0.0/16")
.isMulticast(false)
.build());
var example = new MysqlRoInstanceIp("example", MysqlRoInstanceIpArgs.builder()
.instanceId("cdbro-bdlvcfpj")
.uniqSubnetId(subnet.subnetId())
.uniqVpcId(vpc.vpcId())
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
subnet:
type: tencentcloud:Subnet
properties:
availabilityZone: ${zones.zones[0].name}
vpcId: ${vpc.vpcId}
cidrBlock: 10.0.0.0/16
isMulticast: false
example:
type: tencentcloud:MysqlRoInstanceIp
properties:
instanceId: cdbro-bdlvcfpj
uniqSubnetId: ${subnet.subnetId}
uniqVpcId: ${vpc.vpcId}
variables:
zones:
fn::invoke:
function: tencentcloud:getAvailabilityZonesByProduct
arguments:
product: cdb
Create MysqlRoInstanceIp Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MysqlRoInstanceIp(name: string, args: MysqlRoInstanceIpArgs, opts?: CustomResourceOptions);
@overload
def MysqlRoInstanceIp(resource_name: str,
args: MysqlRoInstanceIpArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MysqlRoInstanceIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
mysql_ro_instance_ip_id: Optional[str] = None,
uniq_subnet_id: Optional[str] = None,
uniq_vpc_id: Optional[str] = None)
func NewMysqlRoInstanceIp(ctx *Context, name string, args MysqlRoInstanceIpArgs, opts ...ResourceOption) (*MysqlRoInstanceIp, error)
public MysqlRoInstanceIp(string name, MysqlRoInstanceIpArgs args, CustomResourceOptions? opts = null)
public MysqlRoInstanceIp(String name, MysqlRoInstanceIpArgs args)
public MysqlRoInstanceIp(String name, MysqlRoInstanceIpArgs args, CustomResourceOptions options)
type: tencentcloud:MysqlRoInstanceIp
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 MysqlRoInstanceIpArgs
- 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 MysqlRoInstanceIpArgs
- 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 MysqlRoInstanceIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MysqlRoInstanceIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MysqlRoInstanceIpArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
MysqlRoInstanceIp 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 MysqlRoInstanceIp resource accepts the following input properties:
- Instance
Id string - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- Mysql
Ro stringInstance Ip Id - ID of the resource.
- Uniq
Subnet stringId - Subnet descriptor, for example: subnet-1typ0s7d.
- Uniq
Vpc stringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- Instance
Id string - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- Mysql
Ro stringInstance Ip Id - ID of the resource.
- Uniq
Subnet stringId - Subnet descriptor, for example: subnet-1typ0s7d.
- Uniq
Vpc stringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance
Id String - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql
Ro StringInstance Ip Id - ID of the resource.
- uniq
Subnet StringId - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq
Vpc StringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance
Id string - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql
Ro stringInstance Ip Id - ID of the resource.
- uniq
Subnet stringId - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq
Vpc stringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance_
id str - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql_
ro_ strinstance_ ip_ id - ID of the resource.
- uniq_
subnet_ strid - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq_
vpc_ strid - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance
Id String - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql
Ro StringInstance Ip Id - ID of the resource.
- uniq
Subnet StringId - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq
Vpc StringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
Outputs
All input properties are implicitly available as output properties. Additionally, the MysqlRoInstanceIp resource produces the following output properties:
Look up Existing MysqlRoInstanceIp Resource
Get an existing MysqlRoInstanceIp 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?: MysqlRoInstanceIpState, opts?: CustomResourceOptions): MysqlRoInstanceIp
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
mysql_ro_instance_ip_id: Optional[str] = None,
ro_vip: Optional[str] = None,
ro_vport: Optional[float] = None,
uniq_subnet_id: Optional[str] = None,
uniq_vpc_id: Optional[str] = None) -> MysqlRoInstanceIp
func GetMysqlRoInstanceIp(ctx *Context, name string, id IDInput, state *MysqlRoInstanceIpState, opts ...ResourceOption) (*MysqlRoInstanceIp, error)
public static MysqlRoInstanceIp Get(string name, Input<string> id, MysqlRoInstanceIpState? state, CustomResourceOptions? opts = null)
public static MysqlRoInstanceIp get(String name, Output<String> id, MysqlRoInstanceIpState state, CustomResourceOptions options)
resources: _: type: tencentcloud:MysqlRoInstanceIp 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.
- Instance
Id string - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- Mysql
Ro stringInstance Ip Id - ID of the resource.
- Ro
Vip string - Intranet IP address of the read-only instance.
- Ro
Vport double - Intranet port number of the read-only instance.
- Uniq
Subnet stringId - Subnet descriptor, for example: subnet-1typ0s7d.
- Uniq
Vpc stringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- Instance
Id string - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- Mysql
Ro stringInstance Ip Id - ID of the resource.
- Ro
Vip string - Intranet IP address of the read-only instance.
- Ro
Vport float64 - Intranet port number of the read-only instance.
- Uniq
Subnet stringId - Subnet descriptor, for example: subnet-1typ0s7d.
- Uniq
Vpc stringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance
Id String - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql
Ro StringInstance Ip Id - ID of the resource.
- ro
Vip String - Intranet IP address of the read-only instance.
- ro
Vport Double - Intranet port number of the read-only instance.
- uniq
Subnet StringId - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq
Vpc StringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance
Id string - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql
Ro stringInstance Ip Id - ID of the resource.
- ro
Vip string - Intranet IP address of the read-only instance.
- ro
Vport number - Intranet port number of the read-only instance.
- uniq
Subnet stringId - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq
Vpc stringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance_
id str - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql_
ro_ strinstance_ ip_ id - ID of the resource.
- ro_
vip str - Intranet IP address of the read-only instance.
- ro_
vport float - Intranet port number of the read-only instance.
- uniq_
subnet_ strid - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq_
vpc_ strid - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
- instance
Id String - Read-only instance ID, in the format: cdbro-3i70uj0k, which is the same as the read-only instance ID displayed on the cloud database console page.
- mysql
Ro StringInstance Ip Id - ID of the resource.
- ro
Vip String - Intranet IP address of the read-only instance.
- ro
Vport Number - Intranet port number of the read-only instance.
- uniq
Subnet StringId - Subnet descriptor, for example: subnet-1typ0s7d.
- uniq
Vpc StringId - vpc descriptor, for example: vpc-a23yt67j, if this field is passed, UniqSubnetId must be passed.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.