How to edit files directly on Google Cloud Storage using VS Code?

Viewed 7356

Is there a way to directly load / edit / save files to a given bucket in Google Cloud Storage without having to download the file, edit it, and then upload it again?

We have a GCS bucket with about 20 config files that we edit for various reasons. We would really just like to load the bucket into VS Code and then browse between updating the files and saving edits.

I have tried the vscode-bucket-explorer extension for VS Code but this just seems to provide viewing capability with no editing/saving capability. Unless I am missing something?

Is there a way to mount a bucket as a drive on a Mac? With read/write ability?

1 Answers

Is there a way to directly load / edit / save files to a given bucket in Google Cloud Storage without having to download the file edit it and then upload it again

No, blobs objects in Google Cloud Storage can not be edited in place.

As with buckets, existing objects cannot be directly renamed. Instead, you can copy an object, give the copied version the desired name, and delete the original version of the object. See Renaming an object for a step-by-step guide, including instructions for tools like gsutil and the Google Cloud Console, which handle the renaming process automatically.

Is there a way to mount a bucket as a drive on a Mac? With read/write ability?

You can use Cloud Storage FUSE where the mounted bucket will behave similarly to a persistent disk.

Cloud Storage FUSE is an open source FUSE adapter that allows you to mount Cloud Storage buckets as file systems on Linux or macOS systems. It also provides a way for applications to upload and download Cloud Storage objects using standard file system semantics. Cloud Storage FUSE can be run anywhere with connectivity to Cloud Storage, including Google Compute Engine VMs or on-premises systems

Related