ServerArgs

data class ServerArgs(val administratorLogin: Output<String>? = null, val administratorLoginPassword: Output<String>? = null, val azureadAdministrator: Output<ServerAzureadAdministratorArgs>? = null, val connectionPolicy: Output<String>? = null, val identity: Output<ServerIdentityArgs>? = null, val location: Output<String>? = null, val minimumTlsVersion: Output<String>? = null, val name: Output<String>? = null, val outboundNetworkRestrictionEnabled: Output<Boolean>? = null, val primaryUserAssignedIdentityId: Output<String>? = null, val publicNetworkAccessEnabled: Output<Boolean>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val transparentDataEncryptionKeyVaultKeyId: Output<String>? = null, val version: Output<String>? = null) : ConvertibleToJava<ServerArgs>

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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.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 com.pulumi.resources.CustomResourceOptions;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.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()
.keyVaultId(exampleKeyVault.id())
.keyType("RSA")
.keySize(2048)
.keyOpts(
"unwrapKey",
"wrapKey")
.build(), CustomResourceOptions.builder()
.dependsOn(exampleKeyVault)
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.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

Constructors

Link copied to clipboard
fun ServerArgs(administratorLogin: Output<String>? = null, administratorLoginPassword: Output<String>? = null, azureadAdministrator: Output<ServerAzureadAdministratorArgs>? = null, connectionPolicy: Output<String>? = null, identity: Output<ServerIdentityArgs>? = null, location: Output<String>? = null, minimumTlsVersion: Output<String>? = null, name: Output<String>? = null, outboundNetworkRestrictionEnabled: Output<Boolean>? = null, primaryUserAssignedIdentityId: Output<String>? = null, publicNetworkAccessEnabled: Output<Boolean>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, transparentDataEncryptionKeyVaultKeyId: Output<String>? = null, version: Output<String>? = null)

Functions

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

Properties

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

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

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

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>? = 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

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
val publicNetworkAccessEnabled: Output<Boolean>? = null

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

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

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 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.