"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.TargetHttpProxy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a TargetHttpProxy resource, which is used by one or more global
 * forwarding rule to route incoming HTTP requests to a URL map.
 *
 * To get more information about TargetHttpProxy, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/targetHttpProxies)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/http/target-proxies)
 *
 * ## Example Usage
 *
 * ### Target Http Proxy Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * 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",
 *     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.TargetHttpProxy("default", {
 *     name: "test-proxy",
 *     urlMap: defaultURLMap.id,
 * });
 * ```
 * ### Target Http Proxy Http Keep Alive Timeout
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * 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",
 *     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.TargetHttpProxy("default", {
 *     name: "test-http-keep-alive-timeout-proxy",
 *     httpKeepAliveTimeoutSec: 610,
 *     urlMap: defaultURLMap.id,
 * });
 * ```
 * ### Target Http Proxy Https Redirect
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const defaultURLMap = new gcp.compute.URLMap("default", {
 *     name: "url-map",
 *     defaultUrlRedirect: {
 *         httpsRedirect: true,
 *         stripQuery: false,
 *     },
 * });
 * const _default = new gcp.compute.TargetHttpProxy("default", {
 *     name: "test-https-redirect-proxy",
 *     urlMap: defaultURLMap.id,
 * });
 * ```
 * ### Target Http Proxy Fingerprint
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * 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",
 *     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.TargetHttpProxy("default", {
 *     name: "test-fingerprint-proxy",
 *     urlMap: defaultURLMap.id,
 * });
 * export const targetHttpProxyFingerprint = _default.fingerprint;
 * ```
 *
 * ## Import
 *
 * TargetHttpProxy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/targetHttpProxies/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, TargetHttpProxy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/targetHttpProxy:TargetHttpProxy default projects/{{project}}/global/targetHttpProxies/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetHttpProxy:TargetHttpProxy default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetHttpProxy:TargetHttpProxy default {{name}}
 * ```
 */
class TargetHttpProxy extends pulumi.CustomResource {
    /**
     * Get an existing TargetHttpProxy 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 TargetHttpProxy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TargetHttpProxy.  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'] === TargetHttpProxy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            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["selfLink"] = state?.selfLink;
            resourceInputs["urlMap"] = state?.urlMap;
        }
        else {
            const args = argsOrState;
            if (args?.urlMap === undefined && !opts.urn) {
                throw new Error("Missing required property 'urlMap'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["httpKeepAliveTimeoutSec"] = args?.httpKeepAliveTimeoutSec;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["proxyBind"] = args?.proxyBind;
            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(TargetHttpProxy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TargetHttpProxy = TargetHttpProxy;
/** @internal */
TargetHttpProxy.__pulumiType = 'gcp:compute/targetHttpProxy:TargetHttpProxy';
//# sourceMappingURL=targetHttpProxy.js.map