ServerArgs

data class ServerArgs(val location: Output<String>? = null, val properties: Output<Any>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null, val sku: Output<SkuArgs>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ServerArgs>

Represents a server. Uses Azure REST API version 2018-06-01. In version 2.x of the Azure Native provider, it used API version 2018-06-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.DBforMariaDB.Server("server", new()
{
Location = "brazilsouth",
Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForRestoreArgs
{
CreateMode = "PointInTimeRestore",
RestorePointInTime = "2017-12-14T00:00:37.467Z",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
Sku = new AzureNative.DBforMariaDB.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforMariaDB.SkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
Location: pulumi.String("brazilsouth"),
Properties: &dbformariadb.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.DBforMariaDB/servers/sourceserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbformariadb.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbformariadb.SkuTierGeneralPurpose),
},
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.dbformariadb.Server;
import com.pulumi.azurenative.dbformariadb.ServerArgs;
import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
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(ServerPropertiesForDefaultCreateArgs.builder()
.createMode("PointInTimeRestore")
.restorePointInTime("2017-12-14T00:00:37.467Z")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver")
.build())
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.sku(SkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("GP_Gen5_2")
.tier("GeneralPurpose")
.build())
.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.DBforMariaDB.Server("server", new()
{
Location = "westus",
Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForDefaultCreateArgs
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "<administratorLoginPassword>",
CreateMode = "Default",
MinimalTlsVersion = AzureNative.DBforMariaDB.MinimalTlsVersionEnum.TLS1_2,
SslEnforcement = AzureNative.DBforMariaDB.SslEnforcementEnum.Enabled,
StorageProfile = new AzureNative.DBforMariaDB.Inputs.StorageProfileArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = AzureNative.DBforMariaDB.GeoRedundantBackup.Enabled,
StorageMB = 128000,
},
},
ResourceGroupName = "testrg",
ServerName = "mariadbtestsvc4",
Sku = new AzureNative.DBforMariaDB.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforMariaDB.SkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
Location: pulumi.String("westus"),
Properties: &dbformariadb.ServerPropertiesForDefaultCreateArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("<administratorLoginPassword>"),
CreateMode: pulumi.String("Default"),
MinimalTlsVersion: pulumi.String(dbformariadb.MinimalTlsVersionEnum_TLS1_2),
SslEnforcement: dbformariadb.SslEnforcementEnumEnabled,
StorageProfile: &dbformariadb.StorageProfileArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbformariadb.GeoRedundantBackupEnabled),
StorageMB: pulumi.Int(128000),
},
},
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("mariadbtestsvc4"),
Sku: &dbformariadb.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbformariadb.SkuTierGeneralPurpose),
},
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.dbformariadb.Server;
import com.pulumi.azurenative.dbformariadb.ServerArgs;
import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
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(ServerPropertiesForDefaultCreateArgs.builder()
.administratorLogin("cloudsa")
.administratorLoginPassword("<administratorLoginPassword>")
.createMode("Default")
.minimalTlsVersion("TLS1_2")
.sslEnforcement("Enabled")
.storageProfile(StorageProfileArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Enabled")
.storageMB(128000)
.build())
.build())
.resourceGroupName("testrg")
.serverName("mariadbtestsvc4")
.sku(SkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("GP_Gen5_2")
.tier("GeneralPurpose")
.build())
.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.DBforMariaDB.Server("server", new()
{
Location = "westus",
Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForReplicaArgs
{
CreateMode = "Replica",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
});
});
package main
import (
dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
Location: pulumi.String("westus"),
Properties: &dbformariadb.ServerPropertiesForReplicaArgs{
CreateMode: pulumi.String("Replica"),
SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
})
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.dbformariadb.Server;
import com.pulumi.azurenative.dbformariadb.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(ServerPropertiesForReplicaArgs.builder()
.createMode("Replica")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver")
.build())
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.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.DBforMariaDB.Server("server", new()
{
Location = "westus",
Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForGeoRestoreArgs
{
CreateMode = "GeoRestore",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
Sku = new AzureNative.DBforMariaDB.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforMariaDB.SkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
Location: pulumi.String("westus"),
Properties: &dbformariadb.ServerPropertiesForGeoRestoreArgs{
CreateMode: pulumi.String("GeoRestore"),
SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbformariadb.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbformariadb.SkuTierGeneralPurpose),
},
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.dbformariadb.Server;
import com.pulumi.azurenative.dbformariadb.ServerArgs;
import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
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(ServerPropertiesForGeoRestoreArgs.builder()
.createMode("GeoRestore")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver")
.build())
.resourceGroupName("TargetResourceGroup")
.serverName("targetserver")
.sku(SkuArgs.builder()
.capacity(2)
.family("Gen5")
.name("GP_Gen5_2")
.tier("GeneralPurpose")
.build())
.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:dbformariadb:Server targetserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}

Constructors

Link copied to clipboard
constructor(location: Output<String>? = null, properties: Output<Any>? = null, resourceGroupName: Output<String>? = null, serverName: Output<String>? = null, sku: Output<SkuArgs>? = null, tags: Output<Map<String, String>>? = null)

Properties

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

The location the resource resides in.

Link copied to clipboard
val properties: Output<Any>? = null

Properties of the server.

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

The name of the resource group. The name is case insensitive.

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

The name of the server.

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

The SKU (pricing tier) of the server.

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

Application-specific metadata in the form of key-value pairs.

Functions

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