GithubHelp home page GithubHelp logo

lambkin's People

Contributors

crazybus avatar dwcramer avatar elasticdog avatar jarpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lambkin's Issues

Failure when run from path with spaces

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

lambkin does not zips module from /venv/lib64

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 :)

Error when publishing unless an existing --role is specified

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

CLI fails when no region is provided

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.

awscli profiles

Is there a way to use awscli profiles with this?
Doesn't seem like --profile is an option

Cron syntax for scheduling

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.

Does lambkin support AWS Signature Version 4 Signing Process?

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.

Wrap CLI exceptions.

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"

Additional Metadata

Is there a way to add new metadata to the metadata.json?
For example set the timeout or the role

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.