getBucketObjectContent

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

Warning: The object content will be saved in the state, and visiable to everyone who has access to the state file.

Example Usage

Example file object stored within a folder.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.StorageFunctions;
import com.pulumi.gcp.storage.inputs.GetBucketObjectContentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var key = StorageFunctions.getBucketObjectContent(GetBucketObjectContentArgs.builder()
.name("encryptedkey")
.bucket("keystore")
.build());
ctx.export("encrypted", key.applyValue(getBucketObjectContentResult -> getBucketObjectContentResult.content()));
}
}

Return

A collection of values returned by getBucketObjectContent.

Parameters

argument

A collection of arguments for invoking getBucketObjectContent.


suspend fun getBucketObjectContent(bucket: String, content: String? = null, name: String): GetBucketObjectContentResult

Return

A collection of values returned by getBucketObjectContent.

Parameters

bucket

The name of the containing bucket.

content

(Computed) Content-Language of the object content.

name

The name of the object.

See also


Return

A collection of values returned by getBucketObjectContent.

Parameters

argument

Builder for com.pulumi.gcp.storage.kotlin.inputs.GetBucketObjectContentPlainArgs.

See also