Improve ec2:DescribeSubnets filtering (#3457)
* Add response/model/test coverage for filtering by `state` * Add explicit test case for filtering by `vpc-id` Closes #801
This commit is contained in:
parent
7749c1f757
commit
93453eba05
3 changed files with 60 additions and 1 deletions
|
|
@ -3307,6 +3307,7 @@ class Subnet(TaggedEC2Resource, CloudFormationModel):
|
|||
] # Reserved by AWS
|
||||
self._unused_ips = set() # if instance is destroyed hold IP here for reuse
|
||||
self._subnet_ips = {} # has IP: instance
|
||||
self.state = "available"
|
||||
|
||||
@staticmethod
|
||||
def cloudformation_name_type():
|
||||
|
|
@ -3387,6 +3388,8 @@ class Subnet(TaggedEC2Resource, CloudFormationModel):
|
|||
return self.availability_zone
|
||||
elif filter_name in ("defaultForAz", "default-for-az"):
|
||||
return self.default_for_az
|
||||
elif filter_name == "state":
|
||||
return self.state
|
||||
else:
|
||||
return super(Subnet, self).get_filter_value(filter_name, "DescribeSubnets")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue