Skip to main content
Use this page if you manage AWS with Terraform. It covers the AWS side of S3 forwarding: the bucket, the identity your Macs upload with, and the values your rollout needs. When you finish, continue with your rollout guide from the step after its AWS setup. The AWS CLI steps in the rollout guides create the same resources. Follow either one.
Want Asymptote to read this bucket for your dashboard? Follow Asymptote with Your Own S3 Bucket instead. It uses this module together with the Asymptote reader module.

What you’ll set up

  • A new S3 bucket just for Beacon, with public access blocked, ACLs disabled, HTTPS required, default encryption (SSE-S3, or SSE-KMS with your key), and versioning. The module always creates its own bucket and does not manage existing ones.
  • beacon-endpoint-writer, an IAM user that can upload objects below your Beacon prefix and can’t read or delete them.
Every Mac’s forwarder writes both of Beacon’s logs to the bucket:
The module is in the Beacon repository at terraform/aws-s3.

Before you start

1. Add the module

Pick a root prefix such as beacon-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 region, bucket name, and prefix:
main.tf
The bucket is created in the provider’s region. 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 writer

Review the plan and type yes. It’s working when the apply ends with:
Save the values as shell variables for the next steps. The rollout guides use the same names:

3. Create the writer’s access key

The module doesn’t create access keys by default, because Terraform would store the secret in its state file. Create the key with the AWS CLI:
AWS shows the secret only once. Store AccessKeyId and SecretAccessKey in your password manager or MDM secret store. The key starts with AKIA and doesn’t expire, so the forwarder keeps uploading without anyone renewing a credential.

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:
The forwarder uploads in batches, so allow up to five minutes. Then list the objects with your own AWS identity, because the writer can’t read the bucket:

Options

Set any of these in the module "beacon_s3" block and run terraform apply again. Every input is described in variables.tf.
The bucket uses SSE-KMS with an S3 Bucket Key. The writer gets kms:GenerateDataKey on the key. The key’s own policy must allow IAM policies in your account to grant access, which the default key policy does.
Objects below the prefix are deleted a year after upload. Versioning is on by default, so a deleted or replaced object stays recoverable for noncurrent_version_expiration_days (default 30). Set versioning_enabled = false to turn versioning off.
Terraform creates the writer’s key. Read the secret with terraform output -raw writer_secret_access_key after adding a matching output block. The secret is stored in Terraform state, so use this only when your state is encrypted and access is restricted.
  • writer_user_name renames the writer.
  • iam_path puts it under a path such as /beacon/.
  • permissions_boundary_arn attaches a permissions boundary to it.
  • tags tags every resource the module creates.
By default the writer also has s3:ListBucket, which the forwarder’s startup check needs. Without it, uploads still work, but the forwarder logs a health-check error each time it starts. s3:ListBucket lets the writer see object names, never their contents.

Outputs

Rotate the writer key

Rotation happens outside Terraform. IAM allows two keys per user, so the old key keeps working while you roll out the new one.
  1. Create a second key: aws iam create-access-key --user-name "$BEACON_S3_WRITER".
  2. Give the new key to your rollout and rerun its forwarder setup on every Mac. In Fleet, update the two secret variables and rerun beacon-configure-s3-forwarding.sh.
  3. When every Mac has the new key, delete the old one: aws iam delete-access-key --user-name "$BEACON_S3_WRITER" --access-key-id <old key id>.

Remove

  1. Remove the forwarder from your Macs. Uninstalling Beacon removes it.
  2. Delete the access keys you created with the AWS CLI. IAM refuses to delete a user that still has keys:
  3. Run terraform destroy. It stops at a bucket that still holds objects. To delete the telemetry too, set force_destroy = true, run terraform apply, and then destroy.

Troubleshooting

Someone else, in any AWS account, already has a bucket with that name. Choose another bucket_name.
terraform destroy or a rename is trying to delete an IAM user that still has a key you created with the AWS CLI. Delete the key first. See Remove.
Check that the forwarder’s bucket, region, and prefix match the Terraform outputs exactly. The writer can only upload below <prefix>/.

Beacon with Fleet and S3

Roll out Beacon with Fleet and forward to S3.

Claude with Jamf and S3

Roll out Beacon with Jamf Pro and forward to S3.

Google Cloud Storage with Terraform

The same setup for a Cloud Storage bucket.