"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.HostingCustomDomain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Manages Custom Domains for Firebase Hosting. Custom Domains link your
 * domain names with Firebase Hosting sites, allowing Hosting to serve content
 * on those domain names.
 *
 * To get more information about CustomDomain, see:
 *
 * * [API documentation](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/projects.sites.customDomains)
 * * How-to Guides
 *     * [Official Documentation](https://firebase.google.com/docs/hosting)
 *
 * ## Example Usage
 *
 * ### Firebasehosting Customdomain Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.firebase.HostingCustomDomain("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 *     customDomain: "custom.domain.com",
 * });
 * ```
 * ### Firebasehosting Customdomain Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id-full",
 * });
 * const defaultHostingCustomDomain = new gcp.firebase.HostingCustomDomain("default", {
 *     project: "my-project-name",
 *     siteId: _default.siteId,
 *     customDomain: "source.domain.com",
 *     certPreference: "GROUPED",
 *     redirectTarget: "destination.domain.com",
 *     waitDnsVerification: false,
 * });
 * ```
 * ### Firebasehosting Customdomain Cloud Run
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultService = new gcp.cloudrunv2.Service("default", {
 *     project: "my-project-name",
 *     name: "cloud-run-service-via-hosting",
 *     location: "us-central1",
 *     ingress: "INGRESS_TRAFFIC_ALL",
 *     template: {
 *         containers: [{
 *             image: "us-docker.pkg.dev/cloudrun/container/hello",
 *         }],
 *     },
 *     deletionProtection: true,
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         rewrites: [{
 *             glob: "/hello/**",
 *             run: {
 *                 serviceId: defaultService.name,
 *                 region: defaultService.location,
 *             },
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Cloud Run Integration",
 * });
 * const defaultHostingCustomDomain = new gcp.firebase.HostingCustomDomain("default", {
 *     project: "my-project-name",
 *     siteId: _default.siteId,
 *     customDomain: "run.custom.domain.com",
 *     waitDnsVerification: false,
 * });
 * ```
 *
 * ## Import
 *
 * CustomDomain can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/sites/{{site_id}}/customDomains/{{custom_domain}}`
 *
 * * `sites/{{site_id}}/customDomains/{{custom_domain}}`
 *
 * * `{{project}}/{{site_id}}/{{custom_domain}}`
 *
 * * `{{site_id}}/{{custom_domain}}`
 *
 * When using the `pulumi import` command, CustomDomain can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default projects/{{project}}/sites/{{site_id}}/customDomains/{{custom_domain}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default sites/{{site_id}}/customDomains/{{custom_domain}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default {{project}}/{{site_id}}/{{custom_domain}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingCustomDomain:HostingCustomDomain default {{site_id}}/{{custom_domain}}
 * ```
 */
class HostingCustomDomain extends pulumi.CustomResource {
    /**
     * Get an existing HostingCustomDomain 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 HostingCustomDomain(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of HostingCustomDomain.  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'] === HostingCustomDomain.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["certPreference"] = state?.certPreference;
            resourceInputs["certs"] = state?.certs;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["customDomain"] = state?.customDomain;
            resourceInputs["deleteTime"] = state?.deleteTime;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["expireTime"] = state?.expireTime;
            resourceInputs["hostState"] = state?.hostState;
            resourceInputs["issues"] = state?.issues;
            resourceInputs["name"] = state?.name;
            resourceInputs["ownershipState"] = state?.ownershipState;
            resourceInputs["project"] = state?.project;
            resourceInputs["reconciling"] = state?.reconciling;
            resourceInputs["redirectTarget"] = state?.redirectTarget;
            resourceInputs["requiredDnsUpdates"] = state?.requiredDnsUpdates;
            resourceInputs["siteId"] = state?.siteId;
            resourceInputs["updateTime"] = state?.updateTime;
            resourceInputs["waitDnsVerification"] = state?.waitDnsVerification;
        }
        else {
            const args = argsOrState;
            if (args?.customDomain === undefined && !opts.urn) {
                throw new Error("Missing required property 'customDomain'");
            }
            if (args?.siteId === undefined && !opts.urn) {
                throw new Error("Missing required property 'siteId'");
            }
            resourceInputs["certPreference"] = args?.certPreference;
            resourceInputs["customDomain"] = args?.customDomain;
            resourceInputs["project"] = args?.project;
            resourceInputs["redirectTarget"] = args?.redirectTarget;
            resourceInputs["siteId"] = args?.siteId;
            resourceInputs["waitDnsVerification"] = args?.waitDnsVerification;
            resourceInputs["certs"] = undefined /*out*/;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["deleteTime"] = undefined /*out*/;
            resourceInputs["etag"] = undefined /*out*/;
            resourceInputs["expireTime"] = undefined /*out*/;
            resourceInputs["hostState"] = undefined /*out*/;
            resourceInputs["issues"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["ownershipState"] = undefined /*out*/;
            resourceInputs["reconciling"] = undefined /*out*/;
            resourceInputs["requiredDnsUpdates"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(HostingCustomDomain.__pulumiType, name, resourceInputs, opts);
    }
}
exports.HostingCustomDomain = HostingCustomDomain;
/** @internal */
HostingCustomDomain.__pulumiType = 'gcp:firebase/hostingCustomDomain:HostingCustomDomain';
//# sourceMappingURL=hostingCustomDomain.js.map