Cluster

class Cluster : KotlinCustomResource

Represents a cluster. Uses Azure REST API version 2022-11-08. Other available API versions: 2023-03-02-preview.

Example Usage

Create a new cluster as a point in time restore

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cluster = new AzureNative.DBforPostgreSQL.Cluster("cluster", new()
{
ClusterName = "testcluster",
Location = "westus",
PointInTimeUTC = "2017-12-14T00:00:37.467Z",
ResourceGroupName = "TestGroup",
SourceLocation = "westus",
SourceResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster",
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewCluster(ctx, "cluster", &dbforpostgresql.ClusterArgs{
ClusterName: pulumi.String("testcluster"),
Location: pulumi.String("westus"),
PointInTimeUTC: pulumi.String("2017-12-14T00:00:37.467Z"),
ResourceGroupName: pulumi.String("TestGroup"),
SourceLocation: pulumi.String("westus"),
SourceResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Cluster;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
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) {
var cluster = new Cluster("cluster", ClusterArgs.builder()
.clusterName("testcluster")
.location("westus")
.pointInTimeUTC("2017-12-14T00:00:37.467Z")
.resourceGroupName("TestGroup")
.sourceLocation("westus")
.sourceResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster")
.build());
}
}

Create a new cluster as a read replica

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cluster = new AzureNative.DBforPostgreSQL.Cluster("cluster", new()
{
ClusterName = "testcluster",
Location = "westus",
ResourceGroupName = "TestGroup",
SourceLocation = "westus",
SourceResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster",
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewCluster(ctx, "cluster", &dbforpostgresql.ClusterArgs{
ClusterName: pulumi.String("testcluster"),
Location: pulumi.String("westus"),
ResourceGroupName: pulumi.String("TestGroup"),
SourceLocation: pulumi.String("westus"),
SourceResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Cluster;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
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) {
var cluster = new Cluster("cluster", ClusterArgs.builder()
.clusterName("testcluster")
.location("westus")
.resourceGroupName("TestGroup")
.sourceLocation("westus")
.sourceResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster")
.build());
}
}

Create a new multi-node cluster

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cluster = new AzureNative.DBforPostgreSQL.Cluster("cluster", new()
{
AdministratorLoginPassword = "password",
CitusVersion = "11.1",
ClusterName = "testcluster-multinode",
CoordinatorEnablePublicIpAccess = true,
CoordinatorServerEdition = "GeneralPurpose",
CoordinatorStorageQuotaInMb = 524288,
CoordinatorVCores = 4,
EnableHa = true,
EnableShardsOnCoordinator = false,
Location = "westus",
NodeCount = 3,
NodeEnablePublicIpAccess = false,
NodeServerEdition = "MemoryOptimized",
NodeStorageQuotaInMb = 524288,
NodeVCores = 8,
PostgresqlVersion = "15",
PreferredPrimaryZone = "1",
ResourceGroupName = "TestGroup",
Tags = null,
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewCluster(ctx, "cluster", &dbforpostgresql.ClusterArgs{
AdministratorLoginPassword: pulumi.String("password"),
CitusVersion: pulumi.String("11.1"),
ClusterName: pulumi.String("testcluster-multinode"),
CoordinatorEnablePublicIpAccess: pulumi.Bool(true),
CoordinatorServerEdition: pulumi.String("GeneralPurpose"),
CoordinatorStorageQuotaInMb: pulumi.Int(524288),
CoordinatorVCores: pulumi.Int(4),
EnableHa: pulumi.Bool(true),
EnableShardsOnCoordinator: pulumi.Bool(false),
Location: pulumi.String("westus"),
NodeCount: pulumi.Int(3),
NodeEnablePublicIpAccess: pulumi.Bool(false),
NodeServerEdition: pulumi.String("MemoryOptimized"),
NodeStorageQuotaInMb: pulumi.Int(524288),
NodeVCores: pulumi.Int(8),
PostgresqlVersion: pulumi.String("15"),
PreferredPrimaryZone: pulumi.String("1"),
ResourceGroupName: pulumi.String("TestGroup"),
Tags: pulumi.StringMap{},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Cluster;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
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) {
var cluster = new Cluster("cluster", ClusterArgs.builder()
.administratorLoginPassword("password")
.citusVersion("11.1")
.clusterName("testcluster-multinode")
.coordinatorEnablePublicIpAccess(true)
.coordinatorServerEdition("GeneralPurpose")
.coordinatorStorageQuotaInMb(524288)
.coordinatorVCores(4)
.enableHa(true)
.enableShardsOnCoordinator(false)
.location("westus")
.nodeCount(3)
.nodeEnablePublicIpAccess(false)
.nodeServerEdition("MemoryOptimized")
.nodeStorageQuotaInMb(524288)
.nodeVCores(8)
.postgresqlVersion("15")
.preferredPrimaryZone("1")
.resourceGroupName("TestGroup")
.tags()
.build());
}
}

Create a new single node Burstable 1 vCore cluster

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cluster = new AzureNative.DBforPostgreSQL.Cluster("cluster", new()
{
AdministratorLoginPassword = "password",
CitusVersion = "11.3",
ClusterName = "testcluster-burstablev1",
CoordinatorEnablePublicIpAccess = true,
CoordinatorServerEdition = "BurstableMemoryOptimized",
CoordinatorStorageQuotaInMb = 131072,
CoordinatorVCores = 1,
EnableHa = false,
EnableShardsOnCoordinator = true,
Location = "westus",
NodeCount = 0,
PostgresqlVersion = "15",
PreferredPrimaryZone = "1",
ResourceGroupName = "TestGroup",
Tags =
{
{ "owner", "JohnDoe" },
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewCluster(ctx, "cluster", &dbforpostgresql.ClusterArgs{
AdministratorLoginPassword: pulumi.String("password"),
CitusVersion: pulumi.String("11.3"),
ClusterName: pulumi.String("testcluster-burstablev1"),
CoordinatorEnablePublicIpAccess: pulumi.Bool(true),
CoordinatorServerEdition: pulumi.String("BurstableMemoryOptimized"),
CoordinatorStorageQuotaInMb: pulumi.Int(131072),
CoordinatorVCores: pulumi.Int(1),
EnableHa: pulumi.Bool(false),
EnableShardsOnCoordinator: pulumi.Bool(true),
Location: pulumi.String("westus"),
NodeCount: pulumi.Int(0),
PostgresqlVersion: pulumi.String("15"),
PreferredPrimaryZone: pulumi.String("1"),
ResourceGroupName: pulumi.String("TestGroup"),
Tags: pulumi.StringMap{
"owner": pulumi.String("JohnDoe"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Cluster;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
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) {
var cluster = new Cluster("cluster", ClusterArgs.builder()
.administratorLoginPassword("password")
.citusVersion("11.3")
.clusterName("testcluster-burstablev1")
.coordinatorEnablePublicIpAccess(true)
.coordinatorServerEdition("BurstableMemoryOptimized")
.coordinatorStorageQuotaInMb(131072)
.coordinatorVCores(1)
.enableHa(false)
.enableShardsOnCoordinator(true)
.location("westus")
.nodeCount(0)
.postgresqlVersion("15")
.preferredPrimaryZone("1")
.resourceGroupName("TestGroup")
.tags(Map.of("owner", "JohnDoe"))
.build());
}
}

Create a new single node Burstable 2 vCores cluster

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cluster = new AzureNative.DBforPostgreSQL.Cluster("cluster", new()
{
AdministratorLoginPassword = "password",
CitusVersion = "11.3",
ClusterName = "testcluster-burstablev2",
CoordinatorEnablePublicIpAccess = true,
CoordinatorServerEdition = "BurstableGeneralPurpose",
CoordinatorStorageQuotaInMb = 131072,
CoordinatorVCores = 2,
EnableHa = false,
EnableShardsOnCoordinator = true,
Location = "westus",
NodeCount = 0,
PostgresqlVersion = "15",
PreferredPrimaryZone = "1",
ResourceGroupName = "TestGroup",
Tags =
{
{ "owner", "JohnDoe" },
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewCluster(ctx, "cluster", &dbforpostgresql.ClusterArgs{
AdministratorLoginPassword: pulumi.String("password"),
CitusVersion: pulumi.String("11.3"),
ClusterName: pulumi.String("testcluster-burstablev2"),
CoordinatorEnablePublicIpAccess: pulumi.Bool(true),
CoordinatorServerEdition: pulumi.String("BurstableGeneralPurpose"),
CoordinatorStorageQuotaInMb: pulumi.Int(131072),
CoordinatorVCores: pulumi.Int(2),
EnableHa: pulumi.Bool(false),
EnableShardsOnCoordinator: pulumi.Bool(true),
Location: pulumi.String("westus"),
NodeCount: pulumi.Int(0),
PostgresqlVersion: pulumi.String("15"),
PreferredPrimaryZone: pulumi.String("1"),
ResourceGroupName: pulumi.String("TestGroup"),
Tags: pulumi.StringMap{
"owner": pulumi.String("JohnDoe"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Cluster;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
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) {
var cluster = new Cluster("cluster", ClusterArgs.builder()
.administratorLoginPassword("password")
.citusVersion("11.3")
.clusterName("testcluster-burstablev2")
.coordinatorEnablePublicIpAccess(true)
.coordinatorServerEdition("BurstableGeneralPurpose")
.coordinatorStorageQuotaInMb(131072)
.coordinatorVCores(2)
.enableHa(false)
.enableShardsOnCoordinator(true)
.location("westus")
.nodeCount(0)
.postgresqlVersion("15")
.preferredPrimaryZone("1")
.resourceGroupName("TestGroup")
.tags(Map.of("owner", "JohnDoe"))
.build());
}
}

Create a new single node cluster

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cluster = new AzureNative.DBforPostgreSQL.Cluster("cluster", new()
{
AdministratorLoginPassword = "password",
CitusVersion = "11.3",
ClusterName = "testcluster-singlenode",
CoordinatorEnablePublicIpAccess = true,
CoordinatorServerEdition = "GeneralPurpose",
CoordinatorStorageQuotaInMb = 131072,
CoordinatorVCores = 8,
EnableHa = true,
EnableShardsOnCoordinator = true,
Location = "westus",
NodeCount = 0,
PostgresqlVersion = "15",
PreferredPrimaryZone = "1",
ResourceGroupName = "TestGroup",
Tags =
{
{ "owner", "JohnDoe" },
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewCluster(ctx, "cluster", &dbforpostgresql.ClusterArgs{
AdministratorLoginPassword: pulumi.String("password"),
CitusVersion: pulumi.String("11.3"),
ClusterName: pulumi.String("testcluster-singlenode"),
CoordinatorEnablePublicIpAccess: pulumi.Bool(true),
CoordinatorServerEdition: pulumi.String("GeneralPurpose"),
CoordinatorStorageQuotaInMb: pulumi.Int(131072),
CoordinatorVCores: pulumi.Int(8),
EnableHa: pulumi.Bool(true),
EnableShardsOnCoordinator: pulumi.Bool(true),
Location: pulumi.String("westus"),
NodeCount: pulumi.Int(0),
PostgresqlVersion: pulumi.String("15"),
PreferredPrimaryZone: pulumi.String("1"),
ResourceGroupName: pulumi.String("TestGroup"),
Tags: pulumi.StringMap{
"owner": pulumi.String("JohnDoe"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Cluster;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
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) {
var cluster = new Cluster("cluster", ClusterArgs.builder()
.administratorLoginPassword("password")
.citusVersion("11.3")
.clusterName("testcluster-singlenode")
.coordinatorEnablePublicIpAccess(true)
.coordinatorServerEdition("GeneralPurpose")
.coordinatorStorageQuotaInMb(131072)
.coordinatorVCores(8)
.enableHa(true)
.enableShardsOnCoordinator(true)
.location("westus")
.nodeCount(0)
.postgresqlVersion("15")
.preferredPrimaryZone("1")
.resourceGroupName("TestGroup")
.tags(Map.of("owner", "JohnDoe"))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:dbforpostgresql:Cluster testcluster-singlenode /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/{clusterName}

Properties

Link copied to clipboard

The administrator's login name of the servers in the cluster.

Link copied to clipboard
val citusVersion: Output<String>?

The Citus extension version on all cluster servers.

Link copied to clipboard

If public access is enabled on coordinator.

Link copied to clipboard

The edition of a coordinator server (default: GeneralPurpose). Required for creation.

Link copied to clipboard

The storage of a server in MB. Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.

Link copied to clipboard
val coordinatorVCores: Output<Int>?

The vCores count of a server (max: 96). Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.

Link copied to clipboard

The earliest restore point time (ISO8601 format) for the cluster.

Link copied to clipboard
val enableHa: Output<Boolean>?

If high availability (HA) is enabled or not for the cluster.

Link copied to clipboard

If distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

The geo-location where the resource lives

Link copied to clipboard

Maintenance window of a cluster.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard
val nodeCount: Output<Int>?

Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1. Required for creation.

Link copied to clipboard

If public access is enabled on worker nodes.

Link copied to clipboard

The edition of a node server (default: MemoryOptimized).

Link copied to clipboard

The storage in MB on each worker node. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.

Link copied to clipboard
val nodeVCores: Output<Int>?

The compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.

Link copied to clipboard
val pointInTimeUTC: Output<String>?

Date and time in UTC (ISO8601 format) for cluster restore.

Link copied to clipboard

The major PostgreSQL version on all cluster servers.

Link copied to clipboard

Preferred primary availability zone (AZ) for all cluster servers.

Link copied to clipboard

The private endpoint connections for a cluster.

Link copied to clipboard

Provisioning state of the cluster

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val readReplicas: Output<List<String>>

The array of read replica clusters.

Link copied to clipboard

The list of server names in the cluster

Link copied to clipboard
val sourceLocation: Output<String>?

The Azure region of source cluster for read replica clusters.

Link copied to clipboard
val sourceResourceId: Output<String>?

The resource id of source cluster for read replica clusters.

Link copied to clipboard
val state: Output<String>

A state of a cluster/server that is visible to user.

Link copied to clipboard

Azure Resource Manager metadata containing createdBy and modifiedBy information.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>