"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.TargetHttpsProxy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a TargetHttpsProxy resource, which is used by one or more
 * global forwarding rule to route incoming HTTPS requests to a URL map.
 *
 * To get more information about TargetHttpsProxy, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/targetHttpsProxies)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/http/target-proxies)
 *
 * ## Example Usage
 *
 * ### Target Https Proxy Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
 *     name: "my-certificate",
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * 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: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.TargetHttpsProxy("default", {
 *     name: "test-proxy",
 *     urlMap: defaultURLMap.id,
 *     sslCertificates: [defaultSSLCertificate.id],
 * });
 * ```
 * ### Target Https Proxy Http Keep Alive Timeout
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
 *     name: "my-certificate",
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * 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,
 *     loadBalancingScheme: "EXTERNAL_MANAGED",
 *     healthChecks: defaultHttpHealthCheck.id,
 * });
 * const defaultURLMap = new gcp.compute.URLMap("default", {
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultBackendService.id,
 *     hostRules: [{
 *         hosts: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.TargetHttpsProxy("default", {
 *     name: "test-http-keep-alive-timeout-proxy",
 *     httpKeepAliveTimeoutSec: 610,
 *     urlMap: defaultURLMap.id,
 *     sslCertificates: [defaultSSLCertificate.id],
 * });
 * ```
 * ### Target Https Proxy Mtls
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const project = gcp.organizations.getProject({});
 * const defaultTrustConfig = new gcp.certificatemanager.TrustConfig("default", {
 *     name: "my-trust-config",
 *     description: "sample description for the trust config",
 *     location: "global",
 *     trustStores: [{
 *         trustAnchors: [{
 *             pemCertificate: std.file({
 *                 input: "test-fixtures/ca_cert.pem",
 *             }).then(invoke => invoke.result),
 *         }],
 *         intermediateCas: [{
 *             pemCertificate: std.file({
 *                 input: "test-fixtures/ca_cert.pem",
 *             }).then(invoke => invoke.result),
 *         }],
 *     }],
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const defaultServerTlsPolicy = new gcp.networksecurity.ServerTlsPolicy("default", {
 *     name: "my-tls-policy",
 *     description: "my description",
 *     location: "global",
 *     allowOpen: false,
 *     mtlsPolicy: {
 *         clientValidationMode: "ALLOW_INVALID_OR_MISSING_CLIENT_CERT",
 *         clientValidationTrustConfig: pulumi.all([project, defaultTrustConfig.name]).apply(([project, name]) => `projects/${project.number}/locations/global/trustConfigs/${name}`),
 *     },
 * });
 * const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
 *     name: "my-certificate",
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * 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: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.TargetHttpsProxy("default", {
 *     name: "test-mtls-proxy",
 *     urlMap: defaultURLMap.id,
 *     sslCertificates: [defaultSSLCertificate.id],
 *     serverTlsPolicy: defaultServerTlsPolicy.id,
 * });
 * ```
 * ### Target Https Proxy Certificate Manager Certificate
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const defaultCertificate = new gcp.certificatemanager.Certificate("default", {
 *     name: "my-certificate",
 *     scope: "ALL_REGIONS",
 *     selfManaged: {
 *         pemCertificate: std.file({
 *             input: "test-fixtures/cert.pem",
 *         }).then(invoke => invoke.result),
 *         pemPrivateKey: std.file({
 *             input: "test-fixtures/private-key.pem",
 *         }).then(invoke => invoke.result),
 *     },
 * });
 * const defaultBackendService = new gcp.compute.BackendService("default", {
 *     name: "backend-service",
 *     portName: "http",
 *     protocol: "HTTP",
 *     timeoutSec: 10,
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 * });
 * const defaultURLMap = new gcp.compute.URLMap("default", {
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultBackendService.id,
 *     hostRules: [{
 *         hosts: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.TargetHttpsProxy("default", {
 *     name: "target-http-proxy",
 *     urlMap: defaultURLMap.id,
 *     certificateManagerCertificates: [pulumi.interpolate`//certificatemanager.googleapis.com/${defaultCertificate.id}`],
 * });
 * ```
 * ### Target Https Proxy Fingerprint
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const defaultSSLCertificate = new gcp.compute.SSLCertificate("default", {
 *     name: "my-certificate",
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * 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: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.TargetHttpsProxy("default", {
 *     name: "test-fingerprint-proxy",
 *     urlMap: defaultURLMap.id,
 *     sslCertificates: [defaultSSLCertificate.id],
 * });
 * export const targetHttpsProxyFingerprint = _default.fingerprint;
 * ```
 *
 * ## Import
 *
 * TargetHttpsProxy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/targetHttpsProxies/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, TargetHttpsProxy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/targetHttpsProxy:TargetHttpsProxy default projects/{{project}}/global/targetHttpsProxies/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetHttpsProxy:TargetHttpsProxy default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetHttpsProxy:TargetHttpsProxy default {{name}}
 * ```
 */
class TargetHttpsProxy extends pulumi.CustomResource {
    /**
     * Get an existing TargetHttpsProxy 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 TargetHttpsProxy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TargetHttpsProxy.  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'] === TargetHttpsProxy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["certificateManagerCertificates"] = state?.certificateManagerCertificates;
            resourceInputs["certificateMap"] = state?.certificateMap;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["fingerprint"] = state?.fingerprint;
            resourceInputs["httpKeepAliveTimeoutSec"] = state?.httpKeepAliveTimeoutSec;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["proxyBind"] = state?.proxyBind;
            resourceInputs["proxyId"] = state?.proxyId;
            resourceInputs["quicOverride"] = state?.quicOverride;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["serverTlsPolicy"] = state?.serverTlsPolicy;
            resourceInputs["sslCertificates"] = state?.sslCertificates;
            resourceInputs["sslPolicy"] = state?.sslPolicy;
            resourceInputs["tlsEarlyData"] = state?.tlsEarlyData;
            resourceInputs["urlMap"] = state?.urlMap;
        }
        else {
            const args = argsOrState;
            if (args?.urlMap === undefined && !opts.urn) {
                throw new Error("Missing required property 'urlMap'");
            }
            resourceInputs["certificateManagerCertificates"] = args?.certificateManagerCertificates;
            resourceInputs["certificateMap"] = args?.certificateMap;
            resourceInputs["description"] = args?.description;
            resourceInputs["httpKeepAliveTimeoutSec"] = args?.httpKeepAliveTimeoutSec;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["proxyBind"] = args?.proxyBind;
            resourceInputs["quicOverride"] = args?.quicOverride;
            resourceInputs["serverTlsPolicy"] = args?.serverTlsPolicy;
            resourceInputs["sslCertificates"] = args?.sslCertificates;
            resourceInputs["sslPolicy"] = args?.sslPolicy;
            resourceInputs["tlsEarlyData"] = args?.tlsEarlyData;
            resourceInputs["urlMap"] = args?.urlMap;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["fingerprint"] = undefined /*out*/;
            resourceInputs["proxyId"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TargetHttpsProxy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TargetHttpsProxy = TargetHttpsProxy;
/** @internal */
TargetHttpsProxy.__pulumiType = 'gcp:compute/targetHttpsProxy:TargetHttpsProxy';
//# sourceMappingURL=targetHttpsProxy.js.map