// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.sql;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.sql.ActiveDirectoryAdministratorArgs;
import com.pulumi.azure.sql.inputs.ActiveDirectoryAdministratorState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import javax.annotation.Nullable;

/**
 * Allows you to set a user or group as the AD administrator for an Azure SQL server.
 * 
 * &gt; **Note:** The `azure.sql.ActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azuread_administrator` block of the `azure.mssql.Server` resource instead.
 * 
 * ## Example Usage
 * ```java
 * 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.sql.SqlServer;
 * import com.pulumi.azure.sql.SqlServerArgs;
 * import com.pulumi.azure.sql.ActiveDirectoryAdministrator;
 * import com.pulumi.azure.sql.ActiveDirectoryAdministratorArgs;
 * 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(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleSqlServer = new SqlServer(&#34;exampleSqlServer&#34;, SqlServerArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .version(&#34;12.0&#34;)
 *             .administratorLogin(&#34;4dm1n157r470r&#34;)
 *             .administratorLoginPassword(&#34;4-v3ry-53cr37-p455w0rd&#34;)
 *             .build());
 * 
 *         var exampleActiveDirectoryAdministrator = new ActiveDirectoryAdministrator(&#34;exampleActiveDirectoryAdministrator&#34;, ActiveDirectoryAdministratorArgs.builder()        
 *             .serverName(exampleSqlServer.name())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .login(&#34;sqladmin&#34;)
 *             .tenantId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.tenantId()))
 *             .objectId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.objectId()))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * A SQL Active Directory Administrator can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:sql/activeDirectoryAdministrator:ActiveDirectoryAdministrator administrator /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/administrators/activeDirectory
 * ```
 * 
 */
@ResourceType(type="azure:sql/activeDirectoryAdministrator:ActiveDirectoryAdministrator")
public class ActiveDirectoryAdministrator extends com.pulumi.resources.CustomResource {
    /**
     * Specifies whether only AD Users and administrators can be used to login (`true`) or also local database users (`false`).
     * 
     */
    @Export(name="azureadAuthenticationOnly", refs={Boolean.class}, tree="[0]")
    private Output<Boolean> azureadAuthenticationOnly;

    /**
     * @return Specifies whether only AD Users and administrators can be used to login (`true`) or also local database users (`false`).
     * 
     */
    public Output<Boolean> azureadAuthenticationOnly() {
        return this.azureadAuthenticationOnly;
    }
    /**
     * The login name of the principal to set as the server administrator
     * 
     */
    @Export(name="login", refs={String.class}, tree="[0]")
    private Output<String> login;

    /**
     * @return The login name of the principal to set as the server administrator
     * 
     */
    public Output<String> login() {
        return this.login;
    }
    /**
     * The ID of the principal to set as the server administrator
     * 
     */
    @Export(name="objectId", refs={String.class}, tree="[0]")
    private Output<String> objectId;

    /**
     * @return The ID of the principal to set as the server administrator
     * 
     */
    public Output<String> objectId() {
        return this.objectId;
    }
    /**
     * The name of the resource group for the SQL server. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group for the SQL server. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * The name of the SQL Server on which to set the administrator. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="serverName", refs={String.class}, tree="[0]")
    private Output<String> serverName;

    /**
     * @return The name of the SQL Server on which to set the administrator. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> serverName() {
        return this.serverName;
    }
    /**
     * The Azure Tenant ID
     * 
     */
    @Export(name="tenantId", refs={String.class}, tree="[0]")
    private Output<String> tenantId;

    /**
     * @return The Azure Tenant ID
     * 
     */
    public Output<String> tenantId() {
        return this.tenantId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ActiveDirectoryAdministrator(String name) {
        this(name, ActiveDirectoryAdministratorArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ActiveDirectoryAdministrator(String name, ActiveDirectoryAdministratorArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public ActiveDirectoryAdministrator(String name, ActiveDirectoryAdministratorArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:sql/activeDirectoryAdministrator:ActiveDirectoryAdministrator", name, args == null ? ActiveDirectoryAdministratorArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ActiveDirectoryAdministrator(String name, Output<String> id, @Nullable ActiveDirectoryAdministratorState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:sql/activeDirectoryAdministrator:ActiveDirectoryAdministrator", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static ActiveDirectoryAdministrator get(String name, Output<String> id, @Nullable ActiveDirectoryAdministratorState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ActiveDirectoryAdministrator(name, id, state, options);
    }
}
