Commit Graph

59 Commits

Author SHA1 Message Date
Steve Pulec
1689a2808f Fix creating SQS queue with same attributes. Closes #1663. 2018-05-31 23:05:50 -04:00
Steve Pulec
cf71532fa9 Fix for backwards compat with dockerpy 2. 2018-05-31 22:39:22 -04:00
Steve Pulec
e3ff6601bf
Merge pull request #1643 from alanjds/patch-1
LambdaVersion providing ARN on __repr__
2018-05-29 22:40:00 -04:00
Alan Justino da Silva
d4cc7f1399
LambdaVersion providing ARN on __repr__
Just a dirty patch
2018-05-15 15:13:01 -03:00
djkiourtsis
5d6655a7ee Add gocloud backend to lambda backends
Boto does does not include the govcloud backends when displaying lambda
regions.  In order to test lambda with a govcloud region, the region
must be explicitly added.
2018-05-03 11:42:52 -04:00
Alberto Vara
56f29a0e6e Fix/lambda backend (#1556)
* Fix exception with "object has no attribute"

When use this code:

   client = boto3.client('lambda')
   client.get_policy([...])

moto rise:
```
moto/awslambda/responses.py", line 109, in _get_policy
    lambda_backend = self.get_lambda_backend(full_url)
Exception: 'LambdaResponse' object has no attribute 'get_lambda_backend'
```

* fix shadows built-in name
2018-04-07 11:07:17 -07:00
Alexander Mohr
941d817da4 fix lambda endpoint parsing (#1395)
* fix endpoint parsing

* add new unittest

* finish test
2018-03-21 22:14:10 -07:00
Loukas Leontopoulos
3d7f584f64 Change lambda backend to support docker changes 2018-02-19 17:28:35 +02:00
Alexander Mohr
9d087b0729 add subject support (#1387) 2017-12-10 21:59:04 +00:00
Chris Tomlinson
279efc6b12 Bump flake8 version and handle new lint errors (#1385) 2017-12-08 21:02:34 +00:00
Alexander Mohr
97687d153a Implement CloudWatch get_metric_statistics (#1369)
* implement get_metric_statistics
2017-12-01 20:37:27 +00:00
Terry Cain
d5ee48eedd
Lambda improvements (#1344)
* Revamped the lambda function storage to do versioning.

* Flake8

* .

* Fixes

* Swapped around an if
2017-11-26 21:28:28 +00:00
Terry Cain
596bf84480
Fixed typo 2017-10-25 20:14:39 +01:00
Terry Cain
62a2d8f756
Improved lambda timings 2017-10-25 20:04:00 +01:00
Terry Cain
49ddb500a8 AWS X-Ray client mock. (#1255)
* X-Ray Client SDK patched

Fixes #1250

* Fixed flake8

* Fixed some issues

* Fixed flake8

* Fixed more typos

* Fixed python2 string

* Fixed aws-sdk patch order

* Added more test cases to test the patching
2017-10-16 17:06:22 -07:00
Chris Keogh
9bb07e6b6e add awslambda.add_permission 2017-10-03 20:02:23 +13:00
Chris Keogh
b994cf5291 add more realistic policy 2017-10-03 14:52:00 +13:00
Chris Keogh
fc9c250922 add basic awslambda get_policy 2017-10-03 13:33:50 +13:00
Alexander Mohr
9008b85299 lambda + SNS enhancements (#1048)
* updates

- support lambda messages from SNS
- run lambda in docker container

* decode output

* populate timeout

* simplify

* whoops

* skeletons of cloudwatchlogs

* impl filter log streams

* fix logging

* PEP fixes

* PEP fixes

* fix reset

* fix reset

* add new endpoint

* fix region name

* add docker

* try to fix tests

* try to fix travis issue with boto

* fix escaping in urls

* fix environment variables

* fix PEP

* more pep

* switch back to precise

* another fix attempt

* fix typo

* fix lambda invoke

* fix more unittests

* work on getting this to work in new scheme

* fix py2

* fix error

* fix tests when running in server mode

* more lambda fixes

* try running with latest docker

adapted from aiodocker

* switch to docker python client

* pep fixes

* switch to docker volume

* fix unittest

* fix invoke from sns

* fix zip2tar

* add hack impl for get_function with zip

* try fix

* fix for py < 3.6

* add volume refcount

* try to fix travis

* docker test

* fix yaml

* try fix

* update endpoints

* fix

* another attempt

* try again

* fix recursive import

* refactor fix

* revert changes with better fix

* more reverts

* wait for service to come up

* add back detached mode

* sleep and add another exception type

* put this back for logging

* put back with note

* whoops :)

* docker in docker!

* fix invalid url

* hopefully last fix!

* fix lambda regions

* fix protocol

* travis!!!!

* just run lambda test for now

* use one print

* fix escaping

* another attempt

* yet another

* re-enable all tests

* fixes

* fix for py2

* revert change

* fix for py2.7

* fix output ordering

* remove this given there's a new unittest that covers it

* changes based on review

- add skeleton logs test file
- switch to docker image that matches test env
- fix mock_logs import

* add readme entry
2017-09-27 16:04:58 -07:00
Chris Keogh
101dfaa412 fix tests for python 3.x 2017-09-15 15:41:48 +12:00
Chris Keogh
2c8326e9b9 allow get_function for lambda created with zipfile 2017-09-15 14:49:32 +12:00
Chris Keogh
c20d365021 fix merge conflicts 2017-09-14 14:30:55 +12:00
Chris Keogh
a379d76cfc add aws_lamba.invoke_async method 2017-09-14 13:59:35 +12:00
aohara-admin
98f95dd4a7 add Lambda tag_resource, untag_resource, and list_tags methods 2017-09-13 15:41:49 -04:00
Waldemar Hummer
da7106cfd6 extended CloudFormation models for Lambda and DynamoDB 2017-06-01 22:43:23 +02:00
Hugo Lopes Tavares
bfa8b4552c Fix CloudFormation Lambda ZipFile implementation to be plain text
The AWS CloudFormation documentation[1] states the following about the ZipFile property:

> For nodejs4.3, nodejs6.10, python2.7, and python3.6 runtime environments, the source code of your Lambda function.
> You can't use this property with other runtime environments.

[1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile
2017-05-17 18:48:54 -04:00
Steve Pulec
e7a3f3408e Add Lambda header for invoking error. Closes #770. 2017-03-16 22:00:57 -04:00
Steve Pulec
6d422d1f37 Add BaseModel to all models. 2017-03-11 23:41:12 -05:00
Steve Pulec
3b4ef2cf15 Merge in master. 2017-03-05 09:58:39 -05:00
Andrew Garrett
e7ea6b350c Fix lambda stdout/stderr mocking (#851)
Originally, the code was setting sys.stdout and sys.stderr back to the
original, official forms, but this breaks idioms like mocking stdout to
capture printing output for tests. So instead, we will reset sys.stdout
and sys.stderr to what they were before running the lambda function, so
that in case someone is mocking stdout or stderr, their tests won't
break.
2017-03-04 23:01:50 -05:00
Steve Pulec
3c0c4c2996 Fix tests for py3. 2017-02-23 22:28:09 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
81836b6981 Get standalone server mode working for all tests. 2017-02-23 19:43:48 -05:00
Steve Pulec
cad185c74d Cleanup headers and encoding. 2017-02-16 22:51:04 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Steve Pulec
d3df810065 Generalize decorator code. 2017-02-12 00:22:29 -05:00
Rob Walker
ed0e81fc61 Fixup lambda for ResponseRequest (#781)
* Fixup lambda for ResponseRequest

* one day will get this right
2016-12-03 18:17:15 -05:00
rocky4570fft
c4ea3cf751 correct expletive and remove debug line 2016-10-10 01:22:16 +10:00
rocky4570fft
dc98cf6f64 argh 2 days trying to work python3 into working python2 :( 2016-10-10 01:13:52 +10:00
rocky4570fft
95c90ae15f attmpt 6 is it the print statements or unicode? 2016-10-07 00:50:33 +10:00
rocky4570fft
de9d31bc0d attmpt 5 2016-10-07 00:41:31 +10:00
rocky4570fft
76266b6163 attmpt 4 thought i got rid of import StringIO - rockstar status not looking so good now 2016-10-07 00:26:00 +10:00
rocky4570fft
5500cc3e6f attmpt 3 not liking Python 3 very much at the moment 2016-10-07 00:18:39 +10:00
rocky4570fft
7c3005e582 attmpt 2 to resolve StringIO not being within Python 3 anymore 2016-10-07 00:14:47 +10:00
rocky4570fft
6c577091da lambderize the moto lambda 2016-10-06 19:52:23 +10:00
Mike Grima
bfa079ec4e Added Lambda invoke capability. 2016-06-22 12:24:46 -07:00
beeva-antonioirizar
143a8f85ee remove NextMarker in response list_functions 2016-02-23 17:34:49 +01:00
Hugo Lopes Tavares
8f586d8637 [lambda] Use S3Key to figure out code size and SHA256 2016-02-17 16:24:17 -05:00
Hugo Lopes Tavares
39a57195a2 [lambda] Make JSON load python 3-compatible 2016-02-17 16:13:58 -05:00
Hugo Lopes Tavares
2d744c6626 [lambda] Do not duplicate defaults for LambdaFunction objects.
The duplication caused a bug before and this commit is a bugfix and will prevent similar bugs in the future.
2016-02-17 16:13:58 -05:00