Class Connection
Provides an ADB connection resource to allocate an Internet connection string for ADB cluster.
NOTE: Each ADB instance will allocate a intranet connnection string automatically and its prifix is ADB instance ID. To avoid unnecessary conflict, please specified a internet connection prefix before applying the resource.
NOTE: Available in v1.81.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var creation = config.Get("creation") ?? "ADB";
var name = config.Get("name") ?? "adbaccountmysql";
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 cluster = new AliCloud.Adb.Cluster("cluster", new AliCloud.Adb.ClusterArgs
{
DbClusterCategory = "Cluster",
DbClusterVersion = "3.0",
DbNodeClass = "C8",
DbNodeCount = 2,
DbNodeStorage = 200,
Description = name,
PayType = "PostPaid",
VswitchId = defaultSwitch.Id,
});
var connection = new AliCloud.Adb.Connection("connection", new AliCloud.Adb.ConnectionArgs
{
ConnectionPrefix = "testabc",
DbClusterId = cluster.Id,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Adb
Assembly: Pulumi.AliCloud.dll
Syntax
public class Connection : CustomResource
Constructors
View SourceConnection(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 SourceConnectionPrefix
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_cluster_id> + 'tf'.
Declaration
public Output<string> ConnectionPrefix { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ConnectionString
Connection cluster string.
Declaration
public Output<string> ConnectionString { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DbClusterId
The Id of cluster that can run database.
Declaration
public Output<string> DbClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IpAddress
The ip address of connection string.
Declaration
public Output<string> IpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Port
Connection cluster port.
Declaration
public Output<string> Port { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |