Google Cloud Storage Setup¶
This guide creates a Google Cloud service account with read-only access to a Cloud Storage bucket. After downloading its JSON key, follow Cloud Storage to add it in the LightlyStudio Enterprise GUI.
Required Permissions¶
LightlyStudio needs these permissions on the bucket:
storage.objects.list— list objects in the bucketstorage.objects.get— read images and videos
The predefined
Storage Object Viewer
role (roles/storage.objectViewer) contains both permissions. Grant it on only
the buckets LightlyStudio needs to read.
Step 1: Create a Service Account¶
- Open the Service Accounts page in the Google Cloud console and select the project that owns the bucket.
- Click Create service account and enter a name such as
LightlyStudio. - Click Create and continue, then Done. You can grant bucket-level access in the next step instead of assigning a project-wide role.
See Google's service-account creation guide for the required administrative roles and other creation methods.
Step 2: Grant Read Access to the Bucket¶
- Open Cloud Storage → Buckets and select the bucket.
- Open the Permissions tab and click Grant access.
- Enter the service account email as the principal.
- Select Cloud Storage → Storage Object Viewer, then save.
Repeat these steps for each bucket LightlyStudio must read.
Step 3: Create a JSON Key¶
- Return to the Service Accounts page and select the service account.
- Open Keys → Add key → Create new key.
- Select JSON and click Create. Google downloads the key once; store it securely until you add it to LightlyStudio.
Note
Your organization might disable service-account key creation. If Create new key is unavailable, ask your Google Cloud administrator whether an exception is appropriate. See Google's service-account key guide.
Warning
A service-account JSON key is a long-lived secret. Do not commit it to source control or paste it into logs. Rotate it according to your organization's security policy and delete keys that are no longer used.
Next Step¶
Open Cloud Storage — Step 2,
select Google Cloud Storage, and paste the complete downloaded JSON object.
After saving, Python clients can call ls.connect() and use paths such as
gcs://my-bucket/images/.