ServerArgs

data class ServerArgs(val administratorLogin: Output<String>? = null, val administratorLoginPassword: Output<String>? = null, val availabilityZone: Output<String>? = null, val backup: Output<BackupArgs>? = null, val createMode: Output<Either<String, CreateMode>>? = null, val dataEncryption: Output<DataEncryptionArgs>? = null, val highAvailability: Output<HighAvailabilityArgs>? = null, val identity: Output<IdentityArgs>? = null, val location: Output<String>? = null, val maintenanceWindow: Output<MaintenanceWindowArgs>? = null, val network: Output<NetworkArgs>? = null, val replicationRole: Output<Either<String, ReplicationRole>>? = null, val resourceGroupName: Output<String>? = null, val restorePointInTime: Output<String>? = null, val serverName: Output<String>? = null, val sku: Output<SkuArgs>? = null, val sourceServerResourceId: Output<String>? = null, val storage: Output<StorageArgs>? = null, val tags: Output<Map<String, String>>? = null, val version: Output<Either<String, ServerVersion>>? = null) : ConvertibleToJava<ServerArgs>

Represents a server. Uses Azure REST API version 2022-01-01. In version 1.x of the Azure Native provider, it used API version 2017-12-01. Other available API versions: 2017-12-01, 2018-06-01-privatepreview, 2020-07-01-preview, 2020-07-01-privatepreview, 2022-09-30-preview, 2023-06-01-preview, 2023-06-30, 2023-10-01-preview, 2023-12-01-preview, 2023-12-30, 2024-02-01-preview, 2024-06-01-preview, 2024-10-01-preview.

Example Usage

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.DBforMySQL.Server("server", new()
{
AdministratorLogin = "cloudsa",
AdministratorLoginPassword = "your_password",
AvailabilityZone = "1",
Backup = new AzureNative.DBforMySQL.Inputs.BackupArgs
{
BackupRetentionDays = 7,
GeoRedundantBackup = AzureNative.DBforMySQL.EnableStatusEnum.Disabled,
},
CreateMode = AzureNative.DBforMySQL.CreateMode.Default,
HighAvailability = new AzureNative.DBforMySQL.Inputs.HighAvailabilityArgs
{
Mode = AzureNative.DBforMySQL.HighAvailabilityMode.ZoneRedundant,
StandbyAvailabilityZone = "3",
},
Location = "southeastasia",
ResourceGroupName = "testrg",
ServerName = "mysqltestserver",
Sku = new AzureNative.DBforMySQL.Inputs.SkuArgs
{
Name = "Standard_D2ds_v4",
Tier = AzureNative.DBforMySQL.SkuTier.GeneralPurpose,
},
Storage = new AzureNative.DBforMySQL.Inputs.StorageArgs
{
AutoGrow = AzureNative.DBforMySQL.EnableStatusEnum.Disabled,
Iops = 600,
StorageSizeGB = 100,
},
Tags =
{
{ "num", "1" },
},
Version = AzureNative.DBforMySQL.ServerVersion.ServerVersion_5_7,
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewServer(ctx, "server", &dbformysql.ServerArgs{
AdministratorLogin: pulumi.String("cloudsa"),
AdministratorLoginPassword: pulumi.String("your_password"),
AvailabilityZone: pulumi.String("1"),
Backup: &dbformysql.BackupArgs{
BackupRetentionDays: pulumi.Int(7),
GeoRedundantBackup: pulumi.String(dbformysql.EnableStatusEnumDisabled),
},
CreateMode: pulumi.String(dbformysql.CreateModeDefault),
HighAvailability: &dbformysql.HighAvailabilityArgs{
Mode: pulumi.String(dbformysql.HighAvailabilityModeZoneRedundant),
StandbyAvailabilityZone: pulumi.String("3"),
},
Location: pulumi.String("southeastasia"),
ResourceGroupName: pulumi.String("testrg"),
ServerName: pulumi.String("mysqltestserver"),
Sku: &dbformysql.SkuArgs{
Name: pulumi.String("Standard_D2ds_v4"),
Tier: pulumi.String(dbformysql.SkuTierGeneralPurpose),
},
Storage: &dbformysql.StorageArgs{
AutoGrow: pulumi.String(dbformysql.EnableStatusEnumDisabled),
Iops: pulumi.Int(600),
StorageSizeGB: pulumi.Int(100),
},
Tags: pulumi.StringMap{
"num": pulumi.String("1"),
},
Version: pulumi.String(dbformysql.ServerVersion_5_7),
})
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.Server;
import com.pulumi.azurenative.dbformysql.ServerArgs;
import com.pulumi.azurenative.dbformysql.inputs.BackupArgs;
import com.pulumi.azurenative.dbformysql.inputs.HighAvailabilityArgs;
import com.pulumi.azurenative.dbformysql.inputs.SkuArgs;
import com.pulumi.azurenative.dbformysql.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("your_password")
.availabilityZone("1")
.backup(BackupArgs.builder()
.backupRetentionDays(7)
.geoRedundantBackup("Disabled")
.build())
.createMode("Default")
.highAvailability(HighAvailabilityArgs.builder()
.mode("ZoneRedundant")
.standbyAvailabilityZone("3")
.build())
.location("southeastasia")
.resourceGroupName("testrg")
.serverName("mysqltestserver")
.sku(SkuArgs.builder()
.name("Standard_D2ds_v4")
.tier("GeneralPurpose")
.build())
.storage(StorageArgs.builder()
.autoGrow("Disabled")
.iops(600)
.storageSizeGB(100)
.build())
.tags(Map.of("num", "1"))
.version("5.7")
.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.DBforMySQL.Server("server", new()
{
CreateMode = AzureNative.DBforMySQL.CreateMode.Replica,
Location = "SoutheastAsia",
ResourceGroupName = "testgr",
ServerName = "replica-server",
SourceServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server",
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewServer(ctx, "server", &dbformysql.ServerArgs{
CreateMode: pulumi.String(dbformysql.CreateModeReplica),
Location: pulumi.String("SoutheastAsia"),
ResourceGroupName: pulumi.String("testgr"),
ServerName: pulumi.String("replica-server"),
SourceServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server"),
})
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.Server;
import com.pulumi.azurenative.dbformysql.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("SoutheastAsia")
.resourceGroupName("testgr")
.serverName("replica-server")
.sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server")
.build());
}
}

Create a server 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.DBforMySQL.Server("server", new()
{
CreateMode = AzureNative.DBforMySQL.CreateMode.PointInTimeRestore,
Location = "SoutheastAsia",
ResourceGroupName = "TargetResourceGroup",
RestorePointInTime = "2021-06-24T00:00:37.467Z",
ServerName = "targetserver",
Sku = new AzureNative.DBforMySQL.Inputs.SkuArgs
{
Name = "Standard_D14_v2",
Tier = AzureNative.DBforMySQL.SkuTier.GeneralPurpose,
},
SourceServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver",
Tags =
{
{ "num", "1" },
},
});
});
package main
import (
dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbformysql.NewServer(ctx, "server", &dbformysql.ServerArgs{
CreateMode: pulumi.String(dbformysql.CreateModePointInTimeRestore),
Location: pulumi.String("SoutheastAsia"),
ResourceGroupName: pulumi.String("TargetResourceGroup"),
RestorePointInTime: pulumi.String("2021-06-24T00:00:37.467Z"),
ServerName: pulumi.String("targetserver"),
Sku: &dbformysql.SkuArgs{
Name: pulumi.String("Standard_D14_v2"),
Tier: pulumi.String(dbformysql.SkuTierGeneralPurpose),
},
SourceServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver"),
Tags: pulumi.StringMap{
"num": 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.Server;
import com.pulumi.azurenative.dbformysql.ServerArgs;
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 server = new Server("server", ServerArgs.builder()
.createMode("PointInTimeRestore")
.location("SoutheastAsia")
.resourceGroupName("TargetResourceGroup")
.restorePointInTime("2021-06-24T00:00:37.467Z")
.serverName("targetserver")
.sku(SkuArgs.builder()
.name("Standard_D14_v2")
.tier("GeneralPurpose")
.build())
.sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver")
.tags(Map.of("num", "1"))
.build());
}
}

Import

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

$ pulumi import azure-native:dbformysql:Server mysqltestserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}

Constructors

Link copied to clipboard
constructor(administratorLogin: Output<String>? = null, administratorLoginPassword: Output<String>? = null, availabilityZone: Output<String>? = null, backup: Output<BackupArgs>? = null, createMode: Output<Either<String, CreateMode>>? = null, dataEncryption: Output<DataEncryptionArgs>? = null, highAvailability: Output<HighAvailabilityArgs>? = null, identity: Output<IdentityArgs>? = null, location: Output<String>? = null, maintenanceWindow: Output<MaintenanceWindowArgs>? = null, network: Output<NetworkArgs>? = null, replicationRole: Output<Either<String, ReplicationRole>>? = null, resourceGroupName: Output<String>? = null, restorePointInTime: Output<String>? = null, serverName: Output<String>? = null, sku: Output<SkuArgs>? = null, sourceServerResourceId: Output<String>? = null, storage: Output<StorageArgs>? = null, tags: Output<Map<String, String>>? = null, version: Output<Either<String, ServerVersion>>? = null)

Properties

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

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 administratorLoginPassword: Output<String>? = null

The password of the administrator login (required for server creation).

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

availability Zone information of the server.

Link copied to clipboard
val backup: Output<BackupArgs>? = null

Backup related properties of a server.

Link copied to clipboard
val createMode: Output<Either<String, CreateMode>>? = null

The mode to create a new MySQL server.

Link copied to clipboard
val dataEncryption: Output<DataEncryptionArgs>? = null

The Data Encryption for CMK.

Link copied to clipboard

High availability related properties of a server.

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

The cmk identity for the server.

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

The geo-location where the resource lives

Link copied to clipboard

Maintenance window of a server.

Link copied to clipboard
val network: Output<NetworkArgs>? = null

Network related properties of a server.

Link copied to clipboard
val replicationRole: Output<Either<String, ReplicationRole>>? = null

The replication role.

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 restorePointInTime: Output<String>? = null

Restore point creation time (ISO8601 format), specifying the time to restore from.

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 sourceServerResourceId: Output<String>? = null

The source MySQL server id.

Link copied to clipboard
val storage: Output<StorageArgs>? = null

Storage related properties of a server.

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

Resource tags.

Link copied to clipboard
val version: Output<Either<String, ServerVersion>>? = null

Server version.

Functions

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