Server

class Server : KotlinCustomResource

Represents a server. API Version: 2017-12-01.

Example Usage

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()
{
Location = "brazilsouth",
Properties = new AzureNative.DBforPostgreSQL.Inputs.ServerPropertiesForRestoreArgs
{
CreateMode = "PointInTimeRestore",
RestorePointInTime = "2017-12-14T00:00:37.467Z",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "B_Gen5_2",
Tier = "Basic",
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
Location: pulumi.String("brazilsouth"),
Properties: dbforpostgresql.ServerPropertiesForRestore{
CreateMode: "PointInTimeRestore",
RestorePointInTime: "2017-12-14T00:00:37.467Z",
SourceServerId: "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver",
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbforpostgresql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("B_Gen5_2"),
Tier: pulumi.String("Basic"),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
})
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()
.location("brazilsouth")
.properties(Map.ofEntries(
Map.entry("createMode", "PointInTimeRestore"),
Map.entry("restorePointInTime", "2017-12-14T00:00:37.467Z"),
Map.entry("sourceServerId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver")
))
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.sku(Map.ofEntries(
Map.entry("capacity", 2),
Map.entry("family", "Gen5"),
Map.entry("name", "B_Gen5_2"),
Map.entry("tier", "Basic")
))
.tags(Map.of("ElasticServer", "1"))
.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()
{
Location = "westus",
Properties = new AzureNative.DBforPostgreSQL.Inputs.ServerPropertiesForDefaultCreateArgs
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "<administratorLoginPassword>",
CreateMode = "Default",
MinimalTlsVersion = "TLS1_2",
SslEnforcement = AzureNative.DBforPostgreSQL.SslEnforcementEnum.Enabled,
StorageProfile = new AzureNative.DBforPostgreSQL.Inputs.StorageProfileArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = "Disabled",
StorageMB = 128000,
},
},
ResourceGroupName = "TestGroup",
ServerName = "pgtestsvc4",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "B_Gen5_2",
Tier = "Basic",
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
Location: pulumi.String("westus"),
Properties: dbforpostgresql.ServerPropertiesForDefaultCreate{
AdministratorLogin: "cloudsa",
AdministratorLoginPassword: "<administratorLoginPassword>",
CreateMode: "Default",
MinimalTlsVersion: "TLS1_2",
SslEnforcement: dbforpostgresql.SslEnforcementEnumEnabled,
StorageProfile: dbforpostgresql.StorageProfile{
BackupRetentionDays: 7,
GeoRedundantBackup: "Disabled",
StorageMB: 128000,
},
},
ResourceGroupName: pulumi.String("TestGroup"),
ServerName: pulumi.String("pgtestsvc4"),
Sku: &dbforpostgresql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("B_Gen5_2"),
Tier: pulumi.String("Basic"),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
})
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()
.location("westus")
.properties(Map.ofEntries(
Map.entry("administratorLogin", "cloudsa"),
Map.entry("administratorLoginPassword", "<administratorLoginPassword>"),
Map.entry("createMode", "Default"),
Map.entry("minimalTlsVersion", "TLS1_2"),
Map.entry("sslEnforcement", "Enabled"),
Map.entry("storageProfile", Map.ofEntries(
Map.entry("backupRetentionDays", 7),
Map.entry("geoRedundantBackup", "Disabled"),
Map.entry("storageMB", 128000)
))
))
.resourceGroupName("TestGroup")
.serverName("pgtestsvc4")
.sku(Map.ofEntries(
Map.entry("capacity", 2),
Map.entry("family", "Gen5"),
Map.entry("name", "B_Gen5_2"),
Map.entry("tier", "Basic")
))
.tags(Map.of("ElasticServer", "1"))
.build());
}
}

Create a replica 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()
{
Location = "westcentralus",
Properties = new AzureNative.DBforPostgreSQL.Inputs.ServerPropertiesForReplicaArgs
{
CreateMode = "Replica",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
},
ResourceGroupName = "TestGroup_WestCentralUS",
ServerName = "testserver-replica1",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = "GeneralPurpose",
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
Location: pulumi.String("westcentralus"),
Properties: dbforpostgresql.ServerPropertiesForReplica{
CreateMode: "Replica",
SourceServerId: "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master",
},
ResourceGroupName: pulumi.String("TestGroup_WestCentralUS"),
ServerName: pulumi.String("testserver-replica1"),
Sku: &dbforpostgresql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String("GeneralPurpose"),
},
})
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()
.location("westcentralus")
.properties(Map.ofEntries(
Map.entry("createMode", "Replica"),
Map.entry("sourceServerId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master")
))
.resourceGroupName("TestGroup_WestCentralUS")
.serverName("testserver-replica1")
.sku(Map.ofEntries(
Map.entry("capacity", 2),
Map.entry("family", "Gen5"),
Map.entry("name", "GP_Gen5_2"),
Map.entry("tier", "GeneralPurpose")
))
.build());
}
}

Create a server as a geo 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()
{
Location = "westus",
Properties = new AzureNative.DBforPostgreSQL.Inputs.ServerPropertiesForGeoRestoreArgs
{
CreateMode = "GeoRestore",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = "GeneralPurpose",
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewServer(ctx, "server", &dbforpostgresql.ServerArgs{
Location: pulumi.String("westus"),
Properties: dbforpostgresql.ServerPropertiesForGeoRestore{
CreateMode: "GeoRestore",
SourceServerId: "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver",
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbforpostgresql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String("GeneralPurpose"),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
})
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()
.location("westus")
.properties(Map.ofEntries(
Map.entry("createMode", "GeoRestore"),
Map.entry("sourceServerId", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver")
))
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.sku(Map.ofEntries(
Map.entry("capacity", 2),
Map.entry("family", "Gen5"),
Map.entry("name", "GP_Gen5_2"),
Map.entry("tier", "GeneralPurpose")
))
.tags(Map.of("ElasticServer", "1"))
.build());
}
}

Import

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

$ pulumi import azure-native:dbforpostgresql:Server targetserver /subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/servers/targetserver

Properties

Link copied to clipboard

The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).

Link copied to clipboard
val byokEnforcement: Output<String>

Status showing whether the server data encryption is enabled with customer-managed keys.

Link copied to clipboard

Earliest restore point creation time (ISO8601 format)

Link copied to clipboard

The fully qualified domain name of a server.

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

The Azure Active Directory identity of the server.

Link copied to clipboard

Status showing whether the server enabled infrastructure encryption.

Link copied to clipboard
val location: Output<String>

The geo-location where the resource lives

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

The master server id of a replica server.

Link copied to clipboard

Enforce a minimal Tls version for the server.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard

List of private endpoint connections on a server

Link copied to clipboard

Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val replicaCapacity: Output<Int>?

The maximum number of replicas that a master server can have.

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

The replication role of the server.

Link copied to clipboard
val sku: Output<SkuResponse>?

The SKU (pricing tier) of the server.

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

Enable ssl enforcement or not when connect to server.

Link copied to clipboard

Storage profile of a server.

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>
Link copied to clipboard
val userVisibleState: Output<String>?

A state of a server that is visible to user.

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

Server version.