StorageFunctions

Functions

Link copied to clipboard

Gets an existing bucket in Google Cloud Storage service (GCS). See the official documentation and API.

suspend fun getBucket(name: String): GetBucketResult
suspend fun getBucket(argument: suspend GetBucketPlainArgsBuilder.() -> Unit): GetBucketResult
Link copied to clipboard

Retrieves the current IAM policy data for bucket

Link copied to clipboard

Gets an existing object inside an existing bucket in Google Cloud Storage service (GCS). See the official documentation and API.

suspend fun getBucketObject(bucket: String? = null, name: String? = null): GetBucketObjectResult
Link copied to clipboard

Gets an existing object content inside an existing bucket in Google Cloud Storage service (GCS). See the official documentation and API.

suspend fun getBucketObjectContent(bucket: String, content: String? = null, name: String): GetBucketObjectContentResult
Link copied to clipboard

The Google Cloud storage signed URL data source generates a signed URL for a given storage object. Signed URLs provide a way to give time-limited read or write access to anyone in possession of the URL, regardless of whether they have a Google account. For more info about signed URL's is available here.

suspend fun getObjectSignedUrl(bucket: String, contentMd5: String? = null, contentType: String? = null, credentials: String? = null, duration: String? = null, extensionHeaders: Map<String, String>? = null, httpMethod: String? = null, path: String): GetObjectSignedUrlResult
Link copied to clipboard

Get the email address of a project's unique automatic Google Cloud Storage service account. For each Google Cloud project, Google maintains a unique service account which is used as the identity for various Google Cloud Storage operations, including operations involving customer-managed encryption keys and those involving storage notifications to pub/sub. This automatic Google service account requires access to the relevant Cloud KMS keys or pub/sub topics, respectively, in order for Cloud Storage to use these customer-managed resources. The service account has a well-known, documented naming format which is parameterised on the numeric Google project ID. However, as noted in the docs, it is only created when certain relevant actions occur which presuppose its existence. These actions include calling a Cloud Storage API endpoint to yield the service account's identity, or performing some operations in the UI which must use the service account's identity, such as attempting to list Cloud KMS keys on the bucket creation page. Use of this data source calls the relevant API endpoint to obtain the service account's identity and thus ensures it exists prior to any API operations which demand its existence, such as specifying it in Cloud IAM policy. Always prefer to use this data source over interpolating the project ID into the well-known format for this service account, as the latter approach may cause provider update errors in cases where the service account does not yet exist.

suspend fun getProjectServiceAccount(project: String? = null, userProject: String? = null): GetProjectServiceAccountResult