"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SaslUser = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage kafka sasl user
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooZones = volcengine.ecs.getZones({});
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const fooInstance = new volcengine.kafka.Instance("fooInstance", {
 *     instanceName: "acc-test-kafka",
 *     instanceDescription: "tf-test",
 *     version: "2.2.2",
 *     computeSpec: "kafka.20xrate.hw",
 *     subnetId: fooSubnet.id,
 *     userName: "tf-user",
 *     userPassword: "tf-pass!@q1",
 *     chargeType: "PostPaid",
 *     storageSpace: 300,
 *     partitionNumber: 350,
 *     projectName: "default",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 *     parameters: [
 *         {
 *             parameterName: "MessageMaxByte",
 *             parameterValue: "12",
 *         },
 *         {
 *             parameterName: "LogRetentionHours",
 *             parameterValue: "70",
 *         },
 *     ],
 * });
 * const fooSaslUser = new volcengine.kafka.SaslUser("fooSaslUser", {
 *     userName: "acc-test-user",
 *     instanceId: fooInstance.id,
 *     userPassword: "suqsnis123!",
 *     description: "tf-test",
 *     allAuthority: true,
 *     passwordType: "Scram",
 * });
 * ```
 *
 * ## Import
 *
 * KafkaSaslUser can be imported using the kafka_id:username, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:kafka/saslUser:SaslUser default kafka-cnngbnntswg1****:tfuser
 * ```
 */
class SaslUser extends pulumi.CustomResource {
    /**
     * Get an existing SaslUser 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 SaslUser(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of SaslUser.  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'] === SaslUser.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allAuthority"] = state ? state.allAuthority : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["instanceId"] = state ? state.instanceId : undefined;
            resourceInputs["passwordType"] = state ? state.passwordType : undefined;
            resourceInputs["userName"] = state ? state.userName : undefined;
            resourceInputs["userPassword"] = state ? state.userPassword : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.instanceId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'instanceId'");
            }
            if ((!args || args.userName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'userName'");
            }
            if ((!args || args.userPassword === undefined) && !opts.urn) {
                throw new Error("Missing required property 'userPassword'");
            }
            resourceInputs["allAuthority"] = args ? args.allAuthority : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["instanceId"] = args ? args.instanceId : undefined;
            resourceInputs["passwordType"] = args ? args.passwordType : undefined;
            resourceInputs["userName"] = args ? args.userName : undefined;
            resourceInputs["userPassword"] = (args === null || args === void 0 ? void 0 : args.userPassword) ? pulumi.secret(args.userPassword) : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["userPassword"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(SaslUser.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SaslUser = SaslUser;
/** @internal */
SaslUser.__pulumiType = 'volcengine:kafka/saslUser:SaslUser';
//# sourceMappingURL=saslUser.js.map