jarpy / lambkin Goto Github PK
View Code? Open in Web Editor NEWCLI tool for generating and managing simple functions in AWS Lambda
License: Apache License 2.0
CLI tool for generating and managing simple functions in AWS Lambda
License: Apache License 2.0
The workaround for this is obvious enough, but I thought you might want to know about the error:
(es-curator) AUS-SCollins:serverless-curator scollins$ lambkin build
/bin/sh: /Users/scollins/Google Drive/GitHub/LocalPartners/ELK/logstash/serverless-curator/venv/bin/pip: "/Users/scollins/Google: bad interpreter: No such file or directory
Traceback (most recent call last):
File "/Users/scollins/.virtualenvs/es-curator/bin/lambkin", line 11, in <module>
sys.exit(main())
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/lambkin/lambkin.py", line 240, in main
cli()
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/lambkin/lambkin.py", line 85, in build
print run_in_virtualenv('pip install -r requirements.txt')
File "/Users/scollins/.virtualenvs/es-curator/lib/python2.7/site-packages/lambkin/virtualenv.py", line 26, in run_in_virtualenv
return check_output('. venv/bin/activate && %s' % command, shell=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '. venv/bin/activate && pip install -r requirements.txt' returned non-zero exit status 126
Hello Guys,
My cryptography module gets install in /venv/lib64/python2.7/site-packages , as observed lambkin only zips module from /venv/lib/python2.7/site-packages hence the lambda function fails to execute, due to missing package files. But if I manually zip all modules from both the lib folder, the function works fine. Any help on this ? as I find lambkin very easy tool for building lambda function locally and want to continue using it :)
As I am not heavily knowledgeable of Python Scripting, I would like to know and see if it is possible to add a feature to handle index rollover via serverless-curator as i can see that it is available in curator itself as mentioned in the link below.
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/rollover.html
Trying to get this hello world example working, I was receiving the following error until I added --role "lambda_basic_execution"
to my lambkin publish
command. I don't see a way to leave feedback on the article, but perhaps a note in lambkin's docs would help.
davcrame@DAVCRAME-M-G095 ~/rws/curator-lambda/serverless-curator
$ lambkin publish
Traceback (most recent call last):
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/bin/lambkin", line 11, in <module>
sys.exit(main())
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/lambkin/lambkin.py", line 240, in main
cli()
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/lambkin/lambkin.py", line 146, in publish
Role=get_role_arn(role),
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/lambkin/aws.py", line 31, in get_role_arn
return role.arn
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/boto3/resources/factory.py", line 339, in property_loader
self.load()
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/boto3/resources/factory.py", line 505, in do_action
response = action(self, *args, **kwargs)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/boto3/resources/action.py", line 83, in __call__
response = getattr(parent.meta.client, operation_name)(**params)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/botocore/client.py", line 251, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/davcrame/rws/curator-lambda/serverless-curator/venv/lib/python2.7/site-packages/botocore/client.py", line 537, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (NoSuchEntity) when calling the GetRole operation: Unknown
When you run a command such as --help
without a region
parameter, it fails:
$ lambkin --help
Traceback (most recent call last):
(...)
File "/usr/local/lib/python2.7/site-packages/lambkin/lambkin.py", line 25, in <module>
lmbda = boto3.client('lambda')
(...)
botocore.exceptions.NoRegionError: You must specify a region.
Is there a way to use awscli profiles with this?
Doesn't seem like --profile is an option
As discussed: I have the use case where I need to schedule in cron syntax โ run a lambda function once a month on the 25th or something like that.
I would like to access AWS Elasticsearch Service via Lambda function, but I get this error:
{"stackTrace": [["/var/task/serverless-curator.py", 43, "handler", "index_list = curator.IndexList(es)"], ["/var/task/curator/indexlist.py", 30, "__init__", "self.__get_indices()"], ["/var/task/curator/indexlist.py", 65, "__get_indices", "self.all_indices = get_indices(self.client)"], ["/var/task/curator/utils.py", 372, "get_indices", "raise FailedExecution('Failed to get indices. Error: {0}'.format(e))"]], "errorType": "FailedExecution", "errorMessage": "Failed to get indices. Error: TransportError(403, u'{\"Message\":\"User: anonymous is not authorized to perform: es:ESHttpGet on resource: XXX\"}')"}
Access policy for elasticsearch domain is:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::XXX:role/XXX"
},
"Action": "es:*",
"Resource": "arn:aws:es:eu-west-1:XXX:domain/XXX/*"
}
]
}
The role is assigned to the Lambda function. Am I missing something? Maybe someone has a clue? Thanks.
Don't do this:
jarpy@RASA:~/src/fang$ lambkin publish
Traceback (most recent call last):
File "/usr/local/bin/lambkin", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/lambkin/lambkin.py", line 218, in main
cli()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/lambkin/lambkin.py", line 112, in publish
raise Fatal('Please provide a description with "--description"')
lambkin.exceptions.Fatal: Please provide a description with "--description"
Is there a way to add new metadata to the metadata.json?
For example set the timeout or the role
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.