Server

class Server : KotlinCustomResource

Manages a Microsoft SQL Azure Database Server.

Example Usage

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.mssql.Server;
import com.pulumi.azure.mssql.ServerArgs;
import com.pulumi.azure.mssql.inputs.ServerAzureadAdministratorArgs;
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 exampleServer = new Server("exampleServer", ServerArgs.builder()
.name("mssqlserver")
.resourceGroupName(example.name())
.location(example.location())
.version("12.0")
.administratorLogin("missadministrator")
.administratorLoginPassword("thisIsKat11")
.minimumTlsVersion("1.2")
.azureadAdministrator(ServerAzureadAdministratorArgs.builder()
.loginUsername("AzureAD Admin")
.objectId("00000000-0000-0000-0000-000000000000")
.build())
.tags(Map.of("environment", "production"))
.build());
}
}

Transparent Data Encryption(TDE) With A Customer Managed Key(CMK) During Create

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.authorization.UserAssignedIdentity;
import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
import com.pulumi.azure.keyvault.KeyVault;
import com.pulumi.azure.keyvault.KeyVaultArgs;
import com.pulumi.azure.keyvault.inputs.KeyVaultAccessPolicyArgs;
import com.pulumi.azure.keyvault.Key;
import com.pulumi.azure.keyvault.KeyArgs;
import com.pulumi.azure.mssql.Server;
import com.pulumi.azure.mssql.ServerArgs;
import com.pulumi.azure.mssql.inputs.ServerAzureadAdministratorArgs;
import com.pulumi.azure.mssql.inputs.ServerIdentityArgs;
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) {
final var current = CoreFunctions.getClientConfig();
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
.name("example-admin")
.location(example.location())
.resourceGroupName(example.name())
.build());
var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
.name("mssqltdeexample")
.location(example.location())
.resourceGroupName(example.name())
.enabledForDiskEncryption(true)
.tenantId(exampleUserAssignedIdentity.tenantId())
.softDeleteRetentionDays(7)
.purgeProtectionEnabled(true)
.skuName("standard")
.accessPolicies(
KeyVaultAccessPolicyArgs.builder()
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
.keyPermissions(
"Get",
"List",
"Create",
"Delete",
"Update",
"Recover",
"Purge",
"GetRotationPolicy")
.build(),
KeyVaultAccessPolicyArgs.builder()
.tenantId(exampleUserAssignedIdentity.tenantId())
.objectId(exampleUserAssignedIdentity.principalId())
.keyPermissions(
"Get",
"WrapKey",
"UnwrapKey")
.build())
.build());
var exampleKey = new Key("exampleKey", KeyArgs.builder()
.name("example-key")
.keyVaultId(exampleKeyVault.id())
.keyType("RSA")
.keySize(2048)
.keyOpts(
"unwrapKey",
"wrapKey")
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.name("example-resource")
.resourceGroupName(example.name())
.location(example.location())
.version("12.0")
.administratorLogin("Example-Administrator")
.administratorLoginPassword("Example_Password!")
.minimumTlsVersion("1.2")
.azureadAdministrator(ServerAzureadAdministratorArgs.builder()
.loginUsername(exampleUserAssignedIdentity.name())
.objectId(exampleUserAssignedIdentity.principalId())
.build())
.identity(ServerIdentityArgs.builder()
.type("UserAssigned")
.identityIds(exampleUserAssignedIdentity.id())
.build())
.primaryUserAssignedIdentityId(exampleUserAssignedIdentity.id())
.transparentDataEncryptionKeyVaultKeyId(exampleKey.id())
.build());
}
}

Import

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

$ pulumi import azure:mssql/server:Server example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver

Properties

Link copied to clipboard

The administrator login name for the new server. Required unless azuread_authentication_only in the azuread_administrator block is true. When omitted, Azure will generate a default username which cannot be subsequently changed. Changing this forces a new resource to be created.

Link copied to clipboard

The password associated with the administrator_login user. Needs to comply with Azure's Password Policy. Required unless azuread_authentication_only in the azuread_administrator block is true.

Link copied to clipboard

An azuread_administrator block as defined below.

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

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

Link copied to clipboard

The fully qualified domain name of the Azure SQL Server (e.g. myServerName.database.windows.net)

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val identity: Output<ServerIdentity>?

An identity block as defined below.

Link copied to clipboard
val location: Output<String>

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

Link copied to clipboard

The Minimum TLS Version for all SQL Database and SQL Data Warehouse databases associated with the server. Valid values are: 1.0, 1.1 , 1.2 and Disabled. Defaults to 1.2.

Link copied to clipboard
val name: Output<String>

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

Whether outbound network traffic is restricted for this server. Defaults to false.

Link copied to clipboard

Specifies the primary user managed identity id. Required if type is UserAssigned and should be combined with identity_ids.

Link copied to clipboard

Whether public network access is allowed for this server. Defaults to true.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

A list of dropped restorable database IDs on the server.

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

A mapping of tags to assign to the resource.

Link copied to clipboard

The fully versioned Key Vault Key URL (e.g. 'https://<YourVaultName>.vault.azure.net/keys/<YourKeyName>/<YourKeyVersion>) to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>

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.