Show / Hide Table of Contents

Class EndpointAddress

Provides a PolarDB endpoint address resource to allocate an Internet endpoint address string for PolarDB instance.

NOTE: Available in v1.68.0+. Each PolarDB instance will allocate a intranet connection string automatically and its prefix is Cluster ID. To avoid unnecessary conflict, please specified a internet connection prefix before applying the resource.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var creation = config.Get("creation") ?? "PolarDB";
    var name = config.Get("name") ?? "polardbconnectionbasic";
    var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
    {
        AvailableResourceCreation = creation,
    }));
    var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
    {
        CidrBlock = "172.16.0.0/16",
    });
    var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
    {
        VpcId = defaultNetwork.Id,
        CidrBlock = "172.16.0.0/24",
        AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
    });
    var defaultCluster = new AliCloud.PolarDB.Cluster("defaultCluster", new AliCloud.PolarDB.ClusterArgs
    {
        DbType = "MySQL",
        DbVersion = "8.0",
        PayType = "PostPaid",
        DbNodeClass = "polar.mysql.x4.large",
        VswitchId = defaultSwitch.Id,
        Description = name,
    });
    var defaultEndpoints = defaultCluster.Id.Apply(id => AliCloud.PolarDB.GetEndpoints.InvokeAsync(new AliCloud.PolarDB.GetEndpointsArgs
    {
        DbClusterId = id,
    }));
    var endpoint = new AliCloud.PolarDB.EndpointAddress("endpoint", new AliCloud.PolarDB.EndpointAddressArgs
    {
        DbClusterId = defaultCluster.Id,
        DbEndpointId = defaultEndpoints.Apply(defaultEndpoints => defaultEndpoints.Endpoints[0].DbEndpointId),
        ConnectionPrefix = "testpolardbconn",
        NetType = "Public",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
EndpointAddress
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.PolarDB
Assembly: Pulumi.AliCloud.dll
Syntax
public class EndpointAddress : CustomResource

Constructors

View Source

EndpointAddress(String, EndpointAddressArgs, CustomResourceOptions)

Create a EndpointAddress resource with the given unique name, arguments, and options.

Declaration
public EndpointAddress(string name, EndpointAddressArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

EndpointAddressArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ConnectionPrefix

Prefix of an Internet connection string. It must be checked for uniqueness. It may consist of lowercase letters, numbers, and underlines, and must start with a letter and have no more than 30 characters. Default to <db_endpoint_id> + 'tf'.

Declaration
public Output<string> ConnectionPrefix { get; }
Property Value
Type Description
Output<System.String>
View Source

ConnectionString

Connection cluster or endpoint string.

Declaration
public Output<string> ConnectionString { get; }
Property Value
Type Description
Output<System.String>
View Source

DbClusterId

The Id of cluster that can run database.

Declaration
public Output<string> DbClusterId { get; }
Property Value
Type Description
Output<System.String>
View Source

DbEndpointId

The Id of endpoint that can run database.

Declaration
public Output<string> DbEndpointId { get; }
Property Value
Type Description
Output<System.String>
View Source

IpAddress

The ip address of connection string.

Declaration
public Output<string> IpAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

NetType

Internet connection net type. Valid value: Public. Default to Public. Currently supported only Public.

Declaration
public Output<string> NetType { get; }
Property Value
Type Description
Output<System.String>
View Source

Port

Connection cluster or endpoint port.

Declaration
public Output<string> Port { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, EndpointAddressState, CustomResourceOptions)

Get an existing EndpointAddress resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static EndpointAddress Get(string name, Input<string> id, EndpointAddressState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

EndpointAddressState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
EndpointAddress
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.