Server
Represents a server. Uses Azure REST API version 2022-12-01. In version 1.x of the Azure Native provider, it used API version 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, 2023-06-01-preview, 2023-12-01-preview, 2024-03-01-preview, 2024-08-01, 2024-11-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 = AzureNative.DBforPostgreSQL.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",
});
});
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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
CreateMode: pulumi.String(dbforpostgresql.CreateModeGeoRestore),
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
})
}
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());
}
}
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 = AzureNative.DBforPostgreSQL.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",
});
});
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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
CreateMode: pulumi.String(dbforpostgresql.CreateModePointInTimeRestore),
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
})
}
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());
}
}
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 = AzureNative.DBforPostgreSQL.GeoRedundantBackupEnum.Disabled,
},
CreateMode = AzureNative.DBforPostgreSQL.CreateMode.Create,
HighAvailability = new AzureNative.DBforPostgreSQL.Inputs.HighAvailabilityArgs
{
Mode = AzureNative.DBforPostgreSQL.HighAvailabilityMode.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 = AzureNative.DBforPostgreSQL.SkuTier.GeneralPurpose,
},
Storage = new AzureNative.DBforPostgreSQL.Inputs.StorageArgs
{
StorageSizeGB = 512,
},
Tags =
{
{ "ElasticServer", "1" },
},
Version = AzureNative.DBforPostgreSQL.ServerVersion.ServerVersion_12,
});
});
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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("password"),
AvailabilityZone: pulumi.String("1"),
Backup: &dbforpostgresql.BackupTypeArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbforpostgresql.GeoRedundantBackupEnumDisabled),
},
CreateMode: pulumi.String(dbforpostgresql.CreateModeCreate),
HighAvailability: &dbforpostgresql.HighAvailabilityArgs{
Mode: pulumi.String(dbforpostgresql.HighAvailabilityModeZoneRedundant),
},
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(dbforpostgresql.SkuTierGeneralPurpose),
},
Storage: &dbforpostgresql.StorageArgs{
StorageSizeGB: pulumi.Int(512),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
Version: pulumi.String(dbforpostgresql.ServerVersion_12),
})
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.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.BackupArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.HighAvailabilityArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.NetworkArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SkuArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.StorageArgs;
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(BackupArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Disabled")
.build())
.createMode("Create")
.highAvailability(HighAvailabilityArgs.builder()
.mode("ZoneRedundant")
.build())
.location("westus")
.network(NetworkArgs.builder()
.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")
.build())
.resourceGroupName("testrg")
.serverName("pgtestsvc4")
.sku(SkuArgs.builder()
.name("Standard_D4s_v3")
.tier("GeneralPurpose")
.build())
.storage(StorageArgs.builder()
.storageSizeGB(512)
.build())
.tags(Map.of("ElasticServer", "1"))
.version("12")
.build());
}
}
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 = AzureNative.DBforPostgreSQL.ActiveDirectoryAuthEnum.Enabled,
PasswordAuth = AzureNative.DBforPostgreSQL.PasswordAuthEnum.Enabled,
TenantId = "tttttt-tttt-tttt-tttt-tttttttttttt",
},
AvailabilityZone = "1",
Backup = new AzureNative.DBforPostgreSQL.Inputs.BackupArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = AzureNative.DBforPostgreSQL.GeoRedundantBackupEnum.Disabled,
},
CreateMode = AzureNative.DBforPostgreSQL.CreateMode.Create,
DataEncryption = new AzureNative.DBforPostgreSQL.Inputs.DataEncryptionArgs
{
Type = AzureNative.DBforPostgreSQL.ArmServerKeyType.SystemManaged,
},
HighAvailability = new AzureNative.DBforPostgreSQL.Inputs.HighAvailabilityArgs
{
Mode = AzureNative.DBforPostgreSQL.HighAvailabilityMode.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 = AzureNative.DBforPostgreSQL.SkuTier.GeneralPurpose,
},
Storage = new AzureNative.DBforPostgreSQL.Inputs.StorageArgs
{
StorageSizeGB = 512,
},
Tags =
{
{ "ElasticServer", "1" },
},
Version = AzureNative.DBforPostgreSQL.ServerVersion.ServerVersion_12,
});
});
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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("password"),
AuthConfig: &dbforpostgresql.AuthConfigArgs{
ActiveDirectoryAuth: pulumi.String(dbforpostgresql.ActiveDirectoryAuthEnumEnabled),
PasswordAuth: pulumi.String(dbforpostgresql.PasswordAuthEnumEnabled),
TenantId: pulumi.String("tttttt-tttt-tttt-tttt-tttttttttttt"),
},
AvailabilityZone: pulumi.String("1"),
Backup: &dbforpostgresql.BackupTypeArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbforpostgresql.GeoRedundantBackupEnumDisabled),
},
CreateMode: pulumi.String(dbforpostgresql.CreateModeCreate),
DataEncryption: &dbforpostgresql.DataEncryptionArgs{
Type: pulumi.String(dbforpostgresql.ArmServerKeyTypeSystemManaged),
},
HighAvailability: &dbforpostgresql.HighAvailabilityArgs{
Mode: pulumi.String(dbforpostgresql.HighAvailabilityModeZoneRedundant),
},
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(dbforpostgresql.SkuTierGeneralPurpose),
},
Storage: &dbforpostgresql.StorageArgs{
StorageSizeGB: pulumi.Int(512),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
Version: pulumi.String(dbforpostgresql.ServerVersion_12),
})
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.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.AuthConfigArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.BackupArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.DataEncryptionArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.HighAvailabilityArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.NetworkArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SkuArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.StorageArgs;
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(AuthConfigArgs.builder()
.activeDirectoryAuth("Enabled")
.passwordAuth("Enabled")
.tenantId("tttttt-tttt-tttt-tttt-tttttttttttt")
.build())
.availabilityZone("1")
.backup(BackupArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Disabled")
.build())
.createMode("Create")
.dataEncryption(DataEncryptionArgs.builder()
.type("SystemManaged")
.build())
.highAvailability(HighAvailabilityArgs.builder()
.mode("ZoneRedundant")
.build())
.location("westus")
.network(NetworkArgs.builder()
.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")
.build())
.resourceGroupName("testrg")
.serverName("pgtestsvc4")
.sku(SkuArgs.builder()
.name("Standard_D4s_v3")
.tier("GeneralPurpose")
.build())
.storage(StorageArgs.builder()
.storageSizeGB(512)
.build())
.tags(Map.of("ElasticServer", "1"))
.version("12")
.build());
}
}
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 = AzureNative.DBforPostgreSQL.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",
});
});
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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
CreateMode: pulumi.String(dbforpostgresql.CreateModeReplica),
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
})
}
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());
}
}
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 = AzureNative.DBforPostgreSQL.GeoRedundantBackupEnum.Disabled,
},
CreateMode = AzureNative.DBforPostgreSQL.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 = AzureNative.DBforPostgreSQL.ArmServerKeyType.AzureKeyVault,
},
HighAvailability = new AzureNative.DBforPostgreSQL.Inputs.HighAvailabilityArgs
{
Mode = AzureNative.DBforPostgreSQL.HighAvailabilityMode.ZoneRedundant,
},
Identity = new AzureNative.DBforPostgreSQL.Inputs.UserAssignedIdentityArgs
{
Type = AzureNative.DBforPostgreSQL.IdentityType.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 = AzureNative.DBforPostgreSQL.SkuTier.GeneralPurpose,
},
Storage = new AzureNative.DBforPostgreSQL.Inputs.StorageArgs
{
StorageSizeGB = 512,
},
Tags =
{
{ "ElasticServer", "1" },
},
Version = AzureNative.DBforPostgreSQL.ServerVersion.ServerVersion_12,
});
});
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.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("password"),
AvailabilityZone: pulumi.String("1"),
Backup: &dbforpostgresql.BackupTypeArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbforpostgresql.GeoRedundantBackupEnumDisabled),
},
CreateMode: pulumi.String(dbforpostgresql.CreateModeCreate),
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(dbforpostgresql.ArmServerKeyTypeAzureKeyVault),
},
HighAvailability: &dbforpostgresql.HighAvailabilityArgs{
Mode: pulumi.String(dbforpostgresql.HighAvailabilityModeZoneRedundant),
},
Identity: &dbforpostgresql.UserAssignedIdentityArgs{
Type: pulumi.String(dbforpostgresql.IdentityTypeUserAssigned),
UserAssignedIdentities: dbforpostgresql.UserIdentityMap{
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": &dbforpostgresql.UserIdentityArgs{},
},
},
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(dbforpostgresql.SkuTierGeneralPurpose),
},
Storage: &dbforpostgresql.StorageArgs{
StorageSizeGB: pulumi.Int(512),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
Version: pulumi.String(dbforpostgresql.ServerVersion_12),
})
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.Server;
import com.pulumi.azurenative.dbforpostgresql.ServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.BackupArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.DataEncryptionArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.HighAvailabilityArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.UserAssignedIdentityArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.NetworkArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SkuArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.StorageArgs;
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(BackupArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Disabled")
.build())
.createMode("Create")
.dataEncryption(DataEncryptionArgs.builder()
.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")
.build())
.highAvailability(HighAvailabilityArgs.builder()
.mode("ZoneRedundant")
.build())
.identity(UserAssignedIdentityArgs.builder()
.type("UserAssigned")
.userAssignedIdentities(Map.of("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", ))
.build())
.location("westus")
.network(NetworkArgs.builder()
.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")
.build())
.resourceGroupName("testrg")
.serverName("pgtestsvc4")
.sku(SkuArgs.builder()
.name("Standard_D4s_v3")
.tier("GeneralPurpose")
.build())
.storage(StorageArgs.builder()
.storageSizeGB(512)
.build())
.tags(Map.of("ElasticServer", "1"))
.version("12")
.build());
}
}
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}
Properties
The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
AuthConfig properties of a server.
availability zone information of the server.
Backup properties of a server.
Data encryption properties of a server.
The fully qualified domain name of a server.
High availability properties of a server.
Describes the identity of the application.
Maintenance window properties of a server.
The minor version of the server.
Network properties of a server. This Network property is required to be passed only in case you want the server to be Private access server.
Replicas allowed for a server.
Replication role of the server
The SKU (pricing tier) of the server.
The source server resource ID to restore from. It's required when 'createMode' is 'PointInTimeRestore' or 'GeoRestore' or 'Replica'. This property is returned only for Replica server
Storage properties of a server.
Azure Resource Manager metadata containing createdBy and modifiedBy information.