Single Server Args
data class SingleServerArgs(val identity: Output<ResourceIdentityArgs>? = null, val location: Output<String>? = null, val properties: Output<Any>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null, val sku: Output<SingleServerSkuArgs>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<SingleServerArgs>
Represents a server. Uses Azure REST 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 singleServer = new AzureNative.DBforPostgreSQL.SingleServer("singleServer", 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.SingleServerSkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "B_Gen5_2",
Tier = AzureNative.DBforPostgreSQL.SingleServerSkuTier.Basic,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
Content copied to clipboard
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewSingleServer(ctx, "singleServer", &dbforpostgresql.SingleServerArgs{
Location: pulumi.String("brazilsouth"),
Properties: &dbforpostgresql.ServerPropertiesForRestoreArgs{
CreateMode: pulumi.String("PointInTimeRestore"),
RestorePointInTime: pulumi.String("2017-12-14T00:00:37.467Z"),
SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbforpostgresql.SingleServerSkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("B_Gen5_2"),
Tier: pulumi.String(dbforpostgresql.SingleServerSkuTierBasic),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
})
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.SingleServer;
import com.pulumi.azurenative.dbforpostgresql.SingleServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SingleServerSkuArgs;
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 singleServer = new SingleServer("singleServer", SingleServerArgs.builder()
.location("brazilsouth")
.properties(ServerPropertiesForRestoreArgs.builder()
.createMode("PointInTimeRestore")
.restorePointInTime("2017-12-14T00:00:37.467Z")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver")
.build())
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.sku(SingleServerSkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("B_Gen5_2")
.tier("Basic")
.build())
.tags(Map.of("ElasticServer", "1"))
.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 singleServer = new AzureNative.DBforPostgreSQL.SingleServer("singleServer", new()
{
Location = "westus",
Properties = new AzureNative.DBforPostgreSQL.Inputs.ServerPropertiesForDefaultCreateArgs
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "<administratorLoginPassword>",
CreateMode = "Default",
MinimalTlsVersion = AzureNative.DBforPostgreSQL.MinimalTlsVersionEnum.TLS1_2,
SslEnforcement = AzureNative.DBforPostgreSQL.SslEnforcementEnum.Enabled,
StorageProfile = new AzureNative.DBforPostgreSQL.Inputs.StorageProfileArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = AzureNative.DBforPostgreSQL.GeoRedundantBackup.Disabled,
StorageMB = 128000,
},
},
ResourceGroupName = "TestGroup",
ServerName = "pgtestsvc4",
Sku = new AzureNative.DBforPostgreSQL.Inputs.SingleServerSkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "B_Gen5_2",
Tier = AzureNative.DBforPostgreSQL.SingleServerSkuTier.Basic,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
Content copied to clipboard
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewSingleServer(ctx, "singleServer", &dbforpostgresql.SingleServerArgs{
Location: pulumi.String("westus"),
Properties: &dbforpostgresql.ServerPropertiesForDefaultCreateArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("<administratorLoginPassword>"),
CreateMode: pulumi.String("Default"),
MinimalTlsVersion: pulumi.String(dbforpostgresql.MinimalTlsVersionEnum_TLS1_2),
SslEnforcement: dbforpostgresql.SslEnforcementEnumEnabled,
StorageProfile: &dbforpostgresql.StorageProfileArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbforpostgresql.GeoRedundantBackupDisabled),
StorageMB: pulumi.Int(128000),
},
},
ResourceGroupName: pulumi.String("TestGroup"),
ServerName: pulumi.String("pgtestsvc4"),
Sku: &dbforpostgresql.SingleServerSkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("B_Gen5_2"),
Tier: pulumi.String(dbforpostgresql.SingleServerSkuTierBasic),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
})
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.SingleServer;
import com.pulumi.azurenative.dbforpostgresql.SingleServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SingleServerSkuArgs;
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 singleServer = new SingleServer("singleServer", SingleServerArgs.builder()
.location("westus")
.properties(ServerPropertiesForDefaultCreateArgs.builder()
.administratorLogin("cloudsa")
.administratorLoginPassword("<administratorLoginPassword>")
.createMode("Default")
.minimalTlsVersion("TLS1_2")
.sslEnforcement("Enabled")
.storageProfile(StorageProfileArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Disabled")
.storageMB(128000)
.build())
.build())
.resourceGroupName("TestGroup")
.serverName("pgtestsvc4")
.sku(SingleServerSkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("B_Gen5_2")
.tier("Basic")
.build())
.tags(Map.of("ElasticServer", "1"))
.build());
}
}
Content copied to clipboard
Create a replica server
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var singleServer = new AzureNative.DBforPostgreSQL.SingleServer("singleServer", 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.SingleServerSkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforPostgreSQL.SingleServerSkuTier.GeneralPurpose,
},
});
});
Content copied to clipboard
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewSingleServer(ctx, "singleServer", &dbforpostgresql.SingleServerArgs{
Location: pulumi.String("westcentralus"),
Properties: &dbforpostgresql.ServerPropertiesForReplicaArgs{
CreateMode: pulumi.String("Replica"),
SourceServerId: pulumi.String("/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.SingleServerSkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbforpostgresql.SingleServerSkuTierGeneralPurpose),
},
})
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.SingleServer;
import com.pulumi.azurenative.dbforpostgresql.SingleServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SingleServerSkuArgs;
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 singleServer = new SingleServer("singleServer", SingleServerArgs.builder()
.location("westcentralus")
.properties(ServerPropertiesForReplicaArgs.builder()
.createMode("Replica")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup_WestCentralUS/providers/Microsoft.DBforPostgreSQL/servers/testserver-master")
.build())
.resourceGroupName("TestGroup_WestCentralUS")
.serverName("testserver-replica1")
.sku(SingleServerSkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("GP_Gen5_2")
.tier("GeneralPurpose")
.build())
.build());
}
}
Content copied to clipboard
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 singleServer = new AzureNative.DBforPostgreSQL.SingleServer("singleServer", 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.SingleServerSkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforPostgreSQL.SingleServerSkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
Content copied to clipboard
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewSingleServer(ctx, "singleServer", &dbforpostgresql.SingleServerArgs{
Location: pulumi.String("westus"),
Properties: &dbforpostgresql.ServerPropertiesForGeoRestoreArgs{
CreateMode: pulumi.String("GeoRestore"),
SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbforpostgresql.SingleServerSkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbforpostgresql.SingleServerSkuTierGeneralPurpose),
},
Tags: pulumi.StringMap{
"ElasticServer": pulumi.String("1"),
},
})
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.SingleServer;
import com.pulumi.azurenative.dbforpostgresql.SingleServerArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.SingleServerSkuArgs;
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 singleServer = new SingleServer("singleServer", SingleServerArgs.builder()
.location("westus")
.properties(ServerPropertiesForGeoRestoreArgs.builder()
.createMode("GeoRestore")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforPostgreSQL/servers/sourceserver")
.build())
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.sku(SingleServerSkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("GP_Gen5_2")
.tier("GeneralPurpose")
.build())
.tags(Map.of("ElasticServer", "1"))
.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:SingleServer targetserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(identity: Output<ResourceIdentityArgs>? = null, location: Output<String>? = null, properties: Output<Any>? = null, resourceGroupName: Output<String>? = null, serverName: Output<String>? = null, sku: Output<SingleServerSkuArgs>? = null, tags: Output<Map<String, String>>? = null)
Properties
Link copied to clipboard
The Azure Active Directory identity of the server.
Link copied to clipboard
Properties of the server.
Link copied to clipboard
The name of the resource group. The name is case insensitive.
Link copied to clipboard
The name of the server.
Link copied to clipboard
The SKU (pricing tier) of the server.