Hey Hi All Quick question: Does Cerbos `Hub` supp...
# help
h
Hey Hi All Quick question: Does Cerbos
Hub
supports aws
Lambda
https://github.com/cerbos/cerbos-aws-lambda? Any documentation around it would be helpful, thanks
a
Hey! Indeed it does - just swap out the configuration file to one with your configuration for Cerbos Hub (see https://docs.cerbos.dev/cerbos-hub/getting-started#_connect_a_cerbos_pdp_to_hub)
👍 1
h
Thanks @Alex Olivier (Cerbos) for the quick reply. I have tried using environment variables to manage hub secret in
sam.yaml
instead of conf.yml I get following error for some reason (Log in debug mode):
Copy code
"error": "failed to create store: failed to determine cache directory: neither $XDG_CACHE_HOME nor $HOME are defined"
a
Sorry about that - let me try and replicate
👍 1
h
Thank you Alex. CloudWatch is full of following logs for health check errors, was not sure its related, thanks
Copy code
2023/10/24 16:45:15 cerbos health check: Get "<http://127.0.0.1:3592/_cerbos/health>": dial tcp 127.0.0.1:3592: connect: connection refused, pid: 13
a
Thats to be expected as it seems the PDP hasm't started up - I'm spinng up an env atm
h
Cool
a
Ok got a fix In your SAM - set an environment variable:
XDG_CACHE_HOME: /tmp
🙌 1
Using Hub requires a cache directory but Lambda don't have a HOME defined - setting this env will point it to the
/tmp
dir
h
Thank you @Alex Olivier (Cerbos) for your valuable inputs. It has worked 👍. But Log still full of health check error message, is there fix for it too?
a
The healthchecks should be passing if the container has started - could you share the execution logs from a cold start?
h
log-events-viewer-result.csv
a
Ok in this case it seems the healthcheck is a tad aggresive as once it starts up then the healthcheck passes and executions are working as expected. I will look into scaling the logging/retry back a bit, but for now the instance is working as expected and pulling down the latest bundle
1