@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
143 lines • 5.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Downloads a single file from a Google Artifact Registry repository to a local
* path and exposes its metadata and content hashes. Applies to file-based
* Artifact Registry formats (Generic, Maven, npm, Python, Apt, Yum, Go). For
* Docker/OCI images, use
* `gcp.artifactregistry.getDockerImage`.
*
* > **Note:** This data source downloads the file on every Terraform read
* (i.e. every `plan` and `apply`). For large files this can add significant
* time to each run. Use `overwrite = false` to skip the download when the
* local file already matches the remote — see the `overwrite` argument below.
*
* To get more information about Artifact Registry files, see:
*
* * [API documentation](https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.files)
*
* ## Example Usage
*/
export declare function getFile(args: GetFileArgs, opts?: pulumi.InvokeOptions): Promise<GetFileResult>;
/**
* A collection of arguments for invoking getFile.
*/
export interface GetFileArgs {
/**
* The Artifact Registry file ID. For Generic repositories this is `<package>:<version>:<filename>`; for other formats refer to the file listing in the API. Slashes and other reserved characters are URL-encoded by the provider.
*/
fileId: string;
/**
* The location of the repository.
*/
location: string;
/**
* Local filesystem path where the downloaded bytes are written. Parent directories are created if missing.
*/
outputPath: string;
/**
* If `true` (default), the file at `outputPath` is always downloaded and overwritten on every read. If `false`, the download is skipped when the file already exists at `outputPath` and the Artifact Registry-reported hash matches the hash from the previous read — useful for large files that rarely change, to avoid re-downloading on every `plan`/`apply`.
*/
overwrite?: boolean;
/**
* The project in which the repository lives. Defaults to the provider project.
*/
project?: string;
/**
* The ID of the repository.
*/
repositoryId: string;
}
/**
* A collection of values returned by getFile.
*/
export interface GetFileResult {
/**
* Creation time (RFC 3339).
*/
readonly createTime: string;
readonly fileId: string;
/**
* Map of hash type (e.g. `SHA256`, `MD5`) to the corresponding hash value reported by Artifact Registry.
*/
readonly hashes: {
[key: string]: string;
};
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly location: string;
/**
* The fully-qualified file resource name (`projects/.../files/...`).
*/
readonly name: string;
/**
* Base64-encoded SHA-256 of the downloaded file contents.
*/
readonly outputBase64sha256: string;
readonly outputPath: string;
/**
* Hex-encoded SHA-256 of the downloaded file contents.
*/
readonly outputSha256: string;
readonly overwrite?: boolean;
readonly project: string;
readonly repositoryId: string;
/**
* Size of the file in bytes, as reported by Artifact Registry.
*/
readonly sizeBytes: number;
/**
* Last update time (RFC 3339).
*/
readonly updateTime: string;
}
/**
* Downloads a single file from a Google Artifact Registry repository to a local
* path and exposes its metadata and content hashes. Applies to file-based
* Artifact Registry formats (Generic, Maven, npm, Python, Apt, Yum, Go). For
* Docker/OCI images, use
* `gcp.artifactregistry.getDockerImage`.
*
* > **Note:** This data source downloads the file on every Terraform read
* (i.e. every `plan` and `apply`). For large files this can add significant
* time to each run. Use `overwrite = false` to skip the download when the
* local file already matches the remote — see the `overwrite` argument below.
*
* To get more information about Artifact Registry files, see:
*
* * [API documentation](https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.files)
*
* ## Example Usage
*/
export declare function getFileOutput(args: GetFileOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetFileResult>;
/**
* A collection of arguments for invoking getFile.
*/
export interface GetFileOutputArgs {
/**
* The Artifact Registry file ID. For Generic repositories this is `<package>:<version>:<filename>`; for other formats refer to the file listing in the API. Slashes and other reserved characters are URL-encoded by the provider.
*/
fileId: pulumi.Input<string>;
/**
* The location of the repository.
*/
location: pulumi.Input<string>;
/**
* Local filesystem path where the downloaded bytes are written. Parent directories are created if missing.
*/
outputPath: pulumi.Input<string>;
/**
* If `true` (default), the file at `outputPath` is always downloaded and overwritten on every read. If `false`, the download is skipped when the file already exists at `outputPath` and the Artifact Registry-reported hash matches the hash from the previous read — useful for large files that rarely change, to avoid re-downloading on every `plan`/`apply`.
*/
overwrite?: pulumi.Input<boolean | undefined>;
/**
* The project in which the repository lives. Defaults to the provider project.
*/
project?: pulumi.Input<string | undefined>;
/**
* The ID of the repository.
*/
repositoryId: pulumi.Input<string>;
}
//# sourceMappingURL=getFile.d.ts.map