All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.mssql.ManagedInstanceActiveDirectoryAdministrator Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.10.0-alpha.1731737215
Show newest version
// *** 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.mssql;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.mssql.ManagedInstanceActiveDirectoryAdministratorArgs;
import com.pulumi.azure.mssql.inputs.ManagedInstanceActiveDirectoryAdministratorState;
import com.pulumi.core.Alias;
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 java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Allows you to set a user, group or service principal as the AAD Administrator for an Azure SQL Managed Instance.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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.core.CoreFunctions;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.Subnet;
 * import com.pulumi.azure.network.SubnetArgs;
 * import com.pulumi.azure.mssql.ManagedInstance;
 * import com.pulumi.azure.mssql.ManagedInstanceArgs;
 * import com.pulumi.azure.mssql.inputs.ManagedInstanceIdentityArgs;
 * import com.pulumi.azuread.DirectoryRole;
 * import com.pulumi.azuread.DirectoryRoleArgs;
 * import com.pulumi.azuread.DirectoryRoleMember;
 * import com.pulumi.azuread.DirectoryRoleMemberArgs;
 * import com.pulumi.azuread.User;
 * import com.pulumi.azuread.UserArgs;
 * import com.pulumi.azure.mssql.ManagedInstanceActiveDirectoryAdministrator;
 * import com.pulumi.azure.mssql.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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("rg-example")
 *             .location("West Europe")
 *             .build());
 * 
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .addressSpaces("10.0.0.0/16")
 *             .build());
 * 
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes("10.0.2.0/24")
 *             .build());
 * 
 *         var exampleManagedInstance = new ManagedInstance("exampleManagedInstance", ManagedInstanceArgs.builder()
 *             .name("managedsqlinstance")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .licenseType("BasePrice")
 *             .skuName("GP_Gen5")
 *             .storageSizeInGb(32)
 *             .subnetId(exampleSubnet.id())
 *             .vcores(4)
 *             .administratorLogin("msadministrator")
 *             .administratorLoginPassword("thisIsDog11")
 *             .identity(ManagedInstanceIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 * 
 *         var reader = new DirectoryRole("reader", DirectoryRoleArgs.builder()
 *             .displayName("Directory Readers")
 *             .build());
 * 
 *         var exampleDirectoryRoleMember = new DirectoryRoleMember("exampleDirectoryRoleMember", DirectoryRoleMemberArgs.builder()
 *             .roleObjectId(reader.objectId())
 *             .memberObjectId(exampleManagedInstance.identity().applyValue(identity -> identity.principalId()))
 *             .build());
 * 
 *         var admin = new User("admin", UserArgs.builder()
 *             .userPrincipalName("ms.admin}{@literal @}{@code example.com")
 *             .displayName("Ms Admin")
 *             .mailNickname("ms.admin")
 *             .password("SecretP}{@literal @}{@code sswd99!")
 *             .build());
 * 
 *         var exampleManagedInstanceActiveDirectoryAdministrator = new ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", ManagedInstanceActiveDirectoryAdministratorArgs.builder()
 *             .managedInstanceId(exampleManagedInstance.id())
 *             .loginUsername("msadmin")
 *             .objectId(admin.objectId())
 *             .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * An Azure SQL Active Directory Administrator can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:mssql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator administrator /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/managedInstances/mymanagedinstance/administrators/activeDirectory * ``` * */ @ResourceType(type="azure:mssql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator") public class ManagedInstanceActiveDirectoryAdministrator extends com.pulumi.resources.CustomResource { /** * When `true`, only permit logins from AAD users and administrators. When `false`, also allow local database users. * */ @Export(name="azureadAuthenticationOnly", refs={Boolean.class}, tree="[0]") private Output azureadAuthenticationOnly; /** * @return When `true`, only permit logins from AAD users and administrators. When `false`, also allow local database users. * */ public Output> azureadAuthenticationOnly() { return Codegen.optional(this.azureadAuthenticationOnly); } /** * The login name of the principal to set as the Managed Instance Administrator. * */ @Export(name="loginUsername", refs={String.class}, tree="[0]") private Output loginUsername; /** * @return The login name of the principal to set as the Managed Instance Administrator. * */ public Output loginUsername() { return this.loginUsername; } /** * The ID of the Azure SQL Managed Instance for which to set the administrator. Changing this forces a new resource to be created. * */ @Export(name="managedInstanceId", refs={String.class}, tree="[0]") private Output managedInstanceId; /** * @return The ID of the Azure SQL Managed Instance for which to set the administrator. Changing this forces a new resource to be created. * */ public Output managedInstanceId() { return this.managedInstanceId; } /** * The Object ID of the principal to set as the Managed Instance Administrator. * */ @Export(name="objectId", refs={String.class}, tree="[0]") private Output objectId; /** * @return The Object ID of the principal to set as the Managed Instance Administrator. * */ public Output objectId() { return this.objectId; } /** * The Azure Active Directory Tenant ID. * */ @Export(name="tenantId", refs={String.class}, tree="[0]") private Output tenantId; /** * @return The Azure Active Directory Tenant ID. * */ public Output tenantId() { return this.tenantId; } /** * * @param name The _unique_ name of the resulting resource. */ public ManagedInstanceActiveDirectoryAdministrator(java.lang.String name) { this(name, ManagedInstanceActiveDirectoryAdministratorArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ManagedInstanceActiveDirectoryAdministrator(java.lang.String name, ManagedInstanceActiveDirectoryAdministratorArgs 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 ManagedInstanceActiveDirectoryAdministrator(java.lang.String name, ManagedInstanceActiveDirectoryAdministratorArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:mssql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ManagedInstanceActiveDirectoryAdministrator(java.lang.String name, Output id, @Nullable ManagedInstanceActiveDirectoryAdministratorState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:mssql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator", name, state, makeResourceOptions(options, id), false); } private static ManagedInstanceActiveDirectoryAdministratorArgs makeArgs(ManagedInstanceActiveDirectoryAdministratorArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ManagedInstanceActiveDirectoryAdministratorArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure:sql/managedInstanceActiveDirectoryAdministrator:ManagedInstanceActiveDirectoryAdministrator").build()) )) .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 ManagedInstanceActiveDirectoryAdministrator get(java.lang.String name, Output id, @Nullable ManagedInstanceActiveDirectoryAdministratorState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ManagedInstanceActiveDirectoryAdministrator(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy