-
-
Notifications
You must be signed in to change notification settings - Fork 116
Migrate fastly log processor to pluto #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
users.users.nix-metrics = | ||
{ isNormalUser = true; | ||
description = "Nix Metrics Collection"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a statically allocated user (and uid), or can the service use the DynamicUser
feature, which creates an ad hoc user, when the service runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably possible. But it does need to have the AWS credentials somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case we could probably use LoadCredential
.
systemd.services.process-raw-nix-logs.serviceConfig.LoadCredential = [
"aws-cred:/path/to/actual/aws-cred-file"
];
The secret will then be provided at $CREDENTIALS_DIRECTORY/aws-cred
.
We currently deploy secrets through agenix. I can help integrate the secret, if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can share the secret with me via Bitwarden and I'll create the age file? Feel free to reach out on Matrix to expedite this process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edolstra Can we pick this up?
This seems to have stopped working:
|
We'll need to create an IAM user with a policy that has sufficient access. Note that it's not enough to have just a bucket policy. The IAM user policy must also allow bucket access. It worked for the We could maybe also consider moving this to a small EC2 instance as then we can use an IAM role instead of user. Which means we don't have to think about credentials rotation. Though not super string opinion in that. It's just nice not to have to think about credentials. |
This makes the service that ingest raw fastly logs and generates summaries (see https://github.com/NixOS/infra/tree/master/metrics/fastly) to
pluto
. Currently it's running on one of my home machines.This service runs once a week and kicks off some AWS Athena queries. It expects the credentials for the
fastly-log-processor
AWS user in/home/nix-metrics/.aws/config
. That user has access to thenixos-metrics
,nixos-athena
and fastly logs buckets.