Show / Hide Table of Contents

Class Connection

Provides a connection resource to allocate an Internet connection string for instance.

NOTE: Available in 1.48.0+

NOTE: Each instance will allocate a intranet connection string automatically and its prefix is instance 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") ?? "Gpdb";
    var name = config.Get("name") ?? "gpdbConnectionBasic";
    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
    {
        AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
        CidrBlock = "172.16.0.0/24",
        VpcId = defaultNetwork.Id,
    });
    var defaultInstance = new AliCloud.Gpdb.Instance("defaultInstance", new AliCloud.Gpdb.InstanceArgs
    {
        Description = name,
        Engine = "gpdb",
        EngineVersion = "4.3",
        InstanceClass = "gpdb.group.segsdx2",
        InstanceGroupCount = "2",
        VswitchId = defaultSwitch.Id,
    });
    var defaultConnection = new AliCloud.Gpdb.Connection("defaultConnection", new AliCloud.Gpdb.ConnectionArgs
    {
        ConnectionPrefix = "testAbc",
        InstanceId = defaultInstance.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Connection
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.Gpdb
Assembly: Pulumi.AliCloud.dll
Syntax
public class Connection : CustomResource

Constructors

View Source

Connection(String, ConnectionArgs, CustomResourceOptions)

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

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

The unique name of the resource

ConnectionArgs 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 <instance_id> + '-tf'.

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

ConnectionString

Connection instance string.

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

InstanceId

The Id of instance that can run database.

Declaration
public Output<string> InstanceId { 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

Port

Internet connection port. Valid value: [3200-3999]. Default to 3306.

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

Methods

View Source

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

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

Declaration
public static Connection Get(string name, Input<string> id, ConnectionState 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.

ConnectionState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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