What you’ll set up
- A new Cloud Storage bucket just for Beacon, with uniform bucket-level access, public access prevention enforced, versioning, and optionally your Cloud KMS key. The module always creates its own bucket and does not manage existing ones.
beacon-endpoint-writer, a service account that can create objects below your Beacon prefix and can’t list, read, or delete them.beacon-endpoint-reader, a read-only service account for checking uploads.
terraform/gcs.
Before you start
1. Add the module
Pick a root prefix such asbeacon-prod. Beacon adds runtime/ and inventory/ below it, so don’t put either in the prefix.
Create a main.tf in a new directory, or add these blocks to your existing configuration. Change the project, location, bucket name, and prefix:
main.tf
ref pins the module to a Beacon release. The module first shipped in v1.3.38, and any later release tag works too.
2. Create the bucket and service accounts
yes. It’s working when the apply ends with:
3. Create the writer’s key
The module doesn’t create keys by default, because Terraform would store the private key in its state file. Create the key with gcloud:created key [...]. Your rollout guide puts the file on each Mac, root-owned with mode 0600, outside Beacon’s directories. Google rejects a brand-new key for up to a minute, so give it a minute before a Mac first uses it.
Allow service-account keys
If gcloud saysKey creation is not allowed on this service account, your Google Cloud organization blocks service-account keys, which new organizations do by default. Allow them in this project only. It needs the Organization Policy Administrator role on the organization. Add this to main.tf and run terraform apply:
4. Give the values to your rollout
Then continue with your rollout:
5. Confirm delivery
After the forwarder is running on a Mac, write a test event there:roles/iam.serviceAccountTokenCreator on it and add --impersonate-service-account "$BEACON_GCS_READER_EMAIL". A new grant can take a few minutes to work.
Options
Set any of these in themodule "beacon_gcs" block and run terraform apply again. Every input is described in variables.tf.
Encrypt with your own Cloud KMS key
Encrypt with your own Cloud KMS key
roles/cloudkms.cryptoKeyEncrypterDecrypter on the key. Set grant_kms_to_storage_agent = false if you manage the key’s IAM elsewhere. The writer needs no KMS permission.Delete old objects
Delete old objects
noncurrent_version_expiration_days (default 30). Set versioning_enabled = false to turn versioning off.Create the writer's key with Terraform
Create the writer's key with Terraform
sensitive:terraform apply, write it to a file with (umask 077; terraform output -raw writer_private_key | base64 --decode > beacon-gcs-writer.json). The private key is stored in Terraform state, so use this only when your state is encrypted and access is restricted.Match your organization's naming
Match your organization's naming
writer_account_idandreader_account_idrename the service accounts.labelslabels the bucket.enable_apis = falseskips enabling the APIs, for projects where they’re managed elsewhere.
Outputs
Rotate the writer key
Rotation happens outside Terraform. Create a new key, deliver it to every Mac, restart the forwarder, confirm a new object arrives, and then delete the old key. Your rollout guide has the exact commands under credential rotation.Remove
- Remove the forwarder from your Macs. Uninstalling Beacon removes it.
- To delete the bucket along with the telemetry in it, set
force_destroy = truein the module and runterraform applyfirst. Without it, destroy removes the service accounts and stops at the bucket while it holds objects. - Run
terraform destroy. Deleting the writer service account also deletes its keys.
Troubleshooting
The bucket name is already taken
The bucket name is already taken
Someone else, in any project, already has a bucket with that name. Choose another
bucket_name.Uploads fail with 403
Uploads fail with 403
Check that the forwarder’s bucket and prefix match the Terraform outputs exactly. The writer can only create objects below
<prefix>/.Related
Jamf and GCS
Roll out Beacon to Claude Code, Codex, and Cursor users with Jamf Pro and forward to Cloud Storage.
Claude with Rippling and GCS
Roll out Beacon with Rippling and forward to Cloud Storage.
AWS S3 with Terraform
The same setup for an S3 bucket.
Object storage forwarding
Forward to S3, Cloud Storage, or both from one Mac.