PostgresInstanceArgs

data class PostgresInstanceArgs(val extendedLocation: Output<ExtendedLocationArgs>? = null, val location: Output<String>? = null, val postgresInstanceName: Output<String>? = null, val properties: Output<PostgresInstancePropertiesArgs>? = null, val resourceGroupName: Output<String>? = null, val sku: Output<PostgresInstanceSkuArgs>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<PostgresInstanceArgs>

A Postgres Instance. Uses Azure REST API version 2023-01-15-preview. In version 1.x of the Azure Native provider, it used API version 2021-06-01-preview. Other available API versions: 2024-01-01, 2024-05-01-preview, 2025-03-01-preview.

Example Usage

Create or update a Postgres Instance.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var postgresInstance = new AzureNative.AzureArcData.PostgresInstance("postgresInstance", new()
{
ExtendedLocation = new AzureNative.AzureArcData.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation",
Type = AzureNative.AzureArcData.ExtendedLocationTypes.CustomLocation,
},
Location = "eastus",
PostgresInstanceName = "testpostgresInstance",
Properties = new AzureNative.AzureArcData.Inputs.PostgresInstancePropertiesArgs
{
Admin = "admin",
BasicLoginInformation = new AzureNative.AzureArcData.Inputs.BasicLoginInformationArgs
{
Password = "********",
Username = "username",
},
DataControllerId = "dataControllerId",
K8sRaw = new Dictionary<string, object?>
{
["apiVersion"] = "apiVersion",
["kind"] = "postgresql-12",
["metadata"] = new Dictionary<string, object?>
{
["creationTimestamp"] = "2020-08-25T14:55:10Z",
["generation"] = 1,
["name"] = "pg1",
["namespace"] = "test",
["resourceVersion"] = "527780",
["selfLink"] = "/apis/arcdata.microsoft.com/v1alpha1/namespaces/test/postgresql-12s/pg1",
["uid"] = "1111aaaa-ffff-ffff-ffff-99999aaaaaaa",
},
["spec"] = new Dictionary<string, object?>
{
["backups"] = new Dictionary<string, object?>
{
["deltaMinutes"] = 3,
["fullMinutes"] = 10,
["tiers"] = new[]
{
new Dictionary<string, object?>
{
["retention"] = new Dictionary<string, object?>
{
["maximums"] = new[]
{
"6",
"512MB",
},
["minimums"] = new[]
{
"3",
},
},
["storage"] = new Dictionary<string, object?>
{
["volumeSize"] = "1Gi",
},
},
},
},
["engine"] = new Dictionary<string, object?>
{
["extensions"] = new[]
{
new Dictionary<string, object?>
{
["name"] = "citus",
},
},
},
["scale"] = new Dictionary<string, object?>
{
["shards"] = 3,
},
["scheduling"] = new Dictionary<string, object?>
{
["default"] = new Dictionary<string, object?>
{
["resources"] = new Dictionary<string, object?>
{
["requests"] = new Dictionary<string, object?>
{
["memory"] = "256Mi",
},
},
},
},
["service"] = new Dictionary<string, object?>
{
["type"] = "NodePort",
},
["storage"] = new Dictionary<string, object?>
{
["data"] = new Dictionary<string, object?>
{
["className"] = "local-storage",
["size"] = "5Gi",
},
["logs"] = new Dictionary<string, object?>
{
["className"] = "local-storage",
["size"] = "5Gi",
},
},
},
["status"] = new Dictionary<string, object?>
{
["externalEndpoint"] = null,
["readyPods"] = "4/4",
["state"] = "Ready",
},
},
},
ResourceGroupName = "testrg",
Sku = new AzureNative.AzureArcData.Inputs.PostgresInstanceSkuArgs
{
Dev = true,
Name = "default",
Tier = AzureNative.AzureArcData.PostgresInstanceSkuTier.Hyperscale,
},
});
});
package main
import (
azurearcdata "github.com/pulumi/pulumi-azure-native-sdk/azurearcdata/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azurearcdata.NewPostgresInstance(ctx, "postgresInstance", &azurearcdata.PostgresInstanceArgs{
ExtendedLocation: &azurearcdata.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation"),
Type: pulumi.String(azurearcdata.ExtendedLocationTypesCustomLocation),
},
Location: pulumi.String("eastus"),
PostgresInstanceName: pulumi.String("testpostgresInstance"),
Properties: &azurearcdata.PostgresInstancePropertiesArgs{
Admin: pulumi.String("admin"),
BasicLoginInformation: &azurearcdata.BasicLoginInformationArgs{
Password: pulumi.String("********"),
Username: pulumi.String("username"),
},
DataControllerId: pulumi.String("dataControllerId"),
K8sRaw: pulumi.Any(map[string]interface{}{
"apiVersion": "apiVersion",
"kind": "postgresql-12",
"metadata": map[string]interface{}{
"creationTimestamp": "2020-08-25T14:55:10Z",
"generation": 1,
"name": "pg1",
"namespace": "test",
"resourceVersion": "527780",
"selfLink": "/apis/arcdata.microsoft.com/v1alpha1/namespaces/test/postgresql-12s/pg1",
"uid": "1111aaaa-ffff-ffff-ffff-99999aaaaaaa",
},
"spec": map[string]interface{}{
"backups": map[string]interface{}{
"deltaMinutes": 3,
"fullMinutes": 10,
"tiers": []map[string]interface{}{
map[string]interface{}{
"retention": map[string]interface{}{
"maximums": []string{
"6",
"512MB",
},
"minimums": []string{
"3",
},
},
"storage": map[string]interface{}{
"volumeSize": "1Gi",
},
},
},
},
"engine": map[string]interface{}{
"extensions": []map[string]interface{}{
map[string]interface{}{
"name": "citus",
},
},
},
"scale": map[string]interface{}{
"shards": 3,
},
"scheduling": map[string]interface{}{
"default": map[string]interface{}{
"resources": map[string]interface{}{
"requests": map[string]interface{}{
"memory": "256Mi",
},
},
},
},
"service": map[string]interface{}{
"type": "NodePort",
},
"storage": map[string]interface{}{
"data": map[string]interface{}{
"className": "local-storage",
"size": "5Gi",
},
"logs": map[string]interface{}{
"className": "local-storage",
"size": "5Gi",
},
},
},
"status": map[string]interface{}{
"externalEndpoint": nil,
"readyPods": "4/4",
"state": "Ready",
},
}),
},
ResourceGroupName: pulumi.String("testrg"),
Sku: &azurearcdata.PostgresInstanceSkuArgs{
Dev: pulumi.Bool(true),
Name: pulumi.String("default"),
Tier: azurearcdata.PostgresInstanceSkuTierHyperscale,
},
})
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.azurearcdata.PostgresInstance;
import com.pulumi.azurenative.azurearcdata.PostgresInstanceArgs;
import com.pulumi.azurenative.azurearcdata.inputs.ExtendedLocationArgs;
import com.pulumi.azurenative.azurearcdata.inputs.PostgresInstancePropertiesArgs;
import com.pulumi.azurenative.azurearcdata.inputs.BasicLoginInformationArgs;
import com.pulumi.azurenative.azurearcdata.inputs.PostgresInstanceSkuArgs;
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 postgresInstance = new PostgresInstance("postgresInstance", PostgresInstanceArgs.builder()
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation")
.type("CustomLocation")
.build())
.location("eastus")
.postgresInstanceName("testpostgresInstance")
.properties(PostgresInstancePropertiesArgs.builder()
.admin("admin")
.basicLoginInformation(BasicLoginInformationArgs.builder()
.password("********")
.username("username")
.build())
.dataControllerId("dataControllerId")
.k8sRaw(Map.ofEntries(
Map.entry("apiVersion", "apiVersion"),
Map.entry("kind", "postgresql-12"),
Map.entry("metadata", Map.ofEntries(
Map.entry("creationTimestamp", "2020-08-25T14:55:10Z"),
Map.entry("generation", 1),
Map.entry("name", "pg1"),
Map.entry("namespace", "test"),
Map.entry("resourceVersion", "527780"),
Map.entry("selfLink", "/apis/arcdata.microsoft.com/v1alpha1/namespaces/test/postgresql-12s/pg1"),
Map.entry("uid", "1111aaaa-ffff-ffff-ffff-99999aaaaaaa")
)),
Map.entry("spec", Map.ofEntries(
Map.entry("backups", Map.ofEntries(
Map.entry("deltaMinutes", 3),
Map.entry("fullMinutes", 10),
Map.entry("tiers", Map.ofEntries(
Map.entry("retention", Map.ofEntries(
Map.entry("maximums",
"6",
"512MB"),
Map.entry("minimums", "3")
)),
Map.entry("storage", Map.of("volumeSize", "1Gi"))
))
)),
Map.entry("engine", Map.of("extensions", Map.of("name", "citus"))),
Map.entry("scale", Map.of("shards", 3)),
Map.entry("scheduling", Map.of("default", Map.of("resources", Map.of("requests", Map.of("memory", "256Mi"))))),
Map.entry("service", Map.of("type", "NodePort")),
Map.entry("storage", Map.ofEntries(
Map.entry("data", Map.ofEntries(
Map.entry("className", "local-storage"),
Map.entry("size", "5Gi")
)),
Map.entry("logs", Map.ofEntries(
Map.entry("className", "local-storage"),
Map.entry("size", "5Gi")
))
))
)),
Map.entry("status", Map.ofEntries(
Map.entry("externalEndpoint", null),
Map.entry("readyPods", "4/4"),
Map.entry("state", "Ready")
))
))
.build())
.resourceGroupName("testrg")
.sku(PostgresInstanceSkuArgs.builder()
.dev(true)
.name("default")
.tier("Hyperscale")
.build())
.build());
}
}

Import

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

$ pulumi import azure-native:azurearcdata:PostgresInstance testpostgresInstance /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}

Constructors

Link copied to clipboard
constructor(extendedLocation: Output<ExtendedLocationArgs>? = null, location: Output<String>? = null, postgresInstanceName: Output<String>? = null, properties: Output<PostgresInstancePropertiesArgs>? = null, resourceGroupName: Output<String>? = null, sku: Output<PostgresInstanceSkuArgs>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard

The extendedLocation of the resource.

Link copied to clipboard
val location: Output<String>? = null

The geo-location where the resource lives

Link copied to clipboard
val postgresInstanceName: Output<String>? = null

Name of Postgres Instance

Link copied to clipboard
Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the Azure resource group

Link copied to clipboard
val sku: Output<PostgresInstanceSkuArgs>? = null

Resource sku.

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

Resource tags.

Functions

Link copied to clipboard
open override fun toJava(): PostgresInstanceArgs