"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.RegionTargetHttpsProxy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a RegionTargetHttpsProxy resource, which is used by one or more
 * forwarding rules to route incoming HTTPS requests to a URL map.
 *
 * To get more information about RegionTargetHttpsProxy, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionTargetHttpsProxies)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/http/target-proxies)
 *
 * ## Example Usage
 *
 * ### Region Target Https Proxy Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const defaultRegionSslCertificate = new gcp.compute.RegionSslCertificate("default", {
 *     region: "us-central1",
 *     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 defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
 *     region: "us-central1",
 *     name: "http-health-check",
 *     httpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     region: "us-central1",
 *     name: "backend-service",
 *     protocol: "HTTP",
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     timeoutSec: 10,
 *     healthChecks: defaultRegionHealthCheck.id,
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     region: "us-central1",
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultRegionBackendService.id,
 *     hostRules: [{
 *         hosts: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultRegionBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultRegionBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.RegionTargetHttpsProxy("default", {
 *     region: "us-central1",
 *     name: "test-proxy",
 *     urlMap: defaultRegionUrlMap.id,
 *     sslCertificates: [defaultRegionSslCertificate.id],
 * });
 * ```
 * ### Region 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 defaultRegionSslCertificate = new gcp.compute.RegionSslCertificate("default", {
 *     region: "us-central1",
 *     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 defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
 *     region: "us-central1",
 *     name: "http-health-check",
 *     httpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     region: "us-central1",
 *     name: "backend-service",
 *     portName: "http",
 *     protocol: "HTTP",
 *     timeoutSec: 10,
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     healthChecks: defaultRegionHealthCheck.id,
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     region: "us-central1",
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultRegionBackendService.id,
 *     hostRules: [{
 *         hosts: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultRegionBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultRegionBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.RegionTargetHttpsProxy("default", {
 *     region: "us-central1",
 *     name: "test-http-keep-alive-timeout-proxy",
 *     httpKeepAliveTimeoutSec: 600,
 *     urlMap: defaultRegionUrlMap.id,
 *     sslCertificates: [defaultRegionSslCertificate.id],
 * });
 * ```
 * ### Region 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", {
 *     location: "us-central1",
 *     name: "my-trust-config",
 *     description: "sample description for trust config",
 *     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", {
 *     location: "us-central1",
 *     name: "my-tls-policy",
 *     description: "my description",
 *     allowOpen: false,
 *     mtlsPolicy: {
 *         clientValidationMode: "REJECT_INVALID",
 *         clientValidationTrustConfig: pulumi.all([project, defaultTrustConfig.name]).apply(([project, name]) => `projects/${project.number}/locations/us-central1/trustConfigs/${name}`),
 *     },
 * });
 * const defaultRegionSslCertificate = new gcp.compute.RegionSslCertificate("default", {
 *     region: "us-central1",
 *     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 defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
 *     region: "us-central1",
 *     name: "http-health-check",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     httpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     region: "us-central1",
 *     name: "backend-service",
 *     portName: "http",
 *     protocol: "HTTP",
 *     timeoutSec: 10,
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     healthChecks: defaultRegionHealthCheck.id,
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     region: "us-central1",
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultRegionBackendService.id,
 *     hostRules: [{
 *         hosts: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultRegionBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultRegionBackendService.id,
 *         }],
 *     }],
 * });
 * const _default = new gcp.compute.RegionTargetHttpsProxy("default", {
 *     region: "us-central1",
 *     name: "test-mtls-proxy",
 *     urlMap: defaultRegionUrlMap.id,
 *     sslCertificates: [defaultRegionSslCertificate.id],
 *     serverTlsPolicy: defaultServerTlsPolicy.id,
 * });
 * ```
 * ### Region 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",
 *     location: "us-central1",
 *     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 defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     name: "backend-service",
 *     region: "us-central1",
 *     protocol: "HTTPS",
 *     timeoutSec: 30,
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     name: "url-map",
 *     defaultService: defaultRegionBackendService.id,
 *     region: "us-central1",
 * });
 * const _default = new gcp.compute.RegionTargetHttpsProxy("default", {
 *     name: "target-http-proxy",
 *     urlMap: defaultRegionUrlMap.id,
 *     certificateManagerCertificates: [pulumi.interpolate`//certificatemanager.googleapis.com/${defaultCertificate.id}`],
 * });
 * ```
 *
 * ## Import
 *
 * RegionTargetHttpsProxy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, RegionTargetHttpsProxy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/regionTargetHttpsProxy:RegionTargetHttpsProxy default projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionTargetHttpsProxy:RegionTargetHttpsProxy default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionTargetHttpsProxy:RegionTargetHttpsProxy default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionTargetHttpsProxy:RegionTargetHttpsProxy default {{name}}
 * ```
 */
class RegionTargetHttpsProxy extends pulumi.CustomResource {
    /**
     * Get an existing RegionTargetHttpsProxy 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 RegionTargetHttpsProxy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionTargetHttpsProxy.  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'] === RegionTargetHttpsProxy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["certificateManagerCertificates"] = state?.certificateManagerCertificates;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["httpKeepAliveTimeoutSec"] = state?.httpKeepAliveTimeoutSec;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["proxyId"] = state?.proxyId;
            resourceInputs["region"] = state?.region;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["serverTlsPolicy"] = state?.serverTlsPolicy;
            resourceInputs["sslCertificates"] = state?.sslCertificates;
            resourceInputs["sslPolicy"] = state?.sslPolicy;
            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["description"] = args?.description;
            resourceInputs["httpKeepAliveTimeoutSec"] = args?.httpKeepAliveTimeoutSec;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["serverTlsPolicy"] = args?.serverTlsPolicy;
            resourceInputs["sslCertificates"] = args?.sslCertificates;
            resourceInputs["sslPolicy"] = args?.sslPolicy;
            resourceInputs["urlMap"] = args?.urlMap;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["proxyId"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RegionTargetHttpsProxy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionTargetHttpsProxy = RegionTargetHttpsProxy;
/** @internal */
RegionTargetHttpsProxy.__pulumiType = 'gcp:compute/regionTargetHttpsProxy:RegionTargetHttpsProxy';
//# sourceMappingURL=regionTargetHttpsProxy.js.map