SingleServerArgs

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<SkuArgs>? = 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.DBforMySQL.SingleServer("singleServer", new()
{
Location = "brazilsouth",
Properties = new AzureNative.DBforMySQL.Inputs.ServerPropertiesForRestoreArgs
{
CreateMode = "PointInTimeRestore",
RestorePointInTime = "2017-12-14T00:00:37.467Z",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
Sku = new AzureNative.DBforMySQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforMySQL.SingleServerSkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewSingleServer(ctx, "singleServer", &dbformysql.SingleServerArgs{
Location: pulumi.String("brazilsouth"),
Properties: &dbformysql.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.DBforMySQL/servers/sourceserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbformysql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbformysql.SingleServerSkuTierGeneralPurpose),
},
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.dbformysql.SingleServer;
import com.pulumi.azurenative.dbformysql.SingleServerArgs;
import com.pulumi.azurenative.dbformysql.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 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.DBforMySQL/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 singleServer = new AzureNative.DBforMySQL.SingleServer("singleServer", new()
{
Location = "westus",
Properties = new AzureNative.DBforMySQL.Inputs.ServerPropertiesForDefaultCreateArgs
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "<administratorLoginPassword>",
CreateMode = "Default",
SslEnforcement = AzureNative.DBforMySQL.SslEnforcementEnum.Enabled,
StorageProfile = new AzureNative.DBforMySQL.Inputs.StorageProfileArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = AzureNative.DBforMySQL.GeoRedundantBackup.Enabled,
StorageMB = 128000,
},
},
ResourceGroupName = "testrg",
ServerName = "mysqltestsvc4",
Sku = new AzureNative.DBforMySQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforMySQL.SingleServerSkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewSingleServer(ctx, "singleServer", &dbformysql.SingleServerArgs{
Location: pulumi.String("westus"),
Properties: &dbformysql.ServerPropertiesForDefaultCreateArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("<administratorLoginPassword>"),
CreateMode: pulumi.String("Default"),
SslEnforcement: dbformysql.SslEnforcementEnumEnabled,
StorageProfile: &dbformysql.StorageProfileArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbformysql.GeoRedundantBackupEnabled),
StorageMB: pulumi.Int(128000),
},
},
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("mysqltestsvc4"),
Sku: &dbformysql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbformysql.SingleServerSkuTierGeneralPurpose),
},
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.dbformysql.SingleServer;
import com.pulumi.azurenative.dbformysql.SingleServerArgs;
import com.pulumi.azurenative.dbformysql.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 singleServer = new SingleServer("singleServer", SingleServerArgs.builder()
.location("westus")
.properties(ServerPropertiesForDefaultCreateArgs.builder()
.administratorLogin("cloudsa")
.administratorLoginPassword("<administratorLoginPassword>")
.createMode("Default")
.sslEnforcement("Enabled")
.storageProfile(StorageProfileArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Enabled")
.storageMB(128000)
.build())
.build())
.resourceGroupName("testrg")
.serverName("mysqltestsvc4")
.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 singleServer = new AzureNative.DBforMySQL.SingleServer("singleServer", new()
{
Location = "westus",
Properties = new AzureNative.DBforMySQL.Inputs.ServerPropertiesForReplicaArgs
{
CreateMode = "Replica",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/servers/masterserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewSingleServer(ctx, "singleServer", &dbformysql.SingleServerArgs{
Location: pulumi.String("westus"),
Properties: &dbformysql.ServerPropertiesForReplicaArgs{
CreateMode: pulumi.String("Replica"),
SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/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.dbformysql.SingleServer;
import com.pulumi.azurenative.dbformysql.SingleServerArgs;
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(ServerPropertiesForReplicaArgs.builder()
.createMode("Replica")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMySQL/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 singleServer = new AzureNative.DBforMySQL.SingleServer("singleServer", new()
{
Location = "westus",
Properties = new AzureNative.DBforMySQL.Inputs.ServerPropertiesForGeoRestoreArgs
{
CreateMode = "GeoRestore",
SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver",
},
ResourceGroupName = "TargetResourceGroup",
ServerName = "targetserver",
Sku = new AzureNative.DBforMySQL.Inputs.SkuArgs
{
Capacity = 2,
Family = "Gen5",
Name = "GP_Gen5_2",
Tier = AzureNative.DBforMySQL.SingleServerSkuTier.GeneralPurpose,
},
Tags =
{
{ "ElasticServer", "1" },
},
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewSingleServer(ctx, "singleServer", &dbformysql.SingleServerArgs{
Location: pulumi.String("westus"),
Properties: &dbformysql.ServerPropertiesForGeoRestoreArgs{
CreateMode: pulumi.String("GeoRestore"),
SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/servers/sourceserver"),
},
ResourceGroupName: pulumi.String("TargetResourceGroup"),
ServerName: pulumi.String("targetserver"),
Sku: &dbformysql.SkuArgs{
Capacity: pulumi.Int(2),
Family: pulumi.String("Gen5"),
Name: pulumi.String("GP_Gen5_2"),
Tier: pulumi.String(dbformysql.SingleServerSkuTierGeneralPurpose),
},
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.dbformysql.SingleServer;
import com.pulumi.azurenative.dbformysql.SingleServerArgs;
import com.pulumi.azurenative.dbformysql.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 singleServer = new SingleServer("singleServer", SingleServerArgs.builder()
.location("westus")
.properties(ServerPropertiesForGeoRestoreArgs.builder()
.createMode("GeoRestore")
.sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/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:dbformysql:SingleServer targetserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}

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<SkuArgs>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val identity: Output<ResourceIdentityArgs>? = null

The Azure Active Directory identity of the server.

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(): SingleServerArgs