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:0600. Your rollout guide covers this step for your MDM. Then delete the local copy.
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; you can also list with your own identity if it can read the bucket.
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
terraform output -raw writer_private_key | base64 --decode > beacon-gcs-writer.json after adding a matching output block. 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.
- Run
terraform destroy. Deleting the writer service account also deletes its keys. Destroy stops at a bucket that still holds objects. To delete the telemetry too, setforce_destroy = true, runterraform apply, and then destroy.
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
Claude with Jamf and GCS
Roll out Beacon 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.