"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.ReplaceCertificate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage alb replace certificate
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as fs from "fs";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * // replace server certificate
 * const foo1 = new volcengine.alb.ReplaceCertificate("foo1", {
 *     certificateType: "server",
 *     oldCertificateId: "cert-bdde0znk524g8dv40or*****",
 *     updateMode: "new",
 *     certificateName: "replaced-server-cert",
 *     description: "Replaced server certificate",
 *     projectName: "default",
 *     publicKey: fs.readFileSync("/path/server_certificate.pem", "utf8"),
 *     privateKey: fs.readFileSync("/path/private_key_rsa.pem", "utf8"),
 * });
 * const foo2 = new volcengine.alb.ReplaceCertificate("foo2", {
 *     certificateType: "server",
 *     oldCertificateId: "cert-1pf4a8k8tokcg845wfar*****",
 *     updateMode: "stock",
 *     certificateSource: "alb",
 *     certificateId: "cert-bdde0znk524g8dv40or*****",
 *     certificateName: "replaced-server-cert-stock",
 *     description: "Replaced server certificate (stock)",
 *     projectName: "default",
 * });
 * // replace ca certificate
 * const foo3 = new volcengine.alb.ReplaceCertificate("foo3", {
 *     certificateType: "ca",
 *     oldCertificateId: "cert-xoekc6lpu9s054ov5eo*****",
 *     updateMode: "new",
 *     certificateName: "acc-test-replace",
 *     caCertificate: fs.readFileSync("/path/server_certificate.pem", "utf8"),
 *     description: "acc-test-replace",
 *     projectName: "default",
 * });
 * ```
 *
 * ## Import
 *
 * The AlbReplaceCertificate is not support import.
 */
class ReplaceCertificate extends pulumi.CustomResource {
    /**
     * Get an existing ReplaceCertificate 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 ReplaceCertificate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of ReplaceCertificate.  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'] === ReplaceCertificate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["caCertificate"] = state ? state.caCertificate : undefined;
            resourceInputs["certCenterCertificateId"] = state ? state.certCenterCertificateId : undefined;
            resourceInputs["certificateId"] = state ? state.certificateId : undefined;
            resourceInputs["certificateName"] = state ? state.certificateName : undefined;
            resourceInputs["certificateSource"] = state ? state.certificateSource : undefined;
            resourceInputs["certificateType"] = state ? state.certificateType : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["oldCertificateId"] = state ? state.oldCertificateId : undefined;
            resourceInputs["privateKey"] = state ? state.privateKey : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["publicKey"] = state ? state.publicKey : undefined;
            resourceInputs["updateMode"] = state ? state.updateMode : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.certificateType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'certificateType'");
            }
            if ((!args || args.oldCertificateId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'oldCertificateId'");
            }
            if ((!args || args.updateMode === undefined) && !opts.urn) {
                throw new Error("Missing required property 'updateMode'");
            }
            resourceInputs["caCertificate"] = args ? args.caCertificate : undefined;
            resourceInputs["certCenterCertificateId"] = args ? args.certCenterCertificateId : undefined;
            resourceInputs["certificateId"] = args ? args.certificateId : undefined;
            resourceInputs["certificateName"] = args ? args.certificateName : undefined;
            resourceInputs["certificateSource"] = args ? args.certificateSource : undefined;
            resourceInputs["certificateType"] = args ? args.certificateType : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["oldCertificateId"] = args ? args.oldCertificateId : undefined;
            resourceInputs["privateKey"] = (args === null || args === void 0 ? void 0 : args.privateKey) ? pulumi.secret(args.privateKey) : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["publicKey"] = args ? args.publicKey : undefined;
            resourceInputs["updateMode"] = args ? args.updateMode : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["privateKey"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ReplaceCertificate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ReplaceCertificate = ReplaceCertificate;
/** @internal */
ReplaceCertificate.__pulumiType = 'volcengine:alb/replaceCertificate:ReplaceCertificate';
//# sourceMappingURL=replaceCertificate.js.map