Add filter "availabilityZone" to DescribeSubnets and add availability zone support too
This commit is contained in:
parent
82214d2bc2
commit
56cb06041c
3 changed files with 47 additions and 11 deletions
|
|
@ -7,7 +7,15 @@ class Subnets(BaseResponse):
|
|||
def create_subnet(self):
|
||||
vpc_id = self.querystring.get('VpcId')[0]
|
||||
cidr_block = self.querystring.get('CidrBlock')[0]
|
||||
subnet = self.ec2_backend.create_subnet(vpc_id, cidr_block)
|
||||
if 'AvailabilityZone' in self.querystring:
|
||||
availability_zone = self.querystring['AvailabilityZone'][0]
|
||||
else:
|
||||
availability_zone = None
|
||||
subnet = self.ec2_backend.create_subnet(
|
||||
vpc_id,
|
||||
cidr_block,
|
||||
availability_zone,
|
||||
)
|
||||
template = self.response_template(CREATE_SUBNET_RESPONSE)
|
||||
return template.render(subnet=subnet)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue