UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

327 lines • 13.9 kB
import * as pulumi from "@pulumi/pulumi"; /** * Regional backend buckets allow you to use Google Cloud Storage buckets with * regional HTTP(S) load balancing. * * A regional 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. * * Regional backend buckets are used with: * - Regional internal Application Load Balancers * - Regional external Application Load Balancers * * > **Note:** Regional backend buckets have important limitations: * - Cloud CDN cannot be enabled * - Only public buckets are supported (private bucket access is not available) * - Only GET requests are supported * - The bucket must be in the same region as the load balancer * - Single-region buckets only (multi-region and dual-region buckets are not supported) * * > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. * See Provider Versions for more details on beta resources. * * To get more information about RegionBackendBucket, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/beta/regionBackendBuckets) * * 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 * * ### Region Backend Bucket Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const imageBackendBucket = new gcp.storage.Bucket("image_backend", { * name: "region-image-store-bucket", * location: "US-CENTRAL1", * forceDestroy: true, * uniformBucketLevelAccess: true, * }); * const imageBackend = new gcp.compute.RegionBackendBucket("image_backend", { * name: "region-image-backend-bucket", * region: "us-central1", * bucketName: imageBackendBucket.name, * description: "Regional backend bucket example", * loadBalancingScheme: "INTERNAL_MANAGED", * }); * ``` * ### Region Backend Bucket Internal Lb * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const internalBackendBucket = new gcp.storage.Bucket("internal_backend", { * name: "regional-internal-bucket", * location: "US-CENTRAL1", * forceDestroy: true, * uniformBucketLevelAccess: true, * website: { * mainPageSuffix: "index.html", * notFoundPage: "404.html", * }, * }); * const internalBackend = new gcp.compute.RegionBackendBucket("internal_backend", { * name: "regional-internal-backend", * region: "us-central1", * bucketName: internalBackendBucket.name, * loadBalancingScheme: "INTERNAL_MANAGED", * description: "Regional internal backend bucket for static content", * }); * const index = new gcp.storage.BucketObject("index", { * name: "index.html", * bucket: internalBackendBucket.name, * content: "<html><body><h1>Regional Internal LB Backend Bucket</h1></body></html>", * }); * ``` * ### Region Backend Bucket External Lb * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const externalBackendBucket = new gcp.storage.Bucket("external_backend", { * name: "regional-external-bucket", * location: "US-EAST1", * forceDestroy: true, * uniformBucketLevelAccess: true, * website: { * mainPageSuffix: "index.html", * notFoundPage: "404.html", * }, * }); * const externalBackend = new gcp.compute.RegionBackendBucket("external_backend", { * name: "regional-external-backend", * region: "us-east1", * bucketName: externalBackendBucket.name, * loadBalancingScheme: "EXTERNAL_MANAGED", * description: "Regional external backend bucket for static content", * }); * const index = new gcp.storage.BucketObject("index", { * name: "index.html", * bucket: externalBackendBucket.name, * content: "<html><body><h1>Regional External LB Backend Bucket</h1></body></html>", * }); * const staticAsset = new gcp.storage.BucketObject("static_asset", { * name: "assets/style.css", * bucket: externalBackendBucket.name, * content: "body { font-family: Arial, sans-serif; }", * }); * ``` * * ## Import * * RegionBackendBucket can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/backendBuckets/{{name}}` * * `{{project}}/{{region}}/{{name}}` * * `{{region}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, RegionBackendBucket can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/regionBackendBucket:RegionBackendBucket default projects/{{project}}/regions/{{region}}/backendBuckets/{{name}} * $ pulumi import gcp:compute/regionBackendBucket:RegionBackendBucket default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:compute/regionBackendBucket:RegionBackendBucket default {{region}}/{{name}} * $ pulumi import gcp:compute/regionBackendBucket:RegionBackendBucket default {{name}} * ``` */ export declare class RegionBackendBucket extends pulumi.CustomResource { /** * Get an existing RegionBackendBucket 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: string, id: pulumi.Input<pulumi.ID>, state?: RegionBackendBucketState, opts?: pulumi.CustomResourceOptions): RegionBackendBucket; /** * Returns true if the given object is an instance of RegionBackendBucket. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is RegionBackendBucket; /** * Cloud Storage bucket name. The bucket must be in the same region as this * backend bucket. */ readonly bucketName: pulumi.Output<string>; /** * Creation timestamp in RFC3339 text format. */ readonly creationTimestamp: pulumi.Output<string>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * An optional textual description of the resource; provided by the * client when the resource is created. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the load balancer type this backend bucket will be used with. * Possible values: * - 'INTERNAL_MANAGED': for regional internal Application Load Balancers * - 'EXTERNAL_MANAGED': for regional external Application Load Balancers * This field is required for regional backend buckets. * Possible values are: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. */ readonly loadBalancingScheme: pulumi.Output<string>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the * last character, which cannot be a dash. */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * The region where the backend bucket resides. */ readonly region: pulumi.Output<string>; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output<string>; /** * Create a RegionBackendBucket resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RegionBackendBucketArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RegionBackendBucket resources. */ export interface RegionBackendBucketState { /** * Cloud Storage bucket name. The bucket must be in the same region as this * backend bucket. */ bucketName?: pulumi.Input<string | undefined>; /** * Creation timestamp in RFC3339 text format. */ creationTimestamp?: pulumi.Input<string | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * An optional textual description of the resource; provided by the * client when the resource is created. */ description?: pulumi.Input<string | undefined>; /** * Specifies the load balancer type this backend bucket will be used with. * Possible values: * - 'INTERNAL_MANAGED': for regional internal Application Load Balancers * - 'EXTERNAL_MANAGED': for regional external Application Load Balancers * This field is required for regional backend buckets. * Possible values are: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. */ loadBalancingScheme?: pulumi.Input<string | undefined>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the * last character, which cannot be a dash. */ name?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * The region where the backend bucket resides. */ region?: pulumi.Input<string | undefined>; /** * The URI of the created resource. */ selfLink?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a RegionBackendBucket resource. */ export interface RegionBackendBucketArgs { /** * Cloud Storage bucket name. The bucket must be in the same region as this * backend bucket. */ bucketName: pulumi.Input<string>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * An optional textual description of the resource; provided by the * client when the resource is created. */ description?: pulumi.Input<string | undefined>; /** * Specifies the load balancer type this backend bucket will be used with. * Possible values: * - 'INTERNAL_MANAGED': for regional internal Application Load Balancers * - 'EXTERNAL_MANAGED': for regional external Application Load Balancers * This field is required for regional backend buckets. * Possible values are: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`. */ loadBalancingScheme?: pulumi.Input<string | undefined>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the * last character, which cannot be a dash. */ name?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * The region where the backend bucket resides. */ region: pulumi.Input<string>; } //# sourceMappingURL=regionBackendBucket.d.ts.map