
com.pulumi.azurenative.dbforpostgresql.Cluster Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.dbforpostgresql;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.dbforpostgresql.ClusterArgs;
import com.pulumi.azurenative.dbforpostgresql.outputs.MaintenanceWindowResponse;
import com.pulumi.azurenative.dbforpostgresql.outputs.ServerNameItemResponse;
import com.pulumi.azurenative.dbforpostgresql.outputs.SimplePrivateEndpointConnectionResponse;
import com.pulumi.azurenative.dbforpostgresql.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Represents a cluster.
* 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
*
*
* {@code
* 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
*
*
* {@code
* 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
*
*
* {@code
* 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
*
*
* {@code
* 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
*
*
* {@code
* 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
*
*
* {@code
* 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.
*
* ```sh
* $ pulumi import azure-native:dbforpostgresql:Cluster testcluster-singlenode /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/{clusterName}
* ```
*
*/
@ResourceType(type="azure-native:dbforpostgresql:Cluster")
public class Cluster extends com.pulumi.resources.CustomResource {
/**
* The administrator's login name of the servers in the cluster.
*
*/
@Export(name="administratorLogin", refs={String.class}, tree="[0]")
private Output administratorLogin;
/**
* @return The administrator's login name of the servers in the cluster.
*
*/
public Output administratorLogin() {
return this.administratorLogin;
}
/**
* The Citus extension version on all cluster servers.
*
*/
@Export(name="citusVersion", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> citusVersion;
/**
* @return The Citus extension version on all cluster servers.
*
*/
public Output> citusVersion() {
return Codegen.optional(this.citusVersion);
}
/**
* If public access is enabled on coordinator.
*
*/
@Export(name="coordinatorEnablePublicIpAccess", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> coordinatorEnablePublicIpAccess;
/**
* @return If public access is enabled on coordinator.
*
*/
public Output> coordinatorEnablePublicIpAccess() {
return Codegen.optional(this.coordinatorEnablePublicIpAccess);
}
/**
* The edition of a coordinator server (default: GeneralPurpose). Required for creation.
*
*/
@Export(name="coordinatorServerEdition", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> coordinatorServerEdition;
/**
* @return The edition of a coordinator server (default: GeneralPurpose). Required for creation.
*
*/
public Output> coordinatorServerEdition() {
return Codegen.optional(this.coordinatorServerEdition);
}
/**
* The storage of a server in MB. Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
*
*/
@Export(name="coordinatorStorageQuotaInMb", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> coordinatorStorageQuotaInMb;
/**
* @return The storage of a server in MB. Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
*
*/
public Output> coordinatorStorageQuotaInMb() {
return Codegen.optional(this.coordinatorStorageQuotaInMb);
}
/**
* 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.
*
*/
@Export(name="coordinatorVCores", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> coordinatorVCores;
/**
* @return 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.
*
*/
public Output> coordinatorVCores() {
return Codegen.optional(this.coordinatorVCores);
}
/**
* The earliest restore point time (ISO8601 format) for the cluster.
*
*/
@Export(name="earliestRestoreTime", refs={String.class}, tree="[0]")
private Output earliestRestoreTime;
/**
* @return The earliest restore point time (ISO8601 format) for the cluster.
*
*/
public Output earliestRestoreTime() {
return this.earliestRestoreTime;
}
/**
* If high availability (HA) is enabled or not for the cluster.
*
*/
@Export(name="enableHa", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableHa;
/**
* @return If high availability (HA) is enabled or not for the cluster.
*
*/
public Output> enableHa() {
return Codegen.optional(this.enableHa);
}
/**
* 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.
*
*/
@Export(name="enableShardsOnCoordinator", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableShardsOnCoordinator;
/**
* @return 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.
*
*/
public Output> enableShardsOnCoordinator() {
return Codegen.optional(this.enableShardsOnCoordinator);
}
/**
* The geo-location where the resource lives
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The geo-location where the resource lives
*
*/
public Output location() {
return this.location;
}
/**
* Maintenance window of a cluster.
*
*/
@Export(name="maintenanceWindow", refs={MaintenanceWindowResponse.class}, tree="[0]")
private Output* @Nullable */ MaintenanceWindowResponse> maintenanceWindow;
/**
* @return Maintenance window of a cluster.
*
*/
public Output> maintenanceWindow() {
return Codegen.optional(this.maintenanceWindow);
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* 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.
*
*/
@Export(name="nodeCount", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> nodeCount;
/**
* @return 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.
*
*/
public Output> nodeCount() {
return Codegen.optional(this.nodeCount);
}
/**
* If public access is enabled on worker nodes.
*
*/
@Export(name="nodeEnablePublicIpAccess", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> nodeEnablePublicIpAccess;
/**
* @return If public access is enabled on worker nodes.
*
*/
public Output> nodeEnablePublicIpAccess() {
return Codegen.optional(this.nodeEnablePublicIpAccess);
}
/**
* The edition of a node server (default: MemoryOptimized).
*
*/
@Export(name="nodeServerEdition", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> nodeServerEdition;
/**
* @return The edition of a node server (default: MemoryOptimized).
*
*/
public Output> nodeServerEdition() {
return Codegen.optional(this.nodeServerEdition);
}
/**
* The storage in MB on each worker node. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
*
*/
@Export(name="nodeStorageQuotaInMb", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> nodeStorageQuotaInMb;
/**
* @return The storage in MB on each worker node. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
*
*/
public Output> nodeStorageQuotaInMb() {
return Codegen.optional(this.nodeStorageQuotaInMb);
}
/**
* The compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
*
*/
@Export(name="nodeVCores", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> nodeVCores;
/**
* @return The compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
*
*/
public Output> nodeVCores() {
return Codegen.optional(this.nodeVCores);
}
/**
* Date and time in UTC (ISO8601 format) for cluster restore.
*
*/
@Export(name="pointInTimeUTC", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> pointInTimeUTC;
/**
* @return Date and time in UTC (ISO8601 format) for cluster restore.
*
*/
public Output> pointInTimeUTC() {
return Codegen.optional(this.pointInTimeUTC);
}
/**
* The major PostgreSQL version on all cluster servers.
*
*/
@Export(name="postgresqlVersion", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> postgresqlVersion;
/**
* @return The major PostgreSQL version on all cluster servers.
*
*/
public Output> postgresqlVersion() {
return Codegen.optional(this.postgresqlVersion);
}
/**
* Preferred primary availability zone (AZ) for all cluster servers.
*
*/
@Export(name="preferredPrimaryZone", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> preferredPrimaryZone;
/**
* @return Preferred primary availability zone (AZ) for all cluster servers.
*
*/
public Output> preferredPrimaryZone() {
return Codegen.optional(this.preferredPrimaryZone);
}
/**
* The private endpoint connections for a cluster.
*
*/
@Export(name="privateEndpointConnections", refs={List.class,SimplePrivateEndpointConnectionResponse.class}, tree="[0,1]")
private Output> privateEndpointConnections;
/**
* @return The private endpoint connections for a cluster.
*
*/
public Output> privateEndpointConnections() {
return this.privateEndpointConnections;
}
/**
* Provisioning state of the cluster
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return Provisioning state of the cluster
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* The array of read replica clusters.
*
*/
@Export(name="readReplicas", refs={List.class,String.class}, tree="[0,1]")
private Output> readReplicas;
/**
* @return The array of read replica clusters.
*
*/
public Output> readReplicas() {
return this.readReplicas;
}
/**
* The list of server names in the cluster
*
*/
@Export(name="serverNames", refs={List.class,ServerNameItemResponse.class}, tree="[0,1]")
private Output> serverNames;
/**
* @return The list of server names in the cluster
*
*/
public Output> serverNames() {
return this.serverNames;
}
/**
* The Azure region of source cluster for read replica clusters.
*
*/
@Export(name="sourceLocation", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sourceLocation;
/**
* @return The Azure region of source cluster for read replica clusters.
*
*/
public Output> sourceLocation() {
return Codegen.optional(this.sourceLocation);
}
/**
* The resource id of source cluster for read replica clusters.
*
*/
@Export(name="sourceResourceId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sourceResourceId;
/**
* @return The resource id of source cluster for read replica clusters.
*
*/
public Output> sourceResourceId() {
return Codegen.optional(this.sourceResourceId);
}
/**
* A state of a cluster/server that is visible to user.
*
*/
@Export(name="state", refs={String.class}, tree="[0]")
private Output state;
/**
* @return A state of a cluster/server that is visible to user.
*
*/
public Output state() {
return this.state;
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Cluster(java.lang.String name) {
this(name, ClusterArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Cluster(java.lang.String name, ClusterArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Cluster(java.lang.String name, ClusterArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:dbforpostgresql:Cluster", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Cluster(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:dbforpostgresql:Cluster", name, null, makeResourceOptions(options, id), false);
}
private static ClusterArgs makeArgs(ClusterArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ClusterArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20201005privatepreview:Cluster").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20221108:Cluster").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20230302preview:Cluster").build())
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Cluster get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Cluster(name, id, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy