"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.ManagedSslCertificate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An SslCertificate resource, used for HTTPS load balancing.  This resource
 * represents a certificate for which the certificate secrets are created and
 * managed by Google.
 *
 * For a resource where you provide the key, see the
 * SSL Certificate resource.
 *
 * To get more information about ManagedSslCertificate, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/load-balancing/docs/ssl-certificates)
 *
 * > **Warning:** This resource should be used with extreme caution!  Provisioning an SSL
 * certificate is complex.  Ensure that you understand the lifecycle of a
 * certificate before attempting complex tasks like cert rotation automatically.
 * This resource will "return" as soon as the certificate object is created,
 * but post-creation the certificate object will go through a "provisioning"
 * process.  The provisioning process can complete only when the domain name
 * for which the certificate is created points to a target pool which, itself,
 * points at the certificate.  Depending on your DNS provider, this may take
 * some time, and migrating from self-managed certificates to Google-managed
 * certificates may entail some downtime while the certificate provisions.
 *
 * In conclusion: Be extremely cautious.
 *
 * ## Example Usage
 *
 * ### Managed Ssl Certificate Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.compute.ManagedSslCertificate("default", {
 *     name: "test-cert",
 *     managed: {
 *         domains: ["sslcert.tf-test.club."],
 *     },
 * });
 * const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
 *     name: "http-health-check",
 *     requestPath: "/",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 * });
 * const defaultBackendService = new gcp.compute.BackendService("default", {
 *     name: "backend-service",
 *     portName: "http",
 *     protocol: "HTTP",
 *     timeoutSec: 10,
 *     healthChecks: defaultHttpHealthCheck.id,
 * });
 * const defaultURLMap = new gcp.compute.URLMap("default", {
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultBackendService.id,
 *     hostRules: [{
 *         hosts: ["sslcert.tf-test.club"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultBackendService.id,
 *         }],
 *     }],
 * });
 * const defaultTargetHttpsProxy = new gcp.compute.TargetHttpsProxy("default", {
 *     name: "test-proxy",
 *     urlMap: defaultURLMap.id,
 *     sslCertificates: [_default.id],
 * });
 * const defaultGlobalForwardingRule = new gcp.compute.GlobalForwardingRule("default", {
 *     name: "forwarding-rule",
 *     target: defaultTargetHttpsProxy.id,
 *     portRange: "443",
 * });
 * ```
 * ## Import
 *
 * ManagedSslCertificate can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/sslCertificates/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, ManagedSslCertificate can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/managedSslCertificate:ManagedSslCertificate default projects/{{project}}/global/sslCertificates/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/managedSslCertificate:ManagedSslCertificate default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/managedSslCertificate:ManagedSslCertificate default {{name}}
 * ```
 */
class ManagedSslCertificate extends pulumi.CustomResource {
    /**
     * Get an existing ManagedSslCertificate 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 ManagedSslCertificate(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ManagedSslCertificate.  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'] === ManagedSslCertificate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["certificateId"] = state?.certificateId;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["expireTime"] = state?.expireTime;
            resourceInputs["managed"] = state?.managed;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["subjectAlternativeNames"] = state?.subjectAlternativeNames;
            resourceInputs["type"] = state?.type;
        }
        else {
            const args = argsOrState;
            resourceInputs["description"] = args?.description;
            resourceInputs["managed"] = args?.managed;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["type"] = args?.type;
            resourceInputs["certificateId"] = undefined /*out*/;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["expireTime"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["subjectAlternativeNames"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const aliasOpts = { aliases: [{ type: "gcp:compute/mangedSslCertificate:MangedSslCertificate" }] };
        opts = pulumi.mergeOptions(opts, aliasOpts);
        super(ManagedSslCertificate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedSslCertificate = ManagedSslCertificate;
/** @internal */
ManagedSslCertificate.__pulumiType = 'gcp:compute/managedSslCertificate:ManagedSslCertificate';
//# sourceMappingURL=managedSslCertificate.js.map