@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
107 lines • 3.95 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "../types/output";
/**
* Gets existing object contents inside an existing bucket in Google Cloud Storage service (GCS).
* See [the official documentation](https://cloud.google.com/storage/docs/key-terms#objects)
* and
* [API](https://cloud.google.com/storage/docs/json_api/v1/objects).
*
* > **Warning:** The object content will be saved in the state, and visible to everyone who has access to the state file.
*
* > **Warning:** This data source loads all object contents into memory. Limit the results with `matchGlob` or `prefix`.
*
* ## Example Usage
*
* Extract object base64 contents from objects:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = gcp.storage.getBucketObjectContents({
* bucket: "example-bucket",
* matchGlob: "example-{foo,bar}.json",
* prefix: "example",
* });
* export const base64EncodedJsonContents = example.then(example => example.bucketObjects.map(__item => __item.contentBase64));
* ```
*/
export declare function getBucketObjectContents(args: GetBucketObjectContentsArgs, opts?: pulumi.InvokeOptions): Promise<GetBucketObjectContentsResult>;
/**
* A collection of arguments for invoking getBucketObjectContents.
*/
export interface GetBucketObjectContentsArgs {
/**
* The name of the containing bucket.
*/
bucket: string;
/**
* A glob pattern used to filter results (for example, `foo*bar`).
*/
matchGlob?: string;
/**
* Filter results to include only objects whose names begin with this prefix.
*/
prefix?: string;
}
/**
* A collection of values returned by getBucketObjectContents.
*/
export interface GetBucketObjectContentsResult {
readonly bucket: string;
/**
* A list of retrieved object contents contained in the provided GCS bucket. Structure is defined below.
*/
readonly bucketObjects: outputs.storage.GetBucketObjectContentsBucketObject[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly matchGlob?: string;
readonly prefix?: string;
}
/**
* Gets existing object contents inside an existing bucket in Google Cloud Storage service (GCS).
* See [the official documentation](https://cloud.google.com/storage/docs/key-terms#objects)
* and
* [API](https://cloud.google.com/storage/docs/json_api/v1/objects).
*
* > **Warning:** The object content will be saved in the state, and visible to everyone who has access to the state file.
*
* > **Warning:** This data source loads all object contents into memory. Limit the results with `matchGlob` or `prefix`.
*
* ## Example Usage
*
* Extract object base64 contents from objects:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const example = gcp.storage.getBucketObjectContents({
* bucket: "example-bucket",
* matchGlob: "example-{foo,bar}.json",
* prefix: "example",
* });
* export const base64EncodedJsonContents = example.then(example => example.bucketObjects.map(__item => __item.contentBase64));
* ```
*/
export declare function getBucketObjectContentsOutput(args: GetBucketObjectContentsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetBucketObjectContentsResult>;
/**
* A collection of arguments for invoking getBucketObjectContents.
*/
export interface GetBucketObjectContentsOutputArgs {
/**
* The name of the containing bucket.
*/
bucket: pulumi.Input<string>;
/**
* A glob pattern used to filter results (for example, `foo*bar`).
*/
matchGlob?: pulumi.Input<string | undefined>;
/**
* Filter results to include only objects whose names begin with this prefix.
*/
prefix?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=getBucketObjectContents.d.ts.map