"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountEncryption = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a NetApp Account Encryption Resource.
 *
 * For more information about Azure NetApp Files Customer-Managed Keys feature, please refer to [Configure customer-managed keys for Azure NetApp Files volume encryption](https://learn.microsoft.com/en-us/azure/azure-netapp-files/configure-customer-managed-keys)
 *
 * ## Example 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 exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "anfcmkakv",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     enabledForDiskEncryption: true,
 *     enabledForDeployment: true,
 *     enabledForTemplateDeployment: true,
 *     purgeProtectionEnabled: true,
 *     tenantId: "00000000-0000-0000-0000-000000000000",
 *     skuName: "standard",
 *     accessPolicies: [
 *         {
 *             tenantId: "00000000-0000-0000-0000-000000000000",
 *             objectId: current.then(current => current.objectId),
 *             keyPermissions: [
 *                 "Get",
 *                 "Create",
 *                 "Delete",
 *                 "WrapKey",
 *                 "UnwrapKey",
 *                 "GetRotationPolicy",
 *                 "SetRotationPolicy",
 *             ],
 *         },
 *         {
 *             tenantId: "00000000-0000-0000-0000-000000000000",
 *             objectId: exampleUserAssignedIdentity.principalId,
 *             keyPermissions: [
 *                 "Get",
 *                 "Encrypt",
 *                 "Decrypt",
 *             ],
 *         },
 *     ],
 * });
 * const exampleKey = new azure.keyvault.Key("example", {
 *     name: "anfencryptionkey",
 *     keyVaultId: exampleKeyVault.id,
 *     keyType: "RSA",
 *     keySize: 2048,
 *     keyOpts: [
 *         "decrypt",
 *         "encrypt",
 *         "sign",
 *         "unwrapKey",
 *         "verify",
 *         "wrapKey",
 *     ],
 * });
 * const exampleAccount = new azure.netapp.Account("example", {
 *     name: "netappaccount",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 * });
 * const exampleAccountEncryption = new azure.netapp.AccountEncryption("example", {
 *     netappAccountId: exampleAccount.id,
 *     userAssignedIdentityId: exampleUserAssignedIdentity.id,
 *     encryptionKey: exampleKey.versionlessId,
 *     federatedClientId: exampleUserAssignedIdentity.clientId,
 * });
 * ```
 *
 * ## Cross-Tenant Usage
 *
 * For scenarios where the key vault is in a different Entra ID tenant:
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const crossTenant = new azure.netapp.AccountEncryption("cross_tenant", {
 *     netappAccountId: example.id,
 *     userAssignedIdentityId: exampleAzurermUserAssignedIdentity.id,
 *     encryptionKey: "https://keyvault-in-other-tenant.vault.azure.net/keys/encryption-key",
 *     federatedClientId: "12345678-1234-1234-1234-123456789012",
 *     crossTenantKeyVaultResourceId: "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/remote-rg/providers/Microsoft.KeyVault/vaults/keyvault-in-other-tenant",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.NetApp` - 2025-12-01
 *
 * ## Import
 *
 * Account Encryption Resources can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:netapp/accountEncryption:AccountEncryption example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1
 * ```
 */
class AccountEncryption extends pulumi.CustomResource {
    /**
     * Get an existing AccountEncryption 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new AccountEncryption(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:netapp/accountEncryption:AccountEncryption';
    /**
     * Returns true if the given object is an instance of AccountEncryption.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === AccountEncryption.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["crossTenantKeyVaultResourceId"] = state?.crossTenantKeyVaultResourceId;
            resourceInputs["encryptionKey"] = state?.encryptionKey;
            resourceInputs["federatedClientId"] = state?.federatedClientId;
            resourceInputs["netappAccountId"] = state?.netappAccountId;
            resourceInputs["systemAssignedIdentityPrincipalId"] = state?.systemAssignedIdentityPrincipalId;
            resourceInputs["userAssignedIdentityId"] = state?.userAssignedIdentityId;
        }
        else {
            const args = argsOrState;
            if (args?.encryptionKey === undefined && !opts.urn) {
                throw new Error("Missing required property 'encryptionKey'");
            }
            if (args?.netappAccountId === undefined && !opts.urn) {
                throw new Error("Missing required property 'netappAccountId'");
            }
            resourceInputs["crossTenantKeyVaultResourceId"] = args?.crossTenantKeyVaultResourceId;
            resourceInputs["encryptionKey"] = args?.encryptionKey;
            resourceInputs["federatedClientId"] = args?.federatedClientId;
            resourceInputs["netappAccountId"] = args?.netappAccountId;
            resourceInputs["systemAssignedIdentityPrincipalId"] = args?.systemAssignedIdentityPrincipalId;
            resourceInputs["userAssignedIdentityId"] = args?.userAssignedIdentityId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(AccountEncryption.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AccountEncryption = AccountEncryption;
//# sourceMappingURL=accountEncryption.js.map