Server Args
data class ServerArgs(val administratorLogin: Output<String>? = null, val administratorLoginPassword: Output<String>? = null, val authConfig: Output<AuthConfigArgs>? = null, val availabilityZone: Output<String>? = null, val backup: Output<BackupArgs>? = null, val createMode: Output<Either<String, CreateMode>>? = null, val dataEncryption: Output<DataEncryptionArgs>? = null, val highAvailability: Output<HighAvailabilityArgs>? = null, val identity: Output<UserAssignedIdentityArgs>? = null, val location: Output<String>? = null, val maintenanceWindow: Output<MaintenanceWindowArgs>? = null, val network: Output<NetworkArgs>? = null, val pointInTimeUTC: Output<String>? = null, val replicationRole: Output<Either<String, ReplicationRole>>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null, val sku: Output<SkuArgs>? = null, val sourceServerResourceId: Output<String>? = null, val storage: Output<StorageArgs>? = null, val tags: Output<Map<String, String>>? = null, val version: Output<Either<String, ServerVersion>>? = null) : ConvertibleToJava<ServerArgs>
Represents a server. Azure REST API version: 2022-12-01. Prior API version in Azure Native 1.x: 2017-12-01. Other available API versions: 2017-12-01, 2017-12-01-preview, 2020-02-14-preview, 2021-04-10-privatepreview, 2021-06-15-privatepreview, 2022-03-08-preview, 2023-03-01-preview.
Example Usage
Create a database as a geo-restore in geo-paired location
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var server = new AzureNative.DBforPostgreSQL.Server("server", new()
{
CreateMode = "GeoRestore",
Location = "eastus",
PointInTimeUTC = "2021-06-27T00:04:59.4078005+00:00",
ResourceGroupName = "testrg",
ServerName = "pgtestsvc5geo",
SourceServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
});
});
Content copied to clipboard
package main
import (
"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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
CreateMode: pulumi.String("GeoRestore"),
Location: pulumi.String("eastus"),
PointInTimeUTC: pulumi.String("2021-06-27T00:04:59.4078005+00:00"),
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("pgtestsvc5geo"),
SourceServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.createMode("GeoRestore")
.location("eastus")
.pointInTimeUTC("2021-06-27T00:04:59.4078005+00:00")
.resourceGroupName("testrg")
.serverName("pgtestsvc5geo")
.sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername")
.build());
}
}
Content copied to clipboard
Create a database as a point in time restore
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var server = new AzureNative.DBforPostgreSQL.Server("server", new()
{
CreateMode = "PointInTimeRestore",
Location = "westus",
PointInTimeUTC = "2021-06-27T00:04:59.4078005+00:00",
ResourceGroupName = "testrg",
ServerName = "pgtestsvc5",
SourceServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
});
});
Content copied to clipboard
package main
import (
"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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
CreateMode: pulumi.String("PointInTimeRestore"),
Location: pulumi.String("westus"),
PointInTimeUTC: pulumi.String("2021-06-27T00:04:59.4078005+00:00"),
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("pgtestsvc5"),
SourceServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.createMode("PointInTimeRestore")
.location("westus")
.pointInTimeUTC("2021-06-27T00:04:59.4078005+00:00")
.resourceGroupName("testrg")
.serverName("pgtestsvc5")
.sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername")
.build());
}
}
Content copied to clipboard
Create a new server
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var server = new AzureNative.DBforPostgreSQL.Server("server", new()
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "password",
AvailabilityZone = "1",
Backup = new AzureNative.DBforPostgreSQL.Inputs.BackupArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = "Disabled",
},
CreateMode = "Create",
HighAvailability = new AzureNative.DBforPostgreSQL.Inputs.HighAvailabilityArgs
{
Mode = "ZoneRedundant",
},
Location = "westus",
Network = new AzureNative.DBforPostgreSQL.Inputs.NetworkArgs
{
DelegatedSubnetResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
PrivateDnsZoneArmResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com",
},
ResourceGroupName = "testrg",
ServerName = "pgtestsvc4",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Name = "Standard_D4s_v3",
Tier = "GeneralPurpose",
},
Storage = new AzureNative.DBforPostgreSQL.Inputs.StorageArgs
{
StorageSizeGB = 512,
},
Tags =
{
{ "ElasticServer", "1" },
},
Version = "12",
});
});
Content copied to clipboard
package main
import (
"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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("password"),
AvailabilityZone: pulumi.String("1"),
Backup: &dbforpostgresql.BackupArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String("Disabled"),
},
CreateMode: pulumi.String("Create"),
HighAvailability: &dbforpostgresql.HighAvailabilityArgs{
Mode: pulumi.String("ZoneRedundant"),
},
Location: pulumi.String("westus"),
Network: &dbforpostgresql.NetworkArgs{
DelegatedSubnetResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
PrivateDnsZoneArmResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
},
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("pgtestsvc4"),
Sku: &dbforpostgresql.SkuArgs{
Name: pulumi.String("Standard_D4s_v3"),
Tier: pulumi.String("GeneralPurpose"),
},
Storage: &dbforpostgresql.StorageArgs{
StorageSizeGB: pulumi.Int(512),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
Version: pulumi.String("12"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.administratorLogin("cloudsa")
.administratorLoginPassword("password")
.availabilityZone("1")
.backup(Map.ofEntries(
Map.entry("backupRetentionDays", 7),
Map.entry("geoRedundantBackup", "Disabled")
))
.createMode("Create")
.highAvailability(Map.of("mode", "ZoneRedundant"))
.location("westus")
.network(Map.ofEntries(
Map.entry("delegatedSubnetResourceId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
Map.entry("privateDnsZoneArmResourceId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")
))
.resourceGroupName("testrg")
.serverName("pgtestsvc4")
.sku(Map.ofEntries(
Map.entry("name", "Standard_D4s_v3"),
Map.entry("tier", "GeneralPurpose")
))
.storage(Map.of("storageSizeGB", 512))
.tags(Map.of("ElasticServer", "1"))
.version("12")
.build());
}
}
Content copied to clipboard
Create a new server with active directory authentication enabled
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var server = new AzureNative.DBforPostgreSQL.Server("server", new()
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "password",
AuthConfig = new AzureNative.DBforPostgreSQL.Inputs.AuthConfigArgs
{
ActiveDirectoryAuth = "Enabled",
PasswordAuth = "Enabled",
TenantId = "tttttt-tttt-tttt-tttt-tttttttttttt",
},
AvailabilityZone = "1",
Backup = new AzureNative.DBforPostgreSQL.Inputs.BackupArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = "Disabled",
},
CreateMode = "Create",
DataEncryption = new AzureNative.DBforPostgreSQL.Inputs.DataEncryptionArgs
{
Type = "SystemManaged",
},
HighAvailability = new AzureNative.DBforPostgreSQL.Inputs.HighAvailabilityArgs
{
Mode = "ZoneRedundant",
},
Location = "westus",
Network = new AzureNative.DBforPostgreSQL.Inputs.NetworkArgs
{
DelegatedSubnetResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
PrivateDnsZoneArmResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com",
},
ResourceGroupName = "testrg",
ServerName = "pgtestsvc4",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Name = "Standard_D4s_v3",
Tier = "GeneralPurpose",
},
Storage = new AzureNative.DBforPostgreSQL.Inputs.StorageArgs
{
StorageSizeGB = 512,
},
Tags =
{
{ "ElasticServer", "1" },
},
Version = "12",
});
});
Content copied to clipboard
package main
import (
"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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("password"),
AuthConfig: &dbforpostgresql.AuthConfigArgs{
ActiveDirectoryAuth: pulumi.String("Enabled"),
PasswordAuth: pulumi.String("Enabled"),
TenantId: pulumi.String("tttttt-tttt-tttt-tttt-tttttttttttt"),
},
AvailabilityZone: pulumi.String("1"),
Backup: &dbforpostgresql.BackupArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String("Disabled"),
},
CreateMode: pulumi.String("Create"),
DataEncryption: &dbforpostgresql.DataEncryptionArgs{
Type: pulumi.String("SystemManaged"),
},
HighAvailability: &dbforpostgresql.HighAvailabilityArgs{
Mode: pulumi.String("ZoneRedundant"),
},
Location: pulumi.String("westus"),
Network: &dbforpostgresql.NetworkArgs{
DelegatedSubnetResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
PrivateDnsZoneArmResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
},
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("pgtestsvc4"),
Sku: &dbforpostgresql.SkuArgs{
Name: pulumi.String("Standard_D4s_v3"),
Tier: pulumi.String("GeneralPurpose"),
},
Storage: &dbforpostgresql.StorageArgs{
StorageSizeGB: pulumi.Int(512),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
Version: pulumi.String("12"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.administratorLogin("cloudsa")
.administratorLoginPassword("password")
.authConfig(Map.ofEntries(
Map.entry("activeDirectoryAuth", "Enabled"),
Map.entry("passwordAuth", "Enabled"),
Map.entry("tenantId", "tttttt-tttt-tttt-tttt-tttttttttttt")
))
.availabilityZone("1")
.backup(Map.ofEntries(
Map.entry("backupRetentionDays", 7),
Map.entry("geoRedundantBackup", "Disabled")
))
.createMode("Create")
.dataEncryption(Map.of("type", "SystemManaged"))
.highAvailability(Map.of("mode", "ZoneRedundant"))
.location("westus")
.network(Map.ofEntries(
Map.entry("delegatedSubnetResourceId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
Map.entry("privateDnsZoneArmResourceId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")
))
.resourceGroupName("testrg")
.serverName("pgtestsvc4")
.sku(Map.ofEntries(
Map.entry("name", "Standard_D4s_v3"),
Map.entry("tier", "GeneralPurpose")
))
.storage(Map.of("storageSizeGB", 512))
.tags(Map.of("ElasticServer", "1"))
.version("12")
.build());
}
}
Content copied to clipboard
ServerCreateReplica
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var server = new AzureNative.DBforPostgreSQL.Server("server", new()
{
CreateMode = "Replica",
Location = "westus",
PointInTimeUTC = "2021-06-27T00:04:59.4078005+00:00",
ResourceGroupName = "testrg",
ServerName = "pgtestsvc5rep",
SourceServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername",
});
});
Content copied to clipboard
package main
import (
"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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
CreateMode: pulumi.String("Replica"),
Location: pulumi.String("westus"),
PointInTimeUTC: pulumi.String("2021-06-27T00:04:59.4078005+00:00"),
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("pgtestsvc5rep"),
SourceServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.createMode("Replica")
.location("westus")
.pointInTimeUTC("2021-06-27T00:04:59.4078005+00:00")
.resourceGroupName("testrg")
.serverName("pgtestsvc5rep")
.sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername")
.build());
}
}
Content copied to clipboard
ServerCreateWithDataEncryptionEnabled
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var server = new AzureNative.DBforPostgreSQL.Server("server", new()
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "password",
AvailabilityZone = "1",
Backup = new AzureNative.DBforPostgreSQL.Inputs.BackupArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = "Disabled",
},
CreateMode = "Create",
DataEncryption = new AzureNative.DBforPostgreSQL.Inputs.DataEncryptionArgs
{
PrimaryKeyURI = "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787",
PrimaryUserAssignedIdentityId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity",
Type = "AzureKeyVault",
},
HighAvailability = new AzureNative.DBforPostgreSQL.Inputs.HighAvailabilityArgs
{
Mode = "ZoneRedundant",
},
Identity = new AzureNative.DBforPostgreSQL.Inputs.UserAssignedIdentityArgs
{
Type = "UserAssigned",
UserAssignedIdentities =
{
{ "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", null },
},
},
Location = "westus",
Network = new AzureNative.DBforPostgreSQL.Inputs.NetworkArgs
{
DelegatedSubnetResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet",
PrivateDnsZoneArmResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com",
},
ResourceGroupName = "testrg",
ServerName = "pgtestsvc4",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Name = "Standard_D4s_v3",
Tier = "GeneralPurpose",
},
Storage = new AzureNative.DBforPostgreSQL.Inputs.StorageArgs
{
StorageSizeGB = 512,
},
Tags =
{
{ "ElasticServer", "1" },
},
Version = "12",
});
});
Content copied to clipboard
package main
import (
"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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("password"),
AvailabilityZone: pulumi.String("1"),
Backup: &dbforpostgresql.BackupArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String("Disabled"),
},
CreateMode: pulumi.String("Create"),
DataEncryption: &dbforpostgresql.DataEncryptionArgs{
PrimaryKeyURI: pulumi.String("https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"),
PrimaryUserAssignedIdentityId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"),
Type: pulumi.String("AzureKeyVault"),
},
HighAvailability: &dbforpostgresql.HighAvailabilityArgs{
Mode: pulumi.String("ZoneRedundant"),
},
Identity: dbforpostgresql.UserAssignedIdentityResponse{
Type: pulumi.String("UserAssigned"),
UserAssignedIdentities: dbforpostgresql.UserIdentityMap{
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": nil,
},
},
Location: pulumi.String("westus"),
Network: &dbforpostgresql.NetworkArgs{
DelegatedSubnetResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
PrivateDnsZoneArmResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com"),
},
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("pgtestsvc4"),
Sku: &dbforpostgresql.SkuArgs{
Name: pulumi.String("Standard_D4s_v3"),
Tier: pulumi.String("GeneralPurpose"),
},
Storage: &dbforpostgresql.StorageArgs{
StorageSizeGB: pulumi.Int(512),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
Version: pulumi.String("12"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.administratorLogin("cloudsa")
.administratorLoginPassword("password")
.availabilityZone("1")
.backup(Map.ofEntries(
Map.entry("backupRetentionDays", 7),
Map.entry("geoRedundantBackup", "Disabled")
))
.createMode("Create")
.dataEncryption(Map.ofEntries(
Map.entry("primaryKeyURI", "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787"),
Map.entry("primaryUserAssignedIdentityId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"),
Map.entry("type", "AzureKeyVault")
))
.highAvailability(Map.of("mode", "ZoneRedundant"))
.identity(Map.ofEntries(
Map.entry("type", "UserAssigned"),
Map.entry("userAssignedIdentities", Map.of("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", ))
))
.location("westus")
.network(Map.ofEntries(
Map.entry("delegatedSubnetResourceId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet"),
Map.entry("privateDnsZoneArmResourceId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com")
))
.resourceGroupName("testrg")
.serverName("pgtestsvc4")
.sku(Map.ofEntries(
Map.entry("name", "Standard_D4s_v3"),
Map.entry("tier", "GeneralPurpose")
))
.storage(Map.of("storageSizeGB", 512))
.tags(Map.of("ElasticServer", "1"))
.version("12")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:dbforpostgresql:Server pgtestsvc4 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}
Content copied to clipboard
Constructors
Link copied to clipboard
fun ServerArgs(administratorLogin: Output<String>? = null, administratorLoginPassword: Output<String>? = null, authConfig: Output<AuthConfigArgs>? = null, availabilityZone: Output<String>? = null, backup: Output<BackupArgs>? = null, createMode: Output<Either<String, CreateMode>>? = null, dataEncryption: Output<DataEncryptionArgs>? = null, highAvailability: Output<HighAvailabilityArgs>? = null, identity: Output<UserAssignedIdentityArgs>? = null, location: Output<String>? = null, maintenanceWindow: Output<MaintenanceWindowArgs>? = null, network: Output<NetworkArgs>? = null, pointInTimeUTC: Output<String>? = null, replicationRole: Output<Either<String, ReplicationRole>>? = null, resourceGroupName: Output<String>? = null, serverName: Output<String>? = null, sku: Output<SkuArgs>? = null, sourceServerResourceId: Output<String>? = null, storage: Output<StorageArgs>? = null, tags: Output<Map<String, String>>? = null, version: Output<Either<String, ServerVersion>>? = null)
Functions
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard