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

com.pulumi.azure.netapp.kotlin.AccountArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.netapp.kotlin

import com.pulumi.azure.netapp.AccountArgs.builder
import com.pulumi.azure.netapp.kotlin.inputs.AccountActiveDirectoryArgs
import com.pulumi.azure.netapp.kotlin.inputs.AccountActiveDirectoryArgsBuilder
import com.pulumi.azure.netapp.kotlin.inputs.AccountIdentityArgs
import com.pulumi.azure.netapp.kotlin.inputs.AccountIdentityArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a NetApp Account.
 * > **NOTE:** Azure allows only one active directory can be joined to a single subscription at a time for NetApp Account.
 * ## NetApp Account Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const current = azure.core.getClientConfig({});
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     name: "anf-user-assigned-identity",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleAccount = new azure.netapp.Account("example", {
 *     name: "netappaccount",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     activeDirectory: {
 *         username: "aduser",
 *         password: "aduserpwd",
 *         smbServerName: "SMBSERVER",
 *         dnsServers: ["1.2.3.4"],
 *         domain: "westcentralus.com",
 *         organizationalUnit: "OU=FirstLevel",
 *     },
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * current = azure.core.get_client_config()
 * example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
 *     name="anf-user-assigned-identity",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_account = azure.netapp.Account("example",
 *     name="netappaccount",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     active_directory=azure.netapp.AccountActiveDirectoryArgs(
 *         username="aduser",
 *         password="aduserpwd",
 *         smb_server_name="SMBSERVER",
 *         dns_servers=["1.2.3.4"],
 *         domain="westcentralus.com",
 *         organizational_unit="OU=FirstLevel",
 *     ),
 *     identity=azure.netapp.AccountIdentityArgs(
 *         type="UserAssigned",
 *         identity_ids=[example_user_assigned_identity.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 = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var current = Azure.Core.GetClientConfig.Invoke();
 *     var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
 *     {
 *         Name = "anf-user-assigned-identity",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleAccount = new Azure.NetApp.Account("example", new()
 *     {
 *         Name = "netappaccount",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ActiveDirectory = new Azure.NetApp.Inputs.AccountActiveDirectoryArgs
 *         {
 *             Username = "aduser",
 *             Password = "aduserpwd",
 *             SmbServerName = "SMBSERVER",
 *             DnsServers = new[]
 *             {
 *                 "1.2.3.4",
 *             },
 *             Domain = "westcentralus.com",
 *             OrganizationalUnit = "OU=FirstLevel",
 *         },
 *         Identity = new Azure.NetApp.Inputs.AccountIdentityArgs
 *         {
 *             Type = "UserAssigned",
 *             IdentityIds = new[]
 *             {
 *                 exampleUserAssignedIdentity.Id,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp"
 * 	"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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
 * 			Name:              pulumi.String("anf-user-assigned-identity"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = netapp.NewAccount(ctx, "example", &netapp.AccountArgs{
 * 			Name:              pulumi.String("netappaccount"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			ActiveDirectory: &netapp.AccountActiveDirectoryArgs{
 * 				Username:      pulumi.String("aduser"),
 * 				Password:      pulumi.String("aduserpwd"),
 * 				SmbServerName: pulumi.String("SMBSERVER"),
 * 				DnsServers: pulumi.StringArray{
 * 					pulumi.String("1.2.3.4"),
 * 				},
 * 				Domain:             pulumi.String("westcentralus.com"),
 * 				OrganizationalUnit: pulumi.String("OU=FirstLevel"),
 * 			},
 * 			Identity: &netapp.AccountIdentityArgs{
 * 				Type: pulumi.String("UserAssigned"),
 * 				IdentityIds: pulumi.StringArray{
 * 					exampleUserAssignedIdentity.ID(),
 * 				},
 * 			},
 * 		})
 * 		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.core.CoreFunctions;
 * import com.pulumi.azure.authorization.UserAssignedIdentity;
 * import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
 * import com.pulumi.azure.netapp.Account;
 * import com.pulumi.azure.netapp.AccountArgs;
 * import com.pulumi.azure.netapp.inputs.AccountActiveDirectoryArgs;
 * import com.pulumi.azure.netapp.inputs.AccountIdentityArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         final var current = CoreFunctions.getClientConfig();
 *         var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
 *             .name("anf-user-assigned-identity")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("netappaccount")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .activeDirectory(AccountActiveDirectoryArgs.builder()
 *                 .username("aduser")
 *                 .password("aduserpwd")
 *                 .smbServerName("SMBSERVER")
 *                 .dnsServers("1.2.3.4")
 *                 .domain("westcentralus.com")
 *                 .organizationalUnit("OU=FirstLevel")
 *                 .build())
 *             .identity(AccountIdentityArgs.builder()
 *                 .type("UserAssigned")
 *                 .identityIds(exampleUserAssignedIdentity.id())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleUserAssignedIdentity:
 *     type: azure:authorization:UserAssignedIdentity
 *     name: example
 *     properties:
 *       name: anf-user-assigned-identity
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleAccount:
 *     type: azure:netapp:Account
 *     name: example
 *     properties:
 *       name: netappaccount
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       activeDirectory:
 *         username: aduser
 *         password: aduserpwd
 *         smbServerName: SMBSERVER
 *         dnsServers:
 *           - 1.2.3.4
 *         domain: westcentralus.com
 *         organizationalUnit: OU=FirstLevel
 *       identity:
 *         type: UserAssigned
 *         identityIds:
 *           - ${exampleUserAssignedIdentity.id}
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * NetApp Accounts can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:netapp/account:Account example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1
 * ```
 * ~> **IMPORTANT:** When importing a NetApp account, the `active_directory.password` and `active_directory.server_root_ca_certificate` values *cannot* be retrieved from the Azure API and will need to be redeclared within the resource.
 * @property activeDirectory A `active_directory` block as defined below.
 * @property identity The `identity` block where it is used when customer managed keys based encryption will be enabled as defined below.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name The name of the NetApp Account. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group where the NetApp Account should be created. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class AccountArgs(
    public val activeDirectory: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.netapp.AccountArgs =
        com.pulumi.azure.netapp.AccountArgs.builder()
            .activeDirectory(activeDirectory?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [AccountArgs].
 */
@PulumiTagMarker
public class AccountArgsBuilder internal constructor() {
    private var activeDirectory: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value A `active_directory` block as defined below.
     */
    @JvmName("sdxvnhdkhsuwxpen")
    public suspend fun activeDirectory(`value`: Output) {
        this.activeDirectory = value
    }

    /**
     * @param value The `identity` block where it is used when customer managed keys based encryption will be enabled as defined below.
     */
    @JvmName("rwblmycdtpbqwlbr")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("kcbgtjdvofjhqayi")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name of the NetApp Account. Changing this forces a new resource to be created.
     */
    @JvmName("crqnhqluovlfhddn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the resource group where the NetApp Account should be created. Changing this forces a new resource to be created.
     */
    @JvmName("ieeoguqklmqapbqq")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("bopclildjnxvkkpm")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A `active_directory` block as defined below.
     */
    @JvmName("tqubtypsedpnrlkm")
    public suspend fun activeDirectory(`value`: AccountActiveDirectoryArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.activeDirectory = mapped
    }

    /**
     * @param argument A `active_directory` block as defined below.
     */
    @JvmName("rpnjcrumkupwmwda")
    public suspend
    fun activeDirectory(argument: suspend AccountActiveDirectoryArgsBuilder.() -> Unit) {
        val toBeMapped = AccountActiveDirectoryArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.activeDirectory = mapped
    }

    /**
     * @param value The `identity` block where it is used when customer managed keys based encryption will be enabled as defined below.
     */
    @JvmName("cecbmwdbsilsebur")
    public suspend fun identity(`value`: AccountIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument The `identity` block where it is used when customer managed keys based encryption will be enabled as defined below.
     */
    @JvmName("lbarcwmxoiqdpdgw")
    public suspend fun identity(argument: suspend AccountIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = AccountIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("txsstojxlpakalhc")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name of the NetApp Account. Changing this forces a new resource to be created.
     */
    @JvmName("rvmxkfmcjfhfgtay")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the resource group where the NetApp Account should be created. Changing this forces a new resource to be created.
     */
    @JvmName("epirqjynnbfqtdto")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("gfsfpiaeiqjrvhfv")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("gjtncikcyctfutsh")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): AccountArgs = AccountArgs(
        activeDirectory = activeDirectory,
        identity = identity,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy