moto/moto/ec2
Brian Pandola 463472c2b2
Make security rules consistent between direct (backend) and indirect (api) boundaries (#3817)
* Make security rules consistent between direct (backend) and indirect (api) boundaries

Security rules added directly via the backend were unable to be revoked via the API
because the port values were being stored as strings but were always coerced back
to integers by the botocore model.  `"0" != 0`, so the rules would never match,
raising an `InvalidPermissionNotFoundError`.

This change ensures that the port values for a security group rule are always of type
`Union[int, None]`.

No tests needed to be modified as a result of this change.  A new test was added that
explicitly covers the behavior that had been failing.

* Skip test in server mode
2021-03-31 19:33:36 +01:00
..
resources Fix unknown instance type (#3710) 2021-02-22 10:21:59 +00:00
responses Make security rules consistent between direct (backend) and indirect (api) boundaries (#3817) 2021-03-31 19:33:36 +01:00
__init__.py Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
exceptions.py Add TagSpecification support to ec2:CreateImage (#3604) 2021-01-23 12:57:34 +00:00
models.py Make security rules consistent between direct (backend) and indirect (api) boundaries (#3817) 2021-03-31 19:33:36 +01:00
urls.py Fix deprecation warning. 2020-04-19 19:12:48 -07:00
utils.py Enhancement: implement EC2 instance filtering by subnet-id (#3694) 2021-02-15 16:38:40 +00:00