"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.BackendBucket = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Backend buckets allow you to use Google Cloud Storage buckets with HTTP(S)
 * load balancing.
 *
 * An HTTP(S) load balancer can direct traffic to specified URLs to a
 * backend bucket rather than a backend service. It can send requests for
 * static content to a Cloud Storage bucket and requests for dynamic content
 * to a virtual machine instance.
 *
 * To get more information about BackendBucket, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/backendBuckets)
 * * How-to Guides
 *     * [Using a Cloud Storage bucket as a load balancer backend](https://cloud.google.com/compute/docs/load-balancing/http/backend-bucket)
 *
 * ## Example Usage
 *
 * ### Backend Bucket Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const imageBucket = new gcp.storage.Bucket("image_bucket", {
 *     name: "image-store-bucket",
 *     location: "EU",
 * });
 * const imageBackend = new gcp.compute.BackendBucket("image_backend", {
 *     name: "image-backend-bucket",
 *     description: "Contains beautiful images",
 *     bucketName: imageBucket.name,
 *     enableCdn: true,
 * });
 * ```
 * ### Backend Bucket Security Policy
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const imageBackendBucket = new gcp.storage.Bucket("image_backend", {
 *     name: "image-store-bucket",
 *     location: "EU",
 * });
 * const policy = new gcp.compute.SecurityPolicy("policy", {
 *     name: "image-store-bucket",
 *     description: "basic security policy",
 *     type: "CLOUD_ARMOR_EDGE",
 * });
 * const imageBackend = new gcp.compute.BackendBucket("image_backend", {
 *     name: "image-backend-bucket",
 *     description: "Contains beautiful images",
 *     bucketName: imageBackendBucket.name,
 *     enableCdn: true,
 *     edgeSecurityPolicy: policy.id,
 * });
 * ```
 * ### Backend Bucket Query String Whitelist
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const imageBucket = new gcp.storage.Bucket("image_bucket", {
 *     name: "image-backend-bucket",
 *     location: "EU",
 * });
 * const imageBackend = new gcp.compute.BackendBucket("image_backend", {
 *     name: "image-backend-bucket",
 *     description: "Contains beautiful images",
 *     bucketName: imageBucket.name,
 *     enableCdn: true,
 *     cdnPolicy: {
 *         cacheKeyPolicy: {
 *             queryStringWhitelists: ["image-version"],
 *         },
 *     },
 * });
 * ```
 * ### Backend Bucket Include Http Headers
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const imageBucket = new gcp.storage.Bucket("image_bucket", {
 *     name: "image-backend-bucket",
 *     location: "EU",
 * });
 * const imageBackend = new gcp.compute.BackendBucket("image_backend", {
 *     name: "image-backend-bucket",
 *     description: "Contains beautiful images",
 *     bucketName: imageBucket.name,
 *     enableCdn: true,
 *     cdnPolicy: {
 *         cacheKeyPolicy: {
 *             includeHttpHeaders: ["X-My-Header-Field"],
 *         },
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * BackendBucket can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/backendBuckets/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, BackendBucket can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/backendBucket:BackendBucket default projects/{{project}}/global/backendBuckets/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/backendBucket:BackendBucket default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/backendBucket:BackendBucket default {{name}}
 * ```
 */
class BackendBucket extends pulumi.CustomResource {
    /**
     * Get an existing BackendBucket 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 BackendBucket(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of BackendBucket.  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'] === BackendBucket.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["bucketName"] = state?.bucketName;
            resourceInputs["cdnPolicy"] = state?.cdnPolicy;
            resourceInputs["compressionMode"] = state?.compressionMode;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["customResponseHeaders"] = state?.customResponseHeaders;
            resourceInputs["description"] = state?.description;
            resourceInputs["edgeSecurityPolicy"] = state?.edgeSecurityPolicy;
            resourceInputs["enableCdn"] = state?.enableCdn;
            resourceInputs["loadBalancingScheme"] = state?.loadBalancingScheme;
            resourceInputs["name"] = state?.name;
            resourceInputs["params"] = state?.params;
            resourceInputs["project"] = state?.project;
            resourceInputs["selfLink"] = state?.selfLink;
        }
        else {
            const args = argsOrState;
            if (args?.bucketName === undefined && !opts.urn) {
                throw new Error("Missing required property 'bucketName'");
            }
            resourceInputs["bucketName"] = args?.bucketName;
            resourceInputs["cdnPolicy"] = args?.cdnPolicy;
            resourceInputs["compressionMode"] = args?.compressionMode;
            resourceInputs["customResponseHeaders"] = args?.customResponseHeaders;
            resourceInputs["description"] = args?.description;
            resourceInputs["edgeSecurityPolicy"] = args?.edgeSecurityPolicy;
            resourceInputs["enableCdn"] = args?.enableCdn;
            resourceInputs["loadBalancingScheme"] = args?.loadBalancingScheme;
            resourceInputs["name"] = args?.name;
            resourceInputs["params"] = args?.params;
            resourceInputs["project"] = args?.project;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(BackendBucket.__pulumiType, name, resourceInputs, opts);
    }
}
exports.BackendBucket = BackendBucket;
/** @internal */
BackendBucket.__pulumiType = 'gcp:compute/backendBucket:BackendBucket';
//# sourceMappingURL=backendBucket.js.map