-
Notifications
You must be signed in to change notification settings - Fork 20
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
Loki authentication for deployed lambda functions #3
Comments
It fails when executing the command "shipper" with auth:
|
For this to work "loki_user" and "loki_password" should be renamed to "user" and "password" since that's the name they get from @cli.command(short_help="Deploy Loki shipper lambda function.")
@click.option('-l', '--loki', default='http://localhost:3100', help='Loki endpoint URL')
@click.option('-U', '--user', default='', help='User for Loki authentication')
@click.option('-W', '--password', default='', help='Password for Loki authentication')
@click.option('-b', '--build', default=False, is_flag=True, help='Flag indicates if deployment packages should be build')
@click.argument('action', nargs=1, type=click.Choice(['start', 'stop']))
@click.pass_context
def shipper(context, loki, action, build, user='', password=''):
""" Starts/Stops the shipper lambda function """
if build or __should_package():
context.invoke(package)
config = {
'FunctionName': SHIPPER_NAME,
'Runtime': 'python3.7',
'Role': '', # Injected on deployment
'Handler': 'loki-shipper.lambda_handler',
'Code': {'ZipFile': open(SHIPPER_ZIP, 'rb').read()},
'Description': 'Loki Shipper',
'Environment': {
'Variables': {
'LOKI_ENDPOINT': loki,
'LOKI_USER': user,
'LOKI_PASSWORD': password
}
}
}
__start_lambda(config) if action == 'start' else __stop_lambda(config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've deployed a lambda function using the loki-shipper.py. It has LOKI_ENDPOINT as environment variable but it doesn't have any authentication. Loki requires authentication in order to be able to push logs to the endpoint(I'm using grafana cloud and I've configured a loki endpoint on the grafana logs dashboard).
I've made all the changes and updated the docs(Readme.md) . Please check the blow archive as I wasn't able to raise a PR with the changes.
loki-shipper-auth-readme.zip
The text was updated successfully, but these errors were encountered: