@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
111 lines (110 loc) • 4.75 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "../types/output";
/**
* Gets an existing bucket in Google Cloud Storage service (GCS).
* See [the official documentation](https://cloud.google.com/storage/docs/key-terms#buckets)
* and
* [API](https://cloud.google.com/storage/docs/json_api/v1/buckets).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const my_bucket = gcp.storage.getBucket({
* name: "my-bucket",
* });
* ```
*/
export declare function getBucket(args: GetBucketArgs, opts?: pulumi.InvokeOptions): Promise<GetBucketResult>;
/**
* A collection of arguments for invoking getBucket.
*/
export interface GetBucketArgs {
/**
* The name of the bucket.
*/
name: string;
/**
* The ID of the project in which the resource belongs. If it is not provided then the data source will use the Compute API to find the project id that corresponds to the project number returned from the Storage API, and if no Compute API permissions are available or if the Compute API is disabled it defaults to the provider value. Supplying a value for `project` doesn't influence retrieving data about the bucket but it can be used to prevent use of the Compute API. If you do provide a `project` value ensure that it is the correct value for that bucket; the data source will not check that the project id and project number match.
*/
project?: string;
}
/**
* A collection of values returned by getBucket.
*/
export interface GetBucketResult {
readonly autoclasses: outputs.storage.GetBucketAutoclass[];
readonly cors: outputs.storage.GetBucketCor[];
readonly customPlacementConfigs: outputs.storage.GetBucketCustomPlacementConfig[];
readonly defaultEventBasedHold: boolean;
readonly effectiveLabels: {
[key: string]: string;
};
readonly enableObjectRetention: boolean;
readonly encryptions: outputs.storage.GetBucketEncryption[];
readonly forceDestroy: boolean;
readonly hierarchicalNamespaces: outputs.storage.GetBucketHierarchicalNamespace[];
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly ipFilters: outputs.storage.GetBucketIpFilter[];
readonly labels: {
[key: string]: string;
};
readonly lifecycleRules: outputs.storage.GetBucketLifecycleRule[];
readonly location: string;
readonly loggings: outputs.storage.GetBucketLogging[];
readonly name: string;
readonly project?: string;
readonly projectNumber: number;
readonly publicAccessPrevention: string;
readonly pulumiLabels: {
[key: string]: string;
};
readonly requesterPays: boolean;
readonly retentionPolicies: outputs.storage.GetBucketRetentionPolicy[];
readonly rpo: string;
readonly selfLink: string;
readonly softDeletePolicies: outputs.storage.GetBucketSoftDeletePolicy[];
readonly storageClass: string;
readonly timeCreated: string;
readonly uniformBucketLevelAccess: boolean;
readonly updated: string;
readonly url: string;
readonly versionings: outputs.storage.GetBucketVersioning[];
readonly websites: outputs.storage.GetBucketWebsite[];
}
/**
* Gets an existing bucket in Google Cloud Storage service (GCS).
* See [the official documentation](https://cloud.google.com/storage/docs/key-terms#buckets)
* and
* [API](https://cloud.google.com/storage/docs/json_api/v1/buckets).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const my_bucket = gcp.storage.getBucket({
* name: "my-bucket",
* });
* ```
*/
export declare function getBucketOutput(args: GetBucketOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetBucketResult>;
/**
* A collection of arguments for invoking getBucket.
*/
export interface GetBucketOutputArgs {
/**
* The name of the bucket.
*/
name: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs. If it is not provided then the data source will use the Compute API to find the project id that corresponds to the project number returned from the Storage API, and if no Compute API permissions are available or if the Compute API is disabled it defaults to the provider value. Supplying a value for `project` doesn't influence retrieving data about the bucket but it can be used to prevent use of the Compute API. If you do provide a `project` value ensure that it is the correct value for that bucket; the data source will not check that the project id and project number match.
*/
project?: pulumi.Input<string>;
}