diff --git a/moto/ec2/responses/nat_gateways.py b/moto/ec2/responses/nat_gateways.py index e960b990..98d383d4 100644 --- a/moto/ec2/responses/nat_gateways.py +++ b/moto/ec2/responses/nat_gateways.py @@ -6,14 +6,14 @@ from moto.ec2.utils import filters_from_querystring class NatGateways(BaseResponse): def create_nat_gateway(self): - subnet_id = self.querystring.get('SubnetId')[0] - allocation_id = self.querystring.get('AllocationId')[0] + subnet_id = self._get_param('SubnetId') + allocation_id = self._get_param('AllocationId') nat_gateway = self.ec2_backend.create_nat_gateway(subnet_id=subnet_id, allocation_id=allocation_id) template = self.response_template(CREATE_NAT_GATEWAY) return template.render(nat_gateway=nat_gateway) def delete_nat_gateway(self): - nat_gateway_id = self.querystring.get('NatGatewayId')[0] + nat_gateway_id = self._get_param('NatGatewayId') nat_gateway = self.ec2_backend.delete_nat_gateway(nat_gateway_id) template = self.response_template(DELETE_NAT_GATEWAY_RESPONSE) return template.render(nat_gateway=nat_gateway)