1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. rds
  5. DbInstanceEndpoint
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.rds.DbInstanceEndpoint

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provide RDS cluster instance endpoint connection resources, see What is RDS DB Instance Endpoint.

    NOTE: Available since v1.203.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const defaultZones = alicloud.rds.getZones({
        engine: "MySQL",
        engineVersion: "8.0",
        instanceChargeType: "PostPaid",
        category: "cluster",
        dbInstanceStorageType: "cloud_essd",
    });
    const defaultInstanceClasses = defaultZones.then(defaultZones => alicloud.rds.getInstanceClasses({
        zoneId: defaultZones.ids?.[0],
        engine: "MySQL",
        engineVersion: "8.0",
        category: "cluster",
        dbInstanceStorageType: "cloud_essd",
        instanceChargeType: "PostPaid",
    }));
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: name,
        cidrBlock: "172.16.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.ids?.[0]),
        vswitchName: name,
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {vpcId: defaultNetwork.id});
    const defaultInstance = new alicloud.rds.Instance("defaultInstance", {
        engine: "MySQL",
        engineVersion: "8.0",
        instanceType: defaultInstanceClasses.then(defaultInstanceClasses => defaultInstanceClasses.instanceClasses?.[0]?.instanceClass),
        instanceStorage: defaultInstanceClasses.then(defaultInstanceClasses => defaultInstanceClasses.instanceClasses?.[0]?.storageRange?.min),
        instanceChargeType: "Postpaid",
        instanceName: name,
        vswitchId: defaultSwitch.id,
        monitoringPeriod: 60,
        dbInstanceStorageType: "cloud_essd",
        securityGroupIds: [defaultSecurityGroup.id],
        zoneId: defaultZones.then(defaultZones => defaultZones.ids?.[0]),
        zoneIdSlaveA: defaultZones.then(defaultZones => defaultZones.ids?.[0]),
    });
    const defaultDbNode = new alicloud.rds.DbNode("defaultDbNode", {
        dbInstanceId: defaultInstance.id,
        classCode: defaultInstance.instanceType,
        zoneId: defaultSwitch.zoneId,
    });
    const defaultDbInstanceEndpoint = new alicloud.rds.DbInstanceEndpoint("defaultDbInstanceEndpoint", {
        dbInstanceId: defaultDbNode.dbInstanceId,
        vpcId: defaultNetwork.id,
        vswitchId: defaultInstance.vswitchId,
        connectionStringPrefix: "example",
        port: "3306",
        dbInstanceEndpointDescription: name,
        nodeItems: [{
            nodeId: defaultDbNode.nodeId,
            weight: 25,
        }],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_zones = alicloud.rds.get_zones(engine="MySQL",
        engine_version="8.0",
        instance_charge_type="PostPaid",
        category="cluster",
        db_instance_storage_type="cloud_essd")
    default_instance_classes = alicloud.rds.get_instance_classes(zone_id=default_zones.ids[0],
        engine="MySQL",
        engine_version="8.0",
        category="cluster",
        db_instance_storage_type="cloud_essd",
        instance_charge_type="PostPaid")
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=name,
        cidr_block="172.16.0.0/16")
    default_switch = alicloud.vpc.Switch("defaultSwitch",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/24",
        zone_id=default_zones.ids[0],
        vswitch_name=name)
    default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
    default_instance = alicloud.rds.Instance("defaultInstance",
        engine="MySQL",
        engine_version="8.0",
        instance_type=default_instance_classes.instance_classes[0].instance_class,
        instance_storage=default_instance_classes.instance_classes[0].storage_range.min,
        instance_charge_type="Postpaid",
        instance_name=name,
        vswitch_id=default_switch.id,
        monitoring_period=60,
        db_instance_storage_type="cloud_essd",
        security_group_ids=[default_security_group.id],
        zone_id=default_zones.ids[0],
        zone_id_slave_a=default_zones.ids[0])
    default_db_node = alicloud.rds.DbNode("defaultDbNode",
        db_instance_id=default_instance.id,
        class_code=default_instance.instance_type,
        zone_id=default_switch.zone_id)
    default_db_instance_endpoint = alicloud.rds.DbInstanceEndpoint("defaultDbInstanceEndpoint",
        db_instance_id=default_db_node.db_instance_id,
        vpc_id=default_network.id,
        vswitch_id=default_instance.vswitch_id,
        connection_string_prefix="example",
        port="3306",
        db_instance_endpoint_description=name,
        node_items=[alicloud.rds.DbInstanceEndpointNodeItemArgs(
            node_id=default_db_node.node_id,
            weight=25,
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rds"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultZones, err := rds.GetZones(ctx, &rds.GetZonesArgs{
    			Engine:                pulumi.StringRef("MySQL"),
    			EngineVersion:         pulumi.StringRef("8.0"),
    			InstanceChargeType:    pulumi.StringRef("PostPaid"),
    			Category:              pulumi.StringRef("cluster"),
    			DbInstanceStorageType: pulumi.StringRef("cloud_essd"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInstanceClasses, err := rds.GetInstanceClasses(ctx, &rds.GetInstanceClassesArgs{
    			ZoneId:                pulumi.StringRef(defaultZones.Ids[0]),
    			Engine:                pulumi.StringRef("MySQL"),
    			EngineVersion:         pulumi.StringRef("8.0"),
    			Category:              pulumi.StringRef("cluster"),
    			DbInstanceStorageType: pulumi.StringRef("cloud_essd"),
    			InstanceChargeType:    pulumi.StringRef("PostPaid"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Ids[0]),
    			VswitchName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "defaultSecurityGroup", &ecs.SecurityGroupArgs{
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultInstance, err := rds.NewInstance(ctx, "defaultInstance", &rds.InstanceArgs{
    			Engine:                pulumi.String("MySQL"),
    			EngineVersion:         pulumi.String("8.0"),
    			InstanceType:          pulumi.String(defaultInstanceClasses.InstanceClasses[0].InstanceClass),
    			InstanceStorage:       pulumi.String(defaultInstanceClasses.InstanceClasses[0].StorageRange.Min),
    			InstanceChargeType:    pulumi.String("Postpaid"),
    			InstanceName:          pulumi.String(name),
    			VswitchId:             defaultSwitch.ID(),
    			MonitoringPeriod:      pulumi.Int(60),
    			DbInstanceStorageType: pulumi.String("cloud_essd"),
    			SecurityGroupIds: pulumi.StringArray{
    				defaultSecurityGroup.ID(),
    			},
    			ZoneId:       pulumi.String(defaultZones.Ids[0]),
    			ZoneIdSlaveA: pulumi.String(defaultZones.Ids[0]),
    		})
    		if err != nil {
    			return err
    		}
    		defaultDbNode, err := rds.NewDbNode(ctx, "defaultDbNode", &rds.DbNodeArgs{
    			DbInstanceId: defaultInstance.ID(),
    			ClassCode:    defaultInstance.InstanceType,
    			ZoneId:       defaultSwitch.ZoneId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = rds.NewDbInstanceEndpoint(ctx, "defaultDbInstanceEndpoint", &rds.DbInstanceEndpointArgs{
    			DbInstanceId:                  defaultDbNode.DbInstanceId,
    			VpcId:                         defaultNetwork.ID(),
    			VswitchId:                     defaultInstance.VswitchId,
    			ConnectionStringPrefix:        pulumi.String("example"),
    			Port:                          pulumi.String("3306"),
    			DbInstanceEndpointDescription: pulumi.String(name),
    			NodeItems: rds.DbInstanceEndpointNodeItemArray{
    				&rds.DbInstanceEndpointNodeItemArgs{
    					NodeId: defaultDbNode.NodeId,
    					Weight: pulumi.Int(25),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var defaultZones = AliCloud.Rds.GetZones.Invoke(new()
        {
            Engine = "MySQL",
            EngineVersion = "8.0",
            InstanceChargeType = "PostPaid",
            Category = "cluster",
            DbInstanceStorageType = "cloud_essd",
        });
    
        var defaultInstanceClasses = AliCloud.Rds.GetInstanceClasses.Invoke(new()
        {
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
            Engine = "MySQL",
            EngineVersion = "8.0",
            Category = "cluster",
            DbInstanceStorageType = "cloud_essd",
            InstanceChargeType = "PostPaid",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = name,
            CidrBlock = "172.16.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
            VswitchName = name,
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
        {
            VpcId = defaultNetwork.Id,
        });
    
        var defaultInstance = new AliCloud.Rds.Instance("defaultInstance", new()
        {
            Engine = "MySQL",
            EngineVersion = "8.0",
            InstanceType = defaultInstanceClasses.Apply(getInstanceClassesResult => getInstanceClassesResult.InstanceClasses[0]?.InstanceClass),
            InstanceStorage = defaultInstanceClasses.Apply(getInstanceClassesResult => getInstanceClassesResult.InstanceClasses[0]?.StorageRange?.Min),
            InstanceChargeType = "Postpaid",
            InstanceName = name,
            VswitchId = defaultSwitch.Id,
            MonitoringPeriod = 60,
            DbInstanceStorageType = "cloud_essd",
            SecurityGroupIds = new[]
            {
                defaultSecurityGroup.Id,
            },
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
            ZoneIdSlaveA = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
        });
    
        var defaultDbNode = new AliCloud.Rds.DbNode("defaultDbNode", new()
        {
            DbInstanceId = defaultInstance.Id,
            ClassCode = defaultInstance.InstanceType,
            ZoneId = defaultSwitch.ZoneId,
        });
    
        var defaultDbInstanceEndpoint = new AliCloud.Rds.DbInstanceEndpoint("defaultDbInstanceEndpoint", new()
        {
            DbInstanceId = defaultDbNode.DbInstanceId,
            VpcId = defaultNetwork.Id,
            VswitchId = defaultInstance.VswitchId,
            ConnectionStringPrefix = "example",
            Port = "3306",
            DbInstanceEndpointDescription = name,
            NodeItems = new[]
            {
                new AliCloud.Rds.Inputs.DbInstanceEndpointNodeItemArgs
                {
                    NodeId = defaultDbNode.NodeId,
                    Weight = 25,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.rds.RdsFunctions;
    import com.pulumi.alicloud.rds.inputs.GetZonesArgs;
    import com.pulumi.alicloud.rds.inputs.GetInstanceClassesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.rds.Instance;
    import com.pulumi.alicloud.rds.InstanceArgs;
    import com.pulumi.alicloud.rds.DbNode;
    import com.pulumi.alicloud.rds.DbNodeArgs;
    import com.pulumi.alicloud.rds.DbInstanceEndpoint;
    import com.pulumi.alicloud.rds.DbInstanceEndpointArgs;
    import com.pulumi.alicloud.rds.inputs.DbInstanceEndpointNodeItemArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            final var defaultZones = RdsFunctions.getZones(GetZonesArgs.builder()
                .engine("MySQL")
                .engineVersion("8.0")
                .instanceChargeType("PostPaid")
                .category("cluster")
                .dbInstanceStorageType("cloud_essd")
                .build());
    
            final var defaultInstanceClasses = RdsFunctions.getInstanceClasses(GetInstanceClassesArgs.builder()
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
                .engine("MySQL")
                .engineVersion("8.0")
                .category("cluster")
                .dbInstanceStorageType("cloud_essd")
                .instanceChargeType("PostPaid")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName(name)
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
                .vswitchName(name)
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()        
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
                .engine("MySQL")
                .engineVersion("8.0")
                .instanceType(defaultInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].instanceClass()))
                .instanceStorage(defaultInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].storageRange().min()))
                .instanceChargeType("Postpaid")
                .instanceName(name)
                .vswitchId(defaultSwitch.id())
                .monitoringPeriod("60")
                .dbInstanceStorageType("cloud_essd")
                .securityGroupIds(defaultSecurityGroup.id())
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
                .zoneIdSlaveA(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
                .build());
    
            var defaultDbNode = new DbNode("defaultDbNode", DbNodeArgs.builder()        
                .dbInstanceId(defaultInstance.id())
                .classCode(defaultInstance.instanceType())
                .zoneId(defaultSwitch.zoneId())
                .build());
    
            var defaultDbInstanceEndpoint = new DbInstanceEndpoint("defaultDbInstanceEndpoint", DbInstanceEndpointArgs.builder()        
                .dbInstanceId(defaultDbNode.dbInstanceId())
                .vpcId(defaultNetwork.id())
                .vswitchId(defaultInstance.vswitchId())
                .connectionStringPrefix("example")
                .port("3306")
                .dbInstanceEndpointDescription(name)
                .nodeItems(DbInstanceEndpointNodeItemArgs.builder()
                    .nodeId(defaultDbNode.nodeId())
                    .weight(25)
                    .build())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 172.16.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/24
          zoneId: ${defaultZones.ids[0]}
          vswitchName: ${name}
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        properties:
          vpcId: ${defaultNetwork.id}
      defaultInstance:
        type: alicloud:rds:Instance
        properties:
          engine: MySQL
          engineVersion: '8.0'
          instanceType: ${defaultInstanceClasses.instanceClasses[0].instanceClass}
          instanceStorage: ${defaultInstanceClasses.instanceClasses[0].storageRange.min}
          instanceChargeType: Postpaid
          instanceName: ${name}
          vswitchId: ${defaultSwitch.id}
          monitoringPeriod: '60'
          dbInstanceStorageType: cloud_essd
          securityGroupIds:
            - ${defaultSecurityGroup.id}
          zoneId: ${defaultZones.ids[0]}
          zoneIdSlaveA: ${defaultZones.ids[0]}
      defaultDbNode:
        type: alicloud:rds:DbNode
        properties:
          dbInstanceId: ${defaultInstance.id}
          classCode: ${defaultInstance.instanceType}
          zoneId: ${defaultSwitch.zoneId}
      defaultDbInstanceEndpoint:
        type: alicloud:rds:DbInstanceEndpoint
        properties:
          dbInstanceId: ${defaultDbNode.dbInstanceId}
          vpcId: ${defaultNetwork.id}
          vswitchId: ${defaultInstance.vswitchId}
          connectionStringPrefix: example
          port: '3306'
          dbInstanceEndpointDescription: ${name}
          nodeItems:
            - nodeId: ${defaultDbNode.nodeId}
              weight: 25
    variables:
      defaultZones:
        fn::invoke:
          Function: alicloud:rds:getZones
          Arguments:
            engine: MySQL
            engineVersion: '8.0'
            instanceChargeType: PostPaid
            category: cluster
            dbInstanceStorageType: cloud_essd
      defaultInstanceClasses:
        fn::invoke:
          Function: alicloud:rds:getInstanceClasses
          Arguments:
            zoneId: ${defaultZones.ids[0]}
            engine: MySQL
            engineVersion: '8.0'
            category: cluster
            dbInstanceStorageType: cloud_essd
            instanceChargeType: PostPaid
    

    Create DbInstanceEndpoint Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DbInstanceEndpoint(name: string, args: DbInstanceEndpointArgs, opts?: CustomResourceOptions);
    @overload
    def DbInstanceEndpoint(resource_name: str,
                           args: DbInstanceEndpointArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def DbInstanceEndpoint(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           connection_string_prefix: Optional[str] = None,
                           db_instance_id: Optional[str] = None,
                           node_items: Optional[Sequence[DbInstanceEndpointNodeItemArgs]] = None,
                           port: Optional[str] = None,
                           vpc_id: Optional[str] = None,
                           vswitch_id: Optional[str] = None,
                           db_instance_endpoint_description: Optional[str] = None)
    func NewDbInstanceEndpoint(ctx *Context, name string, args DbInstanceEndpointArgs, opts ...ResourceOption) (*DbInstanceEndpoint, error)
    public DbInstanceEndpoint(string name, DbInstanceEndpointArgs args, CustomResourceOptions? opts = null)
    public DbInstanceEndpoint(String name, DbInstanceEndpointArgs args)
    public DbInstanceEndpoint(String name, DbInstanceEndpointArgs args, CustomResourceOptions options)
    
    type: alicloud:rds:DbInstanceEndpoint
    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 DbInstanceEndpointArgs
    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 DbInstanceEndpointArgs
    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 DbInstanceEndpointArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DbInstanceEndpointArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DbInstanceEndpointArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var dbInstanceEndpointResource = new AliCloud.Rds.DbInstanceEndpoint("dbInstanceEndpointResource", new()
    {
        ConnectionStringPrefix = "string",
        DbInstanceId = "string",
        NodeItems = new[]
        {
            new AliCloud.Rds.Inputs.DbInstanceEndpointNodeItemArgs
            {
                NodeId = "string",
                Weight = 0,
            },
        },
        Port = "string",
        VpcId = "string",
        VswitchId = "string",
        DbInstanceEndpointDescription = "string",
    });
    
    example, err := rds.NewDbInstanceEndpoint(ctx, "dbInstanceEndpointResource", &rds.DbInstanceEndpointArgs{
    	ConnectionStringPrefix: pulumi.String("string"),
    	DbInstanceId:           pulumi.String("string"),
    	NodeItems: rds.DbInstanceEndpointNodeItemArray{
    		&rds.DbInstanceEndpointNodeItemArgs{
    			NodeId: pulumi.String("string"),
    			Weight: pulumi.Int(0),
    		},
    	},
    	Port:                          pulumi.String("string"),
    	VpcId:                         pulumi.String("string"),
    	VswitchId:                     pulumi.String("string"),
    	DbInstanceEndpointDescription: pulumi.String("string"),
    })
    
    var dbInstanceEndpointResource = new DbInstanceEndpoint("dbInstanceEndpointResource", DbInstanceEndpointArgs.builder()        
        .connectionStringPrefix("string")
        .dbInstanceId("string")
        .nodeItems(DbInstanceEndpointNodeItemArgs.builder()
            .nodeId("string")
            .weight(0)
            .build())
        .port("string")
        .vpcId("string")
        .vswitchId("string")
        .dbInstanceEndpointDescription("string")
        .build());
    
    db_instance_endpoint_resource = alicloud.rds.DbInstanceEndpoint("dbInstanceEndpointResource",
        connection_string_prefix="string",
        db_instance_id="string",
        node_items=[alicloud.rds.DbInstanceEndpointNodeItemArgs(
            node_id="string",
            weight=0,
        )],
        port="string",
        vpc_id="string",
        vswitch_id="string",
        db_instance_endpoint_description="string")
    
    const dbInstanceEndpointResource = new alicloud.rds.DbInstanceEndpoint("dbInstanceEndpointResource", {
        connectionStringPrefix: "string",
        dbInstanceId: "string",
        nodeItems: [{
            nodeId: "string",
            weight: 0,
        }],
        port: "string",
        vpcId: "string",
        vswitchId: "string",
        dbInstanceEndpointDescription: "string",
    });
    
    type: alicloud:rds:DbInstanceEndpoint
    properties:
        connectionStringPrefix: string
        dbInstanceEndpointDescription: string
        dbInstanceId: string
        nodeItems:
            - nodeId: string
              weight: 0
        port: string
        vpcId: string
        vswitchId: string
    

    DbInstanceEndpoint Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The DbInstanceEndpoint resource accepts the following input properties:

    ConnectionStringPrefix string
    The IP address of the internal endpoint.
    DbInstanceId string
    The ID of the instance.
    NodeItems List<Pulumi.AliCloud.Rds.Inputs.DbInstanceEndpointNodeItem>
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    Port string
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    VpcId string
    The virtual private cloud (VPC) ID of the internal endpoint.
    VswitchId string
    The vSwitch ID of the internal endpoint.
    DbInstanceEndpointDescription string
    The user-defined description of the endpoint.
    ConnectionStringPrefix string
    The IP address of the internal endpoint.
    DbInstanceId string
    The ID of the instance.
    NodeItems []DbInstanceEndpointNodeItemArgs
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    Port string
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    VpcId string
    The virtual private cloud (VPC) ID of the internal endpoint.
    VswitchId string
    The vSwitch ID of the internal endpoint.
    DbInstanceEndpointDescription string
    The user-defined description of the endpoint.
    connectionStringPrefix String
    The IP address of the internal endpoint.
    dbInstanceId String
    The ID of the instance.
    nodeItems List<DbInstanceEndpointNodeItem>
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port String
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    vpcId String
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitchId String
    The vSwitch ID of the internal endpoint.
    dbInstanceEndpointDescription String
    The user-defined description of the endpoint.
    connectionStringPrefix string
    The IP address of the internal endpoint.
    dbInstanceId string
    The ID of the instance.
    nodeItems DbInstanceEndpointNodeItem[]
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port string
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    vpcId string
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitchId string
    The vSwitch ID of the internal endpoint.
    dbInstanceEndpointDescription string
    The user-defined description of the endpoint.
    connection_string_prefix str
    The IP address of the internal endpoint.
    db_instance_id str
    The ID of the instance.
    node_items Sequence[DbInstanceEndpointNodeItemArgs]
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port str
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    vpc_id str
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitch_id str
    The vSwitch ID of the internal endpoint.
    db_instance_endpoint_description str
    The user-defined description of the endpoint.
    connectionStringPrefix String
    The IP address of the internal endpoint.
    dbInstanceId String
    The ID of the instance.
    nodeItems List<Property Map>
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port String
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    vpcId String
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitchId String
    The vSwitch ID of the internal endpoint.
    dbInstanceEndpointDescription String
    The user-defined description of the endpoint.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DbInstanceEndpoint resource produces the following output properties:

    ConnectionString string
    The internal endpoint.
    DbInstanceEndpointId string
    The Endpoint ID of the instance.
    DbInstanceEndpointType string
    The type of the endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    IpType string
    The type of the IP address.
    PrivateIpAddress string
    The IP address of the internal endpoint.
    ConnectionString string
    The internal endpoint.
    DbInstanceEndpointId string
    The Endpoint ID of the instance.
    DbInstanceEndpointType string
    The type of the endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    IpType string
    The type of the IP address.
    PrivateIpAddress string
    The IP address of the internal endpoint.
    connectionString String
    The internal endpoint.
    dbInstanceEndpointId String
    The Endpoint ID of the instance.
    dbInstanceEndpointType String
    The type of the endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    ipType String
    The type of the IP address.
    privateIpAddress String
    The IP address of the internal endpoint.
    connectionString string
    The internal endpoint.
    dbInstanceEndpointId string
    The Endpoint ID of the instance.
    dbInstanceEndpointType string
    The type of the endpoint.
    id string
    The provider-assigned unique ID for this managed resource.
    ipType string
    The type of the IP address.
    privateIpAddress string
    The IP address of the internal endpoint.
    connection_string str
    The internal endpoint.
    db_instance_endpoint_id str
    The Endpoint ID of the instance.
    db_instance_endpoint_type str
    The type of the endpoint.
    id str
    The provider-assigned unique ID for this managed resource.
    ip_type str
    The type of the IP address.
    private_ip_address str
    The IP address of the internal endpoint.
    connectionString String
    The internal endpoint.
    dbInstanceEndpointId String
    The Endpoint ID of the instance.
    dbInstanceEndpointType String
    The type of the endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    ipType String
    The type of the IP address.
    privateIpAddress String
    The IP address of the internal endpoint.

    Look up Existing DbInstanceEndpoint Resource

    Get an existing DbInstanceEndpoint 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?: DbInstanceEndpointState, opts?: CustomResourceOptions): DbInstanceEndpoint
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_string: Optional[str] = None,
            connection_string_prefix: Optional[str] = None,
            db_instance_endpoint_description: Optional[str] = None,
            db_instance_endpoint_id: Optional[str] = None,
            db_instance_endpoint_type: Optional[str] = None,
            db_instance_id: Optional[str] = None,
            ip_type: Optional[str] = None,
            node_items: Optional[Sequence[DbInstanceEndpointNodeItemArgs]] = None,
            port: Optional[str] = None,
            private_ip_address: Optional[str] = None,
            vpc_id: Optional[str] = None,
            vswitch_id: Optional[str] = None) -> DbInstanceEndpoint
    func GetDbInstanceEndpoint(ctx *Context, name string, id IDInput, state *DbInstanceEndpointState, opts ...ResourceOption) (*DbInstanceEndpoint, error)
    public static DbInstanceEndpoint Get(string name, Input<string> id, DbInstanceEndpointState? state, CustomResourceOptions? opts = null)
    public static DbInstanceEndpoint get(String name, Output<String> id, DbInstanceEndpointState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    ConnectionString string
    The internal endpoint.
    ConnectionStringPrefix string
    The IP address of the internal endpoint.
    DbInstanceEndpointDescription string
    The user-defined description of the endpoint.
    DbInstanceEndpointId string
    The Endpoint ID of the instance.
    DbInstanceEndpointType string
    The type of the endpoint.
    DbInstanceId string
    The ID of the instance.
    IpType string
    The type of the IP address.
    NodeItems List<Pulumi.AliCloud.Rds.Inputs.DbInstanceEndpointNodeItem>
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    Port string
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    PrivateIpAddress string
    The IP address of the internal endpoint.
    VpcId string
    The virtual private cloud (VPC) ID of the internal endpoint.
    VswitchId string
    The vSwitch ID of the internal endpoint.
    ConnectionString string
    The internal endpoint.
    ConnectionStringPrefix string
    The IP address of the internal endpoint.
    DbInstanceEndpointDescription string
    The user-defined description of the endpoint.
    DbInstanceEndpointId string
    The Endpoint ID of the instance.
    DbInstanceEndpointType string
    The type of the endpoint.
    DbInstanceId string
    The ID of the instance.
    IpType string
    The type of the IP address.
    NodeItems []DbInstanceEndpointNodeItemArgs
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    Port string
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    PrivateIpAddress string
    The IP address of the internal endpoint.
    VpcId string
    The virtual private cloud (VPC) ID of the internal endpoint.
    VswitchId string
    The vSwitch ID of the internal endpoint.
    connectionString String
    The internal endpoint.
    connectionStringPrefix String
    The IP address of the internal endpoint.
    dbInstanceEndpointDescription String
    The user-defined description of the endpoint.
    dbInstanceEndpointId String
    The Endpoint ID of the instance.
    dbInstanceEndpointType String
    The type of the endpoint.
    dbInstanceId String
    The ID of the instance.
    ipType String
    The type of the IP address.
    nodeItems List<DbInstanceEndpointNodeItem>
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port String
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    privateIpAddress String
    The IP address of the internal endpoint.
    vpcId String
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitchId String
    The vSwitch ID of the internal endpoint.
    connectionString string
    The internal endpoint.
    connectionStringPrefix string
    The IP address of the internal endpoint.
    dbInstanceEndpointDescription string
    The user-defined description of the endpoint.
    dbInstanceEndpointId string
    The Endpoint ID of the instance.
    dbInstanceEndpointType string
    The type of the endpoint.
    dbInstanceId string
    The ID of the instance.
    ipType string
    The type of the IP address.
    nodeItems DbInstanceEndpointNodeItem[]
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port string
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    privateIpAddress string
    The IP address of the internal endpoint.
    vpcId string
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitchId string
    The vSwitch ID of the internal endpoint.
    connection_string str
    The internal endpoint.
    connection_string_prefix str
    The IP address of the internal endpoint.
    db_instance_endpoint_description str
    The user-defined description of the endpoint.
    db_instance_endpoint_id str
    The Endpoint ID of the instance.
    db_instance_endpoint_type str
    The type of the endpoint.
    db_instance_id str
    The ID of the instance.
    ip_type str
    The type of the IP address.
    node_items Sequence[DbInstanceEndpointNodeItemArgs]
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port str
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    private_ip_address str
    The IP address of the internal endpoint.
    vpc_id str
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitch_id str
    The vSwitch ID of the internal endpoint.
    connectionString String
    The internal endpoint.
    connectionStringPrefix String
    The IP address of the internal endpoint.
    dbInstanceEndpointDescription String
    The user-defined description of the endpoint.
    dbInstanceEndpointId String
    The Endpoint ID of the instance.
    dbInstanceEndpointType String
    The type of the endpoint.
    dbInstanceId String
    The ID of the instance.
    ipType String
    The type of the IP address.
    nodeItems List<Property Map>
    The information about the node that is configured for the endpoint. It contains two sub-fields(node_id and weight). See node_items below.
    port String
    The port number of the internal endpoint. You can specify the port number for the internal endpoint.Valid values: 3000 to 5999.
    privateIpAddress String
    The IP address of the internal endpoint.
    vpcId String
    The virtual private cloud (VPC) ID of the internal endpoint.
    vswitchId String
    The vSwitch ID of the internal endpoint.

    Supporting Types

    DbInstanceEndpointNodeItem, DbInstanceEndpointNodeItemArgs

    NodeId string
    The ID of the node.
    Weight int
    The weight of the node. Read requests are distributed based on the weight.Valid values: 0 to 100.
    NodeId string
    The ID of the node.
    Weight int
    The weight of the node. Read requests are distributed based on the weight.Valid values: 0 to 100.
    nodeId String
    The ID of the node.
    weight Integer
    The weight of the node. Read requests are distributed based on the weight.Valid values: 0 to 100.
    nodeId string
    The ID of the node.
    weight number
    The weight of the node. Read requests are distributed based on the weight.Valid values: 0 to 100.
    node_id str
    The ID of the node.
    weight int
    The weight of the node. Read requests are distributed based on the weight.Valid values: 0 to 100.
    nodeId String
    The ID of the node.
    weight Number
    The weight of the node. Read requests are distributed based on the weight.Valid values: 0 to 100.

    Import

    RDS database endpoint feature can be imported using the id, e.g.

    $ pulumi import alicloud:rds/dbInstanceEndpoint:DbInstanceEndpoint example <db_instance_id>:<db_instance_endpoint_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi