Server
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}
Properties
The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
The Azure API version of the resource.
Earliest restore point creation time (ISO8601 format)
The fully qualified domain name of a server.
The master server id of a replica server.
Enforce a minimal Tls version for the server.
List of private endpoint connections on a server
Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
The maximum number of replicas that a master server can have.
The replication role of the server.
The SKU (pricing tier) of the server.
Enable ssl enforcement or not when connect to server.
Storage profile of a server.
A state of a server that is visible to user.