Commit Graph

5759 Commits

Author SHA1 Message Date
Bert Blommers
cb6606f3f3
Update build.yml 2021-02-16 10:44:48 +00:00
Bert Blommers
d075219637
Pin RSA dependency for Py2 (#3697) 2021-02-16 09:50:06 +00:00
Emilio López
5fd20626b3
events: fix archive event pattern match check (#3671)
* events: fix archive event pattern match check

There is a missing `return True` for the positive match case in
matches_pattern, causing all valid patterns to fail.

* events: add test for valid, non-empty pattern match
2021-02-16 08:54:28 +00:00
tony-dot-sh
9feabf5479
Enhancement: implement EC2 instance filtering by subnet-id (#3694)
Co-authored-by: Tony Greising-Murschel <tony@platform.sh>
2021-02-15 16:38:40 +00:00
chrisw-dev
def46b5130
adding list_create_account_status to organization #3691 (#3692)
* adding list_create_account_status to organization #3691

* removing todo comment

Co-authored-by: Chris Walters <chriskwalters@hotmail.com>
2021-02-15 11:39:23 +00:00
Bert Blommers
f64532ed40
Cloudformation - Create ApiGateway resources (#3659)
* Cloudformation - Create ApiGateway resources

* Cleanup

* Linting
2021-02-15 10:31:33 +00:00
Bert Blommers
2f50f9cb24
Add validation to API Key min length value (#3652)
* api gateway - add api key minimum length validation

* api gateway - support includeValue query parameter on api key apis

* [apigateway] code refactoring

* Cleanup - remove duplicate utility methods

* APIGateway - Dont send headers with error messsage

Co-authored-by: Jovan Zivanov <j.zivanov@levi9.com>
2021-02-15 09:39:35 +00:00
Bert Blommers
d7b8419791
Fix Mock 4.0.3 compatibility - Unpatch only once during teardown (#3541)
* #3535 - Unpatch only once during teardown

* EnvVar patching - Fix Python2 bug

* Allow latest version of mock-library
2021-02-15 08:42:16 +00:00
usmangani1
d8097b24dc
Fix:SQS-message retention period consideration (#3642)
* Fix:SQS-message retention period consideration

* Fix:SQS-message retention period consideration

* Fix:SQS-message retention period consideration

* Added comments &linting

* Fixed tests
2021-02-14 13:04:55 +00:00
Connor
4d0ee82f98
support - intial commit to kick off trusted advisor checks (#3685)
* support - intial commit to kick off trusted advisor checks

* edit - expanded testing to include checking for expected check ids and
check names.

Added server testing

added support resource json to manifest file and simplified
support response return from reviewed comments

* Streamline loading of resource files

* edit - ensured regions are assigned in models

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-02-14 12:22:16 +00:00
Brian Pandola
e8f1522d1a
Improve autoscaling:CreateLaunchConfiguration request validation (#3687)
AWS requires certain parameters to be mutually inclusive.

Moto wasn't doing anything with the InstanceId parameter, which is now made
clear with a TODO.
2021-02-14 11:38:03 +00:00
Brian Pandola
ae2865d559
Minor RDS Clean up (#3682)
* Fix `DBInstanceNotFound` error message

Changed from `Database` to `DBInstance`, which is actually what comes back from AWS.

* Remove duplicate test

The removed test actually fails if run in isolation because `rds2` is not a
valid boto3 client service.  The reason this test never caused CI to fail is
because it is redefined later in the test suite, effectively making it dead
code that will never run.

Duplicate test has been removed and the remaining test has been improved
with more explicit asserts.
2021-02-13 11:12:02 +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
redparham
b60de10c79
Fix heartbeatTimeout of NONE and polling responses when there are no tasks (#3680)
* fix heartbeatTimeout of NONE resulting in ValueError and polling returning empty string taskToken when it shouldn't be returned

* fix expected taskToken in impacted tests

Co-authored-by: Clint Parham <cparham@aligntech.com>
2021-02-12 13:01:42 +00:00
Bert Blommers
f246d4162f
Update build.yml 2021-02-12 12:59:45 +00:00
Cristopher Pinzón
c72670d536
Functionality added to SES service (#3670)
* correct exceptions when mising parameters

* test_render_template function

* update ses template function

* fix import

* except fixed

* tests and py2 fix
2021-02-11 18:31:17 +00:00
Brian Pandola
4a01360d88
Add ResourceGroupsTaggingAPI Support for RDS Resources (#3674)
- AWS::RDS::DBInstance
- AWS::RDS::DBSnapshot
2021-02-11 15:15:24 +00:00
Bert Blommers
3cd03efa3d
Update codecov.yml 2021-02-11 15:10:22 +00:00
Julien Roy
fd51da8cae
Fix response parsing error on Java SDK v2 for CW GetMetricData (#3645) (#3675)
Co-authored-by: Julien Roy <julien@bankin.com>
2021-02-11 15:04:59 +00:00
pwrmiller
3581e013e4
moved iteritems backwards compatibility to six (#3672)
Co-authored-by: Paul Miller <pwmiller@amazon.com>
2021-02-11 14:44:37 +00:00
Bert Blommers
9383dd5e93
Update codecov.yml 2021-02-10 09:45:03 +00:00
Bert Blommers
c642108732
CodeCov config - Only notify after all builds pass 2021-02-10 09:12:50 +00:00
Brian Pandola
8557fb8439
Add support for RDS resource filtering (#3669)
* Add support for RDS resource filtering

* Extensive testing was performed against real AWS endpoints in order to
  nail down the filter behavior under various scenarios, ensuring that
  `moto` returns the proper response or error.
* Full test coverage of all utility functions as well as several
  filter/parameter combinations.

* Split up filter tests, per PR feedback

* Remove unused import

* Fix pytest teardown failure on Python 2.7
2021-02-10 09:06:54 +00:00
wynnw
891118a7c7
#3667: Update the s3 post functionality to better support success_action_redirect (#3668)
* Update the s3 post functionality to better support success_action_redirect

- Add the bucket/key values to the redirect url like s3 does, which
supports code that relies on the key value being there on the
redirect.
- Add support for replacing ${filename} in the key value with the actual
filename from the form upload.

See Issue #3667

* Update s3 tests for changed success_action_redirect behavior

- Adds a new test called test_s3_server_post_to_bucket_redirect that
tests both the ${filename} replacement and the key/value addition to the
redirect query args
- Updated the test_creating_presigned_post checks to handle the
key/value additions to the redirect url.

* Fix test updates to work with python2.7

- remove f-string usage
- fix urllib.parse imports to use six

Co-authored-by: Wynn Wilkes <wynn@leading2lean.com>
2021-02-10 09:06:03 +00:00
Bert Blommers
46679b3b02
Update README.md 2021-02-09 13:48:48 +00:00
John Flores
791bc77f3a
Add KmsKeyId to Redshift Cluster (#3666)
* Add KmsKeyId to Redshift Cluster

Add the KmsKeyId property when creating a cluster so that it is also
returned when querying the describe_clusters endpoint.

* Run black on updated files

* Add unit test for Redshift KmsKeyId

* Re-run black with correct version
2021-02-08 18:52:47 +00:00
Bert Blommers
4ce936a284
CI - Run codecov on all tests, not just Py3.7 (#3654)
* CI - Run codecov on all tests, not just Py3.7

* Update build.yml

* Update build.yml
2021-02-02 18:01:00 +00:00
Bert Blommers
737636f9df
Tech debt (#3653) 2021-02-02 16:31:26 +00:00
Brandon Clodius
81859f9180
(fix) Fixes #3648 (#3649)
* (fix) Fixes #3648

* (fix) formatting

* (review) add assertion for exception thrown
2021-02-02 15:21:16 +00:00
Rahul Ranjan
7d066cea2f
Add versionid header in complete multipart if enabled (#3643)
* Add versionid header in complete multipart if enabled
- addresses https://github.com/localstack/localstack/issues/3514

* remove unnecessary code

* fix lint

* fix lint test

* add test case for boto3
2021-02-02 09:51:17 +00:00
Rahul Ranjan
78a5661093
Cloudwatch get metric data return by period (#3626)
* Cloudwatch get metric data return by period

- addresses https://github.com/localstack/localstack/issues/3493

* fix lint issues

* remove unused import

* added test cases for min max and average
2021-02-02 09:08:53 +00:00
aantillonl
d382731a14
Remove duplicate template of SNS error response (#3647)
In e9dc5edf7f a custom error template
was added to correct the response returned by get_endpoint_attributes
for a non-existent endpoint.

However, after some more inspection, it was found that a valid
template already existed in moto/sns/responses.py.

This commit removes the template introduced in e9dc5ed and takes
into use the existing template.

It is a marginal improvement, but helps keeping a cleaner code
base

Co-authored-by: Antillon, Alejandro <alejandro.antillon@f-secure.com>
2021-02-01 14:58:48 +00:00
Brian Pandola
c9dd9cc7f9
Fix: IoT does not work in server mode (#3644)
Closes #1631
2021-02-01 13:15:57 +00:00
Anton Grübel
0211e9d78d
Add failures output to ecs.describe_services (#3641)
* Add failures output to ecs.describe_services

* Fix autoscaling tests
2021-02-01 12:19:46 +00:00
Anton Grübel
fe9f1dfe14
Add tag & untag user (#3638)
* Add iam.tag_user

* Add iam.untag_user

* Fix Python2 error
2021-02-01 11:37:54 +00:00
Philipp A
f918635ab5
Link remaining badges in README (#3636)
- Adds a link to moto’s PyPI page
- Makes the “Python Versions” badge unclickable
- Adds a link to PyPIstats for download stats
2021-01-31 13:15:04 +00:00
aantillonl
e9dc5edf7f
Update SNS get_endpoint_attributes response for Not Found endpoints (#3637)
The response returned for sns.get_endpoint_attributes was not in
sync with the actual response from boto.

Co-authored-by: Antillon, Alejandro <alejandro.antillon@f-secure.com>
2021-01-31 12:29:10 +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
779d18e00c
Fix: Golang aws-sdk fails to parse elbv2:CreateLoadBalancer response (#3639)
The `botocore` response parsers are forgiving when it comes to timestamps,
but a real AWS backend does return time zone details for this attribute.

Verified failure/fix using the Go repo included in the issue report.

Fixes #3516
2021-01-31 11:39:11 +00:00
Brian Pandola
1037929bf8
Add arns to iot responses (#3634)
Closes #3623
Supersedes #2974
2021-01-31 11:02:08 +00:00
William Richard
5c4b68c5ea
Add support for the force argument for ecs.delete_service (#3631)
This argument allows you to delete a service even when its DesiredCount is non-zero.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.delete_service
2021-01-31 10:09:52 +00:00
Brian Pandola
f4b81e69b8
Address pytest warnings (#3629)
* Address `boto` deprecation warnings

This commit eliminates the following warning:

../boto/ec2/connection.py:582:
  PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.

`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.

* Remove `invoke_lambda` tracebacks from unit test logging

If an exception is encountered, the details are returned in the response payload.
Printing the traceback was just adding noise to the pytest output.

* Use known AMIs in unit tests

This commit eliminates the following warning in the pytest output:

`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`

Known, pre-loaded AMI image ids are used instead of random ids that don't actually
exist in the moto backend.  The integrity of the tests is unaffected by this change.

A test has been added to provide explicit coverage of the PendingDeprecationWarning
raised when an invalid AMI image id is passed to moto.
2021-01-29 11:31:56 +00:00
Brian Pandola
cd25ab7a16
Fix: broken build with release of botocore 1.19.62 (#3628)
The latest release of `botocore` (1.19.62) makes changes to the parameter
validation code, which for some reason was also covered by a couple of
`moto` tests.

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.

Ref: ff8ae76ecc

Closes #3627
2021-01-29 09:06:25 +00:00
Brian Pandola
ef1cb2e544
Enable GitHub Actions to run successfully on forks (#3622)
* Trigger workflow on any push or pull request.
* Conditionally run Codecov Upload and Deploy *only* on `spulec/moto` repository.

This allows contributors to get CI results on their forked repo before
submitting PRs to `moto`.  Previously, forked repos could run the actions
but would fail (rightfully) on the steps that should only be run on the
main repo (and require tokens/secrets).
2021-01-28 15:19:30 +00:00
Anders Kaseorg
e2e107e555
requirements-dev.txt: Remove requirements copied from setup.py (#3619)
Most of these were already pulled in via -r requirements.txt → -e
.[all]; add the remainder with -e .[all,server].

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-01-28 14:28:34 +00:00
Anders Kaseorg
6ecf050228
Use environment markers for Python 2 dependency pins (#3618)
PyPI does not run setup.py separately for each Python version to
resolve requirements, so these conditional requirements need to be
properly specified in the metadata, not in code.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-01-28 14:16:20 +00:00
Anton Grübel
199da2220b
Add EventBridge Archive CRUD endpoints (#3617)
* Add events.create_archive

* Add events.describe_archive

* Add events.list_archives

* Add events.update_archive

* Add events.delete_archive

* Add actual archive functionality

* Fix test

* Fix PR issues
2021-01-28 10:47:53 +00:00
Brian Pandola
9e1fcac9d4
Use known AMI in internal tests (#3620)
Moto's implementation of autoscaling:CreateLaunchConfiguration is a little too loose,
allowing the ImageId parameter to be omitted and defaulting it to None, which results
in dozens of deprecation warnings:

`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`

This commit refactors calls to CreateLaunchConfiguration to explicitly pass in a known
AMI ImageId in order to avoid these warnings.

The integrity of the tests is unaffected by this change.
2021-01-27 19:49:33 +00:00
Bert Blommers
b9b793f421
#3599 - Update Implementation Coverage script (#3621) 2021-01-27 18:54:21 +00:00
Bert Blommers
e40e74d6a2
Create codecov.yml 2021-01-27 17:04:09 +00:00