SqlServerArgs

data class SqlServerArgs(val administratorLogin: Output<String>? = null, val administratorLoginPassword: Output<String>? = null, val connectionPolicy: Output<String>? = null, val identity: Output<SqlServerIdentityArgs>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val threatDetectionPolicy: Output<SqlServerThreatDetectionPolicyArgs>? = null, val version: Output<String>? = null) : ConvertibleToJava<SqlServerArgs>

Manages a Microsoft SQL Azure Database Server.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "database-rg",
location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
name: "examplesa",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleSqlServer = new azure.sql.SqlServer("example", {
name: "mssqlserver",
resourceGroupName: example.name,
location: example.location,
version: "12.0",
administratorLogin: "mradministrator",
administratorLoginPassword: "thisIsDog11",
tags: {
environment: "production",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="database-rg",
location="West Europe")
example_account = azure.storage.Account("example",
name="examplesa",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
example_sql_server = azure.sql.SqlServer("example",
name="mssqlserver",
resource_group_name=example.name,
location=example.location,
version="12.0",
administrator_login="mradministrator",
administrator_login_password="thisIsDog11",
tags={
"environment": "production",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "database-rg",
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "examplesa",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleSqlServer = new Azure.Sql.SqlServer("example", new()
{
Name = "mssqlserver",
ResourceGroupName = example.Name,
Location = example.Location,
Version = "12.0",
AdministratorLogin = "mradministrator",
AdministratorLoginPassword = "thisIsDog11",
Tags =
{
{ "environment", "production" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("database-rg"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("examplesa"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
_, err = sql.NewSqlServer(ctx, "example", &sql.SqlServerArgs{
Name: pulumi.String("mssqlserver"),
ResourceGroupName: example.Name,
Location: example.Location,
Version: pulumi.String("12.0"),
AdministratorLogin: pulumi.String("mradministrator"),
AdministratorLoginPassword: pulumi.String("thisIsDog11"),
Tags: pulumi.StringMap{
"environment": pulumi.String("production"),
},
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.sql.SqlServer;
import com.pulumi.azure.sql.SqlServerArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("database-rg")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("examplesa")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
.name("mssqlserver")
.resourceGroupName(example.name())
.location(example.location())
.version("12.0")
.administratorLogin("mradministrator")
.administratorLoginPassword("thisIsDog11")
.tags(Map.of("environment", "production"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: database-rg
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: examplesa
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
exampleSqlServer:
type: azure:sql:SqlServer
name: example
properties:
name: mssqlserver
resourceGroupName: ${example.name}
location: ${example.location}
version: '12.0'
administratorLogin: mradministrator
administratorLoginPassword: thisIsDog11
tags:
environment: production

Import

SQL Servers can be imported using the resource id, e.g.

$ pulumi import azure:sql/sqlServer:SqlServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver

Constructors

Link copied to clipboard
constructor(administratorLogin: Output<String>? = null, administratorLoginPassword: Output<String>? = null, connectionPolicy: Output<String>? = null, identity: Output<SqlServerIdentityArgs>? = null, location: Output<String>? = null, name: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, threatDetectionPolicy: Output<SqlServerThreatDetectionPolicyArgs>? = null, version: Output<String>? = null)

Properties

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

The administrator login name for the new server. Changing this forces a new resource to be created.

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

The password associated with the administrator_login user. Needs to comply with Azure's Password Policy

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

The connection policy the server will use. Possible values are Default, Proxy, and Redirect. Defaults to Default.

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

An identity block as defined below.

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

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

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

The name of the Microsoft SQL Server. This needs to be globally unique within Azure. Changing this forces a new resource to be created.

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

The name of the resource group in which to create the Microsoft SQL Server. Changing this forces a new resource to be created.

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

A mapping of tags to assign to the resource.

Link copied to clipboard

Threat detection policy configuration. The threat_detection_policy block supports fields documented below.

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

The version for the new server. Valid values are: 2.0 (for v11 server) and 12.0 (for v12 server). Changing this forces a new resource to be created.

Functions

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