Commit Graph

117 Commits

Author SHA1 Message Date
Bert Blommers
8cc439444f
#3991 - AWSLambda - set content-type to app/json (#4046) 2021-06-30 11:02:38 +01:00
Bert Blommers
4af57c18bd
AWSLambda - Verify we can add multiple files to a Function (#3771) 2021-06-24 06:24:32 +01:00
Laurie O
ddd3c0edc4
Assume synchronous Lambda invocation by default (#3615)
* Assume synchronous Lambda invocation by default

* Support Python 2 with dict-unpacking
2021-01-26 13:28:01 +00:00
Erez Freiberger
9784e1b487
adding layers support for lambda backend (#3563)
* adding layers support for lambda backend

* improving lambda layer tests

* adding lambda list_layers and fixing tests

* make format
2021-01-17 15:28:49 +00:00
Brian Pandola
7ff60683e0
Expose contextual data when Lambda test fails (#3590)
This test is flaky, but when it fails we don't get any indication as to why.
This commit ensures that the reason for failure will be part of the assertion
message.

Once we have information about why this test fails, we can troubleshoot further
and hopefully come up with a permanent fix.
2021-01-15 14:42:35 +00:00
Erez Freiberger
f749f583ee
Add get_function_configuration support for Lambda (#3562)
* Add get_function_configuration support for Lambda

* remove unnesecary code from test and use _lambda_region when asserting

* rename function and skip coping configuration

* run black formatting
2021-01-10 15:24:04 +00:00
Brian Pandola
d712a98ce1
Enable AWSLambda and STS mocking for AWS China regions/endpoints (#3574)
Fixes #3570
2021-01-08 14:22:12 +00:00
Oide Brett
83507fbc37
fixed issue in update_configuration for lambda when setting VPC config property (#3479) 2020-11-18 08:45:31 +00:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Matěj Cepl
2705698d83 Mark functions as requiring network 2020-11-10 14:12:38 +01:00
Matěj Cepl
5697ff87a8 Back to Black 2020-11-10 14:12:38 +01:00
Matěj Cepl
ea489bce6c Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01:00
Bert Blommers
0ab21f62a8 Linting 2020-09-13 19:42:38 +01:00
Bert Blommers
db1d7123f6 List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
Karthikeyan Singaravelan
7054143701
Fix deprecation warnings due to invalid escape sequences. (#3273)
* Fix deprecation warnings due to invalid escape sequences.

* Fix linter error.
2020-09-10 09:20:26 +01:00
Guilherme Martins Crocetti
f744356da7
Lambda reserved concurrency (#3215)
* lambda-responses: add method to dispatch concurrency calls

* lambda-resources: add route to handle concurrency requests

* lambda-model: implement put_function_concurrency and concurrency attribute

* put-concurrency-tests: add one simple test

* get_function: add concurrency entry - with test

* lambda-reserved-concurrency: cloudformation support

* lambda-concurrency: implement delete_reserved with tests

* lambda-concurrency: implement get_reserved with tests

* lint

* implementation-cov: mark delete_function_concurrency, put_function_concurrency and get_function_concurrency

* botocore doesn't display concurrency entry for lambdas without it

* lambda(refactor): improvements on response's handler
2020-08-26 11:06:53 +01:00
Guilherme Martins Crocetti
0dd41d4c32
Cloudformation support for EventSourceMapping (#3045)
* change line position for uuid and last_modified because they're not input parameters

* add event_source_arn validator and setter

* refactor batch_size as setter

* add helper function to parse arn and return source service

* fix for EventSource's create_from_cfn, there was no reference in the lambda object for the esm if created by cfn

* add esm deletion by cloudformation

* remove unused variable in test

* add cfn's update

* add complete implementation of delete_from_cfn

* blacked changed files

* fix test with invalid batchsize for sqs

* Dynamodb2 Table - Bugfix for localindex and implemented get_cfn_attributes

* Dynamodb2 eventsource - fix test to use StreamArn attribute

* Lambda Test - fix test_update_event_source_mapping
2020-06-14 16:03:00 +01:00
Bert Blommers
0718525a2a Linting 2020-05-07 12:29:18 +01:00
Bert Blommers
f82e834225 Lambda - Only return Logs if LogType=Tail 2020-05-07 10:55:15 +01:00
Bert Blommers
be5b1c592f Lambda - Add actual logs to LogResult, instead of replicating the response 2020-05-07 10:40:24 +01:00
Bert Blommers
9ab02e17d5 #883 - Lambda - Add test to verify remove_permission functinonality 2020-04-03 10:30:05 +01:00
Bert Blommers
038ff620b2 DDB Streams - Bugfix where processed items are resend every time 2020-02-24 09:28:52 +00:00
Bert Blommers
736f8b5a8f Refactor - reuse logic that expects CW log message 2020-02-24 08:24:14 +00:00
Steve Pulec
d297fc08f2
Merge pull request #2755 from bblommers/dynamodbstreams_update_item
DynamoDB - Send item to DDB Stream on update, not just on create
2020-02-18 18:15:25 -06:00
Bert Blommers
5863d9fab9 Linting 2020-02-18 12:34:24 +00:00
Bert Blommers
9971bcdfcd DynamoDB - Send item to DDB Stream on update, not just on create 2020-02-18 11:49:55 +00:00
Steve Pulec
aeb194fc57 Update new lambda test to work with updated status codes. CC #2642. 2020-02-17 17:29:00 -06:00
Steve Pulec
039656f84d
Merge pull request #2704 from bblommers/bugfix/2642
Fix AWS Lambda status code on invoke
2020-02-15 10:46:01 -06:00
Steve Pulec
e40d75359a
Merge pull request #2717 from bblommers/feature/s3_illegallocationconstraint
S3 Feature: Add IllegalLocationConstraintException
2020-02-15 10:41:00 -06:00
Terry Griffin
f70cd0182e Fixed test_lambda_can_be_deleted_by_cloudformation for new (correct) error code. 2020-02-10 09:18:25 -08:00
Terry Griffin
b4c9b76ca9 Added 'x-amzn-ErrorType' in return header from lambda:get_function for missing function 2020-02-06 15:26:20 -08:00
Mike Grima
bb64258a8f Fixed issue with Lambda invoke via ARN
- Fixed an issue where Lambda invokes via an ARN was hitting real AWS.
2020-02-04 22:12:11 -08:00
Bert Blommers
e21ddb7abc
Use var instead of hardcoded string for region 2020-02-02 14:25:44 +00:00
Bert Blommers
a86cba79de Add S3 LocationConstraint to Lambda tests 2020-02-02 11:48:32 +00:00
Bert Blommers
da40c7125a
Merge pull request #2703 from brady-gsa/fix_lambda_config
Fixes awslambda policy management
2020-01-29 15:30:25 +00:00
Brady
dd243d72c2 switch to using sure for assertions 2020-01-29 09:46:09 -05:00
Brady
cb07d17e13 don't use table of test cases and reduce duplication in get_policy method 2020-01-27 10:35:46 -05:00
Brady
2a2ff32dec improves support for AWS lambda policy management 2020-01-24 14:53:16 -05:00
Andrey Kislyuk
324ef5af36 Fix test 2020-01-24 16:11:44 +00:00
Bert Blommers
ccd0257acc Fix Lambda tests for DryRuns 2020-01-24 10:09:56 +00:00
Bert Blommers
ee8231202a Fix linting 2020-01-24 09:08:48 +00:00
Roque Pinel
2ae09c5335 Fix the StatusCode returned by lambda invoke
According to the AWS documentation:
```
The HTTP status code will be in the 200 range for successful request.
For the RequestResponse invocation type this status code will be 200.
For the Event invocation type this status code will be 202.
For the DryRun invocation type the status code will be 204.
```
2020-01-24 09:07:49 +00:00
Bert Blommers
5884483019 Compare map, instead of string repr 2020-01-09 10:08:35 +00:00
Bert Blommers
cba3cfc384 Escape curly braces in formatting string 2020-01-09 09:10:16 +00:00
Bert Blommers
eab9e15bf0 #2623 - Fix and simplify test in ServerMode 2020-01-05 15:01:31 +00:00
Fabio Dias
743dd46399 black linting 2019-12-16 21:25:20 -05:00
Fabio Dias
b83a750630 Added references to moto.iam.models.ACCOUNT_ID instead of hardcoded id 2019-12-16 19:56:11 -05:00
Mike Grima
76aaa2df0f
Merge pull request #2595 from bblommers/feature/2317
Add CF update/delete methods for Lambda
2019-12-09 14:04:49 -08:00
Bert Blommers
9c247f4b70
Specify region name for IAM 2019-11-24 15:33:51 +00:00