"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.CdnDomain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage cdn domain
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooCdnCertificate = new volcengine.cdn.CdnCertificate("fooCdnCertificate", {
 *     certificate: "",
 *     privateKey: "",
 *     desc: "tftest",
 *     source: "cdn_cert_hosting",
 * });
 * const fooCdnDomain = new volcengine.cdn.CdnDomain("fooCdnDomain", {
 *     domain: "tftest.byte-test.com",
 *     serviceType: "web",
 *     tags: [
 *         {
 *             key: "tfkey1",
 *             value: "tfvalue1",
 *         },
 *         {
 *             key: "tfkey2",
 *             value: "tfvalue2",
 *         },
 *     ],
 *     domainConfig: pulumi.jsonStringify({
 *         OriginProtocol: "https",
 *         Origin: [{
 *             OriginAction: {
 *                 OriginLines: [{
 *                     Address: "1.1.1.1",
 *                     HttpPort: "80",
 *                     HttpsPort: "443",
 *                     InstanceType: "ip",
 *                     OriginType: "primary",
 *                     PrivateBucketAccess: false,
 *                     Weight: "2",
 *                 }],
 *             },
 *         }],
 *         HTTPS: {
 *             CertInfo: {
 *                 CertId: fooCdnCertificate.id,
 *             },
 *             DisableHttp: false,
 *             HTTP2: true,
 *             Switch: true,
 *             Ocsp: false,
 *             TlsVersion: [
 *                 "tlsv1.1",
 *                 "tlsv1.2",
 *             ],
 *         },
 *     }),
 * });
 * ```
 *
 * ## Import
 *
 * CdnDomain can be imported using the domain, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:cdn/cdnDomain:CdnDomain default www.volcengine.com
 * ```
 * Please note that when you execute destroy, we will first take the domain name offline and then delete it.
 */
class CdnDomain extends pulumi.CustomResource {
    /**
     * Get an existing CdnDomain 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 CdnDomain(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of CdnDomain.  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'] === CdnDomain.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["domain"] = state ? state.domain : undefined;
            resourceInputs["domainConfig"] = state ? state.domainConfig : undefined;
            resourceInputs["project"] = state ? state.project : undefined;
            resourceInputs["serviceRegion"] = state ? state.serviceRegion : undefined;
            resourceInputs["serviceType"] = state ? state.serviceType : undefined;
            resourceInputs["sharedCname"] = state ? state.sharedCname : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.domain === undefined) && !opts.urn) {
                throw new Error("Missing required property 'domain'");
            }
            if ((!args || args.domainConfig === undefined) && !opts.urn) {
                throw new Error("Missing required property 'domainConfig'");
            }
            if ((!args || args.serviceType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'serviceType'");
            }
            resourceInputs["domain"] = args ? args.domain : undefined;
            resourceInputs["domainConfig"] = args ? args.domainConfig : undefined;
            resourceInputs["project"] = args ? args.project : undefined;
            resourceInputs["serviceRegion"] = args ? args.serviceRegion : undefined;
            resourceInputs["serviceType"] = args ? args.serviceType : undefined;
            resourceInputs["sharedCname"] = args ? args.sharedCname : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["status"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CdnDomain.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CdnDomain = CdnDomain;
/** @internal */
CdnDomain.__pulumiType = 'volcengine:cdn/cdnDomain:CdnDomain';
//# sourceMappingURL=cdnDomain.js.map