com.pulumi.azure.sql.kotlin.ManagedInstanceActiveDirectoryAdministrator.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.sql.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [ManagedInstanceActiveDirectoryAdministrator].
*/
@PulumiTagMarker
public class ManagedInstanceActiveDirectoryAdministratorResourceBuilder internal constructor() {
public var name: String? = null
public var args: ManagedInstanceActiveDirectoryAdministratorArgs =
ManagedInstanceActiveDirectoryAdministratorArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend
fun args(block: suspend ManagedInstanceActiveDirectoryAdministratorArgsBuilder.() -> Unit) {
val builder = ManagedInstanceActiveDirectoryAdministratorArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): ManagedInstanceActiveDirectoryAdministrator {
val builtJavaResource =
com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministrator(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ManagedInstanceActiveDirectoryAdministrator(builtJavaResource)
}
}
/**
* Allows you to set a user or group as the AD administrator for an Azure SQL Managed Instance.
* > **Note:** The `azure.sql.ManagedInstanceActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstanceActiveDirectoryAdministrator` resource instead.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "rg-example",
* location: "West Europe",
* });
* const exampleManagedInstance = new azure.sql.ManagedInstance("example", {
* name: "managedsqlinstance",
* resourceGroupName: example.name,
* location: example.location,
* administratorLogin: "mradministrator",
* administratorLoginPassword: "thisIsDog11",
* licenseType: "BasePrice",
* subnetId: exampleAzurermSubnet.id,
* skuName: "GP_Gen5",
* vcores: 4,
* storageSizeInGb: 32,
* });
* const current = azure.core.getClientConfig({});
* const exampleManagedInstanceActiveDirectoryAdministrator = new azure.sql.ManagedInstanceActiveDirectoryAdministrator("example", {
* managedInstanceName: exampleManagedInstance.name,
* resourceGroupName: example.name,
* login: "sqladmin",
* tenantId: current.then(current => current.tenantId),
* objectId: current.then(current => current.objectId),
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="rg-example",
* location="West Europe")
* example_managed_instance = azure.sql.ManagedInstance("example",
* name="managedsqlinstance",
* resource_group_name=example.name,
* location=example.location,
* administrator_login="mradministrator",
* administrator_login_password="thisIsDog11",
* license_type="BasePrice",
* subnet_id=example_azurerm_subnet["id"],
* sku_name="GP_Gen5",
* vcores=4,
* storage_size_in_gb=32)
* current = azure.core.get_client_config()
* example_managed_instance_active_directory_administrator = azure.sql.ManagedInstanceActiveDirectoryAdministrator("example",
* managed_instance_name=example_managed_instance.name,
* resource_group_name=example.name,
* login="sqladmin",
* tenant_id=current.tenant_id,
* object_id=current.object_id)
* ```
* ```csharp
* 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 = "rg-example",
* Location = "West Europe",
* });
* var exampleManagedInstance = new Azure.Sql.ManagedInstance("example", new()
* {
* Name = "managedsqlinstance",
* ResourceGroupName = example.Name,
* Location = example.Location,
* AdministratorLogin = "mradministrator",
* AdministratorLoginPassword = "thisIsDog11",
* LicenseType = "BasePrice",
* SubnetId = exampleAzurermSubnet.Id,
* SkuName = "GP_Gen5",
* Vcores = 4,
* StorageSizeInGb = 32,
* });
* var current = Azure.Core.GetClientConfig.Invoke();
* var exampleManagedInstanceActiveDirectoryAdministrator = new Azure.Sql.ManagedInstanceActiveDirectoryAdministrator("example", new()
* {
* ManagedInstanceName = exampleManagedInstance.Name,
* ResourceGroupName = example.Name,
* Login = "sqladmin",
* TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId),
* ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
* });
* });
* ```
* ```go
* 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/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("rg-example"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleManagedInstance, err := sql.NewManagedInstance(ctx, "example", &sql.ManagedInstanceArgs{
* Name: pulumi.String("managedsqlinstance"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* AdministratorLogin: pulumi.String("mradministrator"),
* AdministratorLoginPassword: pulumi.String("thisIsDog11"),
* LicenseType: pulumi.String("BasePrice"),
* SubnetId: pulumi.Any(exampleAzurermSubnet.Id),
* SkuName: pulumi.String("GP_Gen5"),
* Vcores: pulumi.Int(4),
* StorageSizeInGb: pulumi.Int(32),
* })
* if err != nil {
* return err
* }
* current, err := core.GetClientConfig(ctx, nil, nil)
* if err != nil {
* return err
* }
* _, err = sql.NewManagedInstanceActiveDirectoryAdministrator(ctx, "example", &sql.ManagedInstanceActiveDirectoryAdministratorArgs{
* ManagedInstanceName: exampleManagedInstance.Name,
* ResourceGroupName: example.Name,
* Login: pulumi.String("sqladmin"),
* TenantId: pulumi.String(current.TenantId),
* ObjectId: pulumi.String(current.ObjectId),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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.sql.ManagedInstance;
* import com.pulumi.azure.sql.ManagedInstanceArgs;
* import com.pulumi.azure.core.CoreFunctions;
* import com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministrator;
* import com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministratorArgs;
* 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("rg-example")
* .location("West Europe")
* .build());
* var exampleManagedInstance = new ManagedInstance("exampleManagedInstance", ManagedInstanceArgs.builder()
* .name("managedsqlinstance")
* .resourceGroupName(example.name())
* .location(example.location())
* .administratorLogin("mradministrator")
* .administratorLoginPassword("thisIsDog11")
* .licenseType("BasePrice")
* .subnetId(exampleAzurermSubnet.id())
* .skuName("GP_Gen5")
* .vcores(4)
* .storageSizeInGb(32)
* .build());
* final var current = CoreFunctions.getClientConfig();
* var exampleManagedInstanceActiveDirectoryAdministrator = new ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", ManagedInstanceActiveDirectoryAdministratorArgs.builder()
* .managedInstanceName(exampleManagedInstance.name())
* .resourceGroupName(example.name())
* .login("sqladmin")
* .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
* .objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: rg-example
* location: West Europe
* exampleManagedInstance:
* type: azure:sql:ManagedInstance
* name: example
* properties:
* name: managedsqlinstance
* resourceGroupName: ${example.name}
* location: ${example.location}
* administratorLogin: mradministrator
* administratorLoginPassword: thisIsDog11
* licenseType: BasePrice
* subnetId: ${exampleAzurermSubnet.id}
* skuName: GP_Gen5
* vcores: 4
* storageSizeInGb: 32
* exampleManagedInstanceActiveDirectoryAdministrator:
* type: azure:sql:ManagedInstanceActiveDirectoryAdministrator
* name: example
* properties:
* managedInstanceName: ${exampleManagedInstance.name}
* resourceGroupName: ${example.name}
* login: sqladmin
* tenantId: ${current.tenantId}
* objectId: ${current.objectId}
* variables:
* current:
* fn::invoke:
* Function: azure:core:getClientConfig
* Arguments: {}
* ```
*
* ## Import
* A SQL Active Directory Administrator can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:sql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator administrator /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/managedInstances/mymanagedinstance/administrators/activeDirectory
* ```
*/
public class ManagedInstanceActiveDirectoryAdministrator internal constructor(
override val javaResource: com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministrator,
) : KotlinCustomResource(javaResource, ManagedInstanceActiveDirectoryAdministratorMapper) {
/**
* Specifies whether only AD Users and administrators can be used to login (`true`) or also local database users (`false`). Defaults to `false`.
*/
public val azureadAuthenticationOnly: Output?
get() = javaResource.azureadAuthenticationOnly().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The login name of the principal to set as the Managed Instance administrator
*/
public val login: Output
get() = javaResource.login().applyValue({ args0 -> args0 })
/**
* The name of the SQL Managed Instance on which to set the administrator. Changing this forces a new resource to be created.
*/
public val managedInstanceName: Output
get() = javaResource.managedInstanceName().applyValue({ args0 -> args0 })
/**
* The ID of the principal to set as the Managed Instance administrator
*/
public val objectId: Output
get() = javaResource.objectId().applyValue({ args0 -> args0 })
/**
* The name of the resource group for the SQL Managed Instance. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* The Azure Tenant ID
*/
public val tenantId: Output
get() = javaResource.tenantId().applyValue({ args0 -> args0 })
}
public object ManagedInstanceActiveDirectoryAdministratorMapper :
ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministrator::class == javaResource::class
override fun map(javaResource: Resource): ManagedInstanceActiveDirectoryAdministrator =
ManagedInstanceActiveDirectoryAdministrator(
javaResource as
com.pulumi.azure.sql.ManagedInstanceActiveDirectoryAdministrator,
)
}
/**
* @see [ManagedInstanceActiveDirectoryAdministrator].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ManagedInstanceActiveDirectoryAdministrator].
*/
public suspend fun managedInstanceActiveDirectoryAdministrator(
name: String,
block: suspend ManagedInstanceActiveDirectoryAdministratorResourceBuilder.() -> Unit,
):
ManagedInstanceActiveDirectoryAdministrator {
val builder = ManagedInstanceActiveDirectoryAdministratorResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ManagedInstanceActiveDirectoryAdministrator].
* @param name The _unique_ name of the resulting resource.
*/
public fun managedInstanceActiveDirectoryAdministrator(name: String):
ManagedInstanceActiveDirectoryAdministrator {
val builder = ManagedInstanceActiveDirectoryAdministratorResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy