Commit Graph

278 Commits

Author SHA1 Message Date
Bert Blommers
07913cfef0
Deprecate mock_dynamodb2 (#4919) 2022-03-09 16:57:25 -01:00
Brian Pandola
181031db5f Fix: Calling dynamodb:UpdateItem with non-existent table name should raise ResourceNotFoundException 2022-02-23 23:28:15 -08:00
Bert Blommers
e5c8cf058c
DynamoDB improvements (#4849) 2022-02-10 19:09:45 -01:00
Dave Pretty
8b39233426
dynamodb: filter expression should applied after query/scan. fixes spulec/moto#3909 (#4805) 2022-01-29 10:08:18 -01:00
Guriido
44e01a298e
DynamoDb2 transact_write_items: Check multiple transacts on same item (#4787) 2022-01-25 09:26:39 -01:00
Guriido
6d160303a4
Enhancement: Add check for reserved keywords in condition expression attributes [dynamodb2] (#4778) 2022-01-25 09:26:11 -01:00
Bert Blommers
aa70ee254d
Remove deprecated decorators + boto dependency (#4378) 2022-01-18 14:18:57 -01:00
Bert Blommers
4e8e91d11a
DynamoDB - Error when providing table with 0 indexes (#4661) 2021-12-05 22:05:30 -01:00
Bert Blommers
c6815c1a4b
Pylint - run on source directories (abc only for now) (#4647) 2021-12-01 22:06:58 -01:00
Josh Feierman
7d44df5266
Added restore table to point in time DynamoDB method (#4627) 2021-11-24 20:26:21 -01:00
Bert Blommers
a02bdd91ff
DynamoDB - also look at Global indexes to see if the value of a sort key is too big (#4632) 2021-11-24 12:22:35 -01:00
Bert Blommers
4920793498
DynamoDB Query - fix bug in invalid operator detection (#4625) 2021-11-23 18:49:59 -01:00
Bert Blommers
3898124112
DynamoDB - fix bugfix between 0 and x (#4567) 2021-11-12 20:09:03 -01:00
Bert Blommers
d324532e1a
DynamoDB - error when persisting item with wrong type (#4557) 2021-11-10 20:42:33 -01:00
Vincent Barbaresi
6f5cae98ad
fix incomplete LastEvaluatedKey when using Global Secondary Index (#4488) 2021-10-28 10:10:11 +00:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
Maksymilian Babarowski
9d552c39ea
DynamoDB - Exceptions for incorrect AttributeDefinitions in create_table (#4409) (#4428) 2021-10-18 09:11:04 +00:00
Maksymilian Babarowski
e8cd02617d
Fixed a bug where calling batch_get_item with non-existing tables names would not raise ResourceNotFoundException (#4344) (#4403) 2021-10-13 10:36:16 +00:00
Maksymilian Babarowski
5cf6f9b2b4
Fixed a bug where calling batch_write_item with non-existing tables names would not raise ResourceNotFoundException (#4402) 2021-10-13 09:52:29 +00:00
Bert Blommers
58df83f39f
DynamoDB - Validate the nr of Add-clauses on update (#4398) 2021-10-12 19:32:10 +00:00
Bert Blommers
476fd895b0
DynamoDB - Validate empty ExpressionAttributeNames on get_item() (#4393) 2021-10-11 22:16:46 +00:00
Bert Blommers
7f912b7a5b
DynamoDB - Throw exception when updating key using SET operation (#4245) 2021-10-09 21:02:53 +00:00
Bert Blommers
df05b608b0
DynamoDB - Support dots in ConditionExpressions (#4383) 2021-10-09 13:09:12 +00:00
Bert Blommers
6ff03f3974
DynamoDB - Raise exceptions when query is missing GSI keys (#4379) 2021-10-08 10:06:55 +00:00
Maksymilian Babarowski
6fdb62a0a5
dynamodb2 - updated error message when UpdateItem with ConditionalExpression fails (#4375) 2021-10-08 07:45:10 +00:00
Bert Blommers
e9a4100324
Rewrite deprecated CloudFormation tests (#3842) 2021-10-04 13:47:40 +00:00
Bert Blommers
9d1dd79813
Rewrite deprecated DynamoDB2 tests (#3904) 2021-09-22 18:13:28 +00:00
Bert Blommers
cc568c1656
DynamoDB - Improve handling of ReturnConsumedCapacity-param (#4241) 2021-08-29 19:04:42 +01:00
Bert Blommers
4653c34fd5
Validate AST before creating new item (#3754) 2021-08-28 09:38:12 +01:00
Bert Blommers
6a6a71ebff
DynamoDB - raise exception for invalid parameter combination (#3755) 2021-08-28 07:41:04 +01:00
Bert Blommers
a6606cbf42
DynamoDB - Describe Endpoints (#3716) 2021-08-28 07:25:06 +01:00
Bert Blommers
7acdfe4feb
Introduce Pylint to check for duplicate test method names (#3684) 2021-08-21 16:33:15 +01:00
Waldemar Hummer
f4f8527955
Merge LocalStack changes into upstream moto (#4082)
* fix OPTIONS requests on non-existing API GW integrations

* add cloudformation models for API Gateway deployments

* bump version

* add backdoor to return CloudWatch metrics

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* bump version

* minor fixes

* fix Number data_type for SQS message attribute

* fix handling of encoding errors

* bump version

* make CF stack queryable before starting to initialize its resources

* bump version

* fix integration_method for API GW method integrations

* fix undefined status in CF FakeStack

* Fix apigateway issues with terraform v0.12.21
* resource_methods -> add handle for "DELETE" method
* integrations -> fix issue that "httpMethod" wasn't included in body request (this value was set as the value from refer method resource)

* bump version

* Fix setting http method for API gateway integrations (#6)

* bump version

* remove duplicate methods

* add storage class to S3 Key when completing multipart upload (#7)

* fix SQS performance issues; bump version

* add pagination to SecretsManager list-secrets (#9)

* fix default parameter groups in RDS

* fix adding S3 metadata headers with names containing dots (#13)

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* make CF stack queryable before starting to initialize its resources

* bump version

* remove duplicate methods

* fix adding S3 metadata headers with names containing dots (#13)

* Update amis.json to support EKS AMI mocks (#15)

* fix PascalCase for boolean value in ListMultipartUploads response (#17); fix _get_multi_param to parse nested list/dict query params

* determine non-zero container exit code in Batch API

* support filtering by dimensions in CW get_metric_statistics

* fix storing attributes for ELBv2 Route entities; API GW refactorings for TF tests

* add missing fields for API GW resources

* fix error messages for Route53 (TF-compat)

* various fixes for IAM resources (tf-compat)

* minor fixes for API GW models (tf-compat)

* minor fixes for API GW responses (tf-compat)

* add s3 exception for bucket notification filter rule validation

* change the way RESTErrors generate the response body and content-type header

* fix lint errors and disable "black" syntax enforcement

* remove return type hint in RESTError.get_body

* add RESTError XML template for IAM exceptions

* add support for API GW minimumCompressionSize

* fix casing getting PrivateDnsEnabled API GW attribute

* minor fixes for error responses

* fix escaping special chars for IAM role descriptions (tf-compat)

* minor fixes and tagging support for API GW and ELB v2 (tf-compat)

* Merge branch 'master' into localstack

* add "AlarmRule" attribute to enable support for composite CloudWatch metrics

* fix recursive parsing of complex/nested query params

* bump version

* add API to delete S3 website configurations (#18)

* use dict copy to allow parallelism and avoid concurrent modification exceptions in S3

* fix precondition check for etags in S3 (#19)

* minor fix for user filtering in Cognito

* fix API Gateway error response; avoid returning empty response templates (tf-compat)

* support tags and tracingEnabled attribute for API GW stages

* fix boolean value in S3 encryption response (#20)

* fix connection arn structure

* fix api destination arn structure

* black format

* release 2.0.3.37

* fix s3 exception tests

see botocore/parsers.py:1002 where RequestId is removed from parsed

* remove python 2 from build action

* add test failure annotations in build action

* fix events test arn comparisons

* fix s3 encryption response test

* return default value "0" if EC2 availableIpAddressCount is empty

* fix extracting SecurityGroupIds for EC2 VPC endpoints

* support deleting/updating API Gateway DomainNames

* fix(events): Return empty string instead of null when no pattern is specified in EventPattern (tf-compat) (#22)

* fix logic and revert CF changes to get tests running again (#21)

* add support for EC2 customer gateway API (#25)

* add support for EC2 Transit Gateway APIs (#24)

* feat(logs): add `kmsKeyId` into `LogGroup` entity (#23)

* minor change in ELBv2 logic to fix tests

* feat(events): add APIs to describe and delete CloudWatch Events connections (#26)

* add support for EC2 transit gateway route tables (#27)

* pass transit gateway route table ID in Describe API, minor refactoring (#29)

* add support for EC2 Transit Gateway Routes (#28)

* fix region on ACM certificate import (#31)

* add support for EC2 transit gateway attachments (#30)

* add support for EC2 Transit Gateway VPN attachments (#32)

* fix account ID for logs API

* add support for DeleteOrganization API

* feat(events): store raw filter representation for CloudWatch events patterns (tf-compat) (#36)

* feat(events): add support to describe/update/delete CloudWatch API destinations (#35)

* add Cognito UpdateIdentityPool, CW Logs PutResourcePolicy

* feat(events): add support for tags in EventBus API (#38)

* fix parameter validation for Batch compute environments (tf-compat)

* revert merge conflicts in IMPLEMENTATION_COVERAGE.md

* format code using black

* restore original README; re-enable and fix CloudFormation tests

* restore tests and old logic for CF stack parameters from SSM

* parameterize RequestId/RequestID in response messages and revert related test changes

* undo LocalStack-specific adaptations

* minor fix

* Update CodeCov config to reflect removal of Py2

* undo change related to CW metric filtering; add additional test for CW metric statistics with dimensions

* Terraform - Extend whitelist of running tests

Co-authored-by: acsbendi <acsbendi28@gmail.com>
Co-authored-by: Phan Duong <duongpv@outlook.com>
Co-authored-by: Thomas Rausch <thomas@thrau.at>
Co-authored-by: Macwan Nevil <macnev2013@gmail.com>
Co-authored-by: Dominik Schubert <dominik.schubert91@gmail.com>
Co-authored-by: Gonzalo Saad <saad.gonzalo.ale@gmail.com>
Co-authored-by: Mohit Alonja <monty16597@users.noreply.github.com>
Co-authored-by: Miguel Gagliardo <migag9@gmail.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-07-26 15:21:17 +01:00
Bert Blommers
6084d6cfe8
DynamoDB - Support AttributeUpdate::DELETE action (#3798) 2021-06-23 17:41:47 +01:00
Bert Blommers
2f23807a35
#3760 - DynamoDB - only raise exception when GSI key is actually empty (#3763) 2021-06-17 14:07:24 +01:00
Thomas Ross
67ae84e2c4
Only raise EmptyKeyAttributeException when the value node is empty (#4014)
This fixes a bug where all updates to keys (including GSIs) would raise
EmptyKeyAttributeException, even when the new value was not an empty string.
2021-06-17 12:19:47 +01:00
Brian Pandola
c1b38be02d
Add support for DynamoDB Backup/Restore (#3995)
* Add support for DynamoDB Backup/Restore

Basic support for the following endpoints has been implemented with full test coverage:
- create_backup
- delete_backup
- describe_backup
- list_backups
- restore_table_from_backup

Behavior and error messages verified against a real AWS backend.

* Refactor test based on PR feedback
2021-06-10 07:05:07 +01:00
Matthew Davis
d6384fcb35
Enforce dynamodb key size limit [solves #3866] (#3888)
* add tests for dynamodb max key size

correct too-large error for ddb key

* remove unnecessary requires_boto_gte decorator from ddb tests

* remove literal emoji from ddb test

* implement dynamodb key limits, WIP

* correct direction of dynamodb range key length check

* fix tests for dynamodb max key size check

* catch ddb validation errors and rethrow properly

* finish ddb key size limit fixes

* fix linting

* handle unicode in v2.7 tests

* fix encoding issue in py2.7 for ddb

* linting

* Python2/3 compatability

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-04-30 13:47:47 +01:00
David Pedrosa
ba0f0bd513
Improve dynamodb query case sensitivity (#3799) (#3800)
* between clause is not case-sensitive anymore

* begins_with will raise an exception unless lower-case is used

Co-authored-by: David Pedrosa <d.pedrosa@indizen.com>
2021-03-25 20:22:36 +00:00
Ilya Konstantinov
0912abe5f6
dynamodb: fix deleting last set element (w/attr name) (#3708)
* dynamodb: deleting last set element

* add user-facing test
2021-02-19 07:47:51 +00:00
Brian Pandola
613b1395b8
Fix: DynamoDB:GetItem throws wrong error when table doesn't exist (#3700)
* Fix: DynamoDB:GetItem throws wrong error when table doesn't exist

* Use unique exception for table not found, per PR feedback

* Just fix the reported issue, without touching anything else...
2021-02-17 11:22:00 +00:00
Jonathan Bergknoff
676d61bf5b
Add CRC32 to DynamoDB responses (#3677)
* Add CRC32 to DynamoDB responses

* Change test assertion

* CRC32 - Align Py2/Py3 behaviour

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-02-12 14:26:06 +00:00
Brian Pandola
cd044ef00b
Remove redundant test code (#3640)
These tests, when run, do not execute any `moto` code. They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request.  These tests do not cover or verify
any `moto` behavior and have been removed.
2021-01-31 12:21:24 +00:00
Brian Pandola
640df04840
Implement Add to List for dynamodb:UpdateItem (#3585)
This handles the add-to-list case using the legacy `AttributeUpdates` parameter.

* Added test coverage.
* Verified against real AWS backend.

Closes #3561
2021-01-10 14:20:41 +00:00
Bert Blommers
e1fc3a9596
#3506 - DynamoDB - Allow StringSets to be passed to update_item() (#3519) 2020-12-07 09:31:53 +00:00
Garrett
9e3b23758a
[dynamodb2] Support include projection on indexes (#3498)
* [dynamodb2] Support include projection on indexes

* linter
2020-11-25 20:28:05 +00:00
Rich Unger
f045af7e0a
Add support for empty strings in non-key dynamo attributes (#3467)
* Add support for empty strings in non-key attributes

https://github.com/spulec/moto/issues/3339

* Nose, not pytest

* Revert "Nose, not pytest"

This reverts commit 5a3cf6c887dd9fafa49096c82cfa3a3b7f91d224.

* PUT is default action
2020-11-17 09:12:39 +00:00
Oide Brett
62d382ff70
Fixed issue 3448 for DynamoDB update_item (#3463)
* Fixed issue 3448 for DynamoDB update_item

* Tidied up fix for issue 3448 for DynamoDB update_item

* Reformatted fix for issue 3448 for DynamoDB update_item

* removed use of f-strings in test case as it fails in Travis CI build due to Python 2.7 support of f strings
2020-11-17 07:41:54 +00:00
gsamaras
d068653dea
dynamodb2 support for default Action ('Put') in update_item (#3454)
Co-authored-by: Georgios Samaras <gsamaras@amazon.com>
2020-11-14 11:10:38 +00:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00