diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py index 8689aa3a8..fdc2432c6 100644 --- a/moto/ec2/responses/instances.py +++ b/moto/ec2/responses/instances.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals +from boto.ec2.instancetype import InstanceType from moto.core.responses import BaseResponse from moto.core.utils import camelcase_to_underscores from moto.ec2.utils import instance_ids_from_querystring, filters_from_querystring, \ @@ -78,6 +79,11 @@ class InstanceResponse(BaseResponse): template = self.response_template(EC2_INSTANCE_STATUS) return template.render(instances=instances) + def describe_instance_types(self): + instance_types = [InstanceType(name='t1.micro', cores=1, memory=644874240, disk=0)] + template = self.response_template(EC2_DESCRIBE_INSTANCE_TYPES) + return template.render(instance_types=instance_types) + def describe_instance_attribute(self): # TODO this and modify below should raise IncorrectInstanceState if # instance not in stopped state @@ -586,3 +592,21 @@ EC2_INSTANCE_STATUS = """ {% endfor %} """ + +EC2_DESCRIBE_INSTANCE_TYPES = """ + + f8b86168-d034-4e65-b48d-3b84c78e64af + + {% for instance_type in instance_types %} + + {{ instance_type.name }} + {{ instance_type.cores }} + {{ instance_type.memory }} + {{ instance_type.disk }} + {{ instance_type.storageCount }} + {{ instance_type.maxIpAddresses }} + {{ instance_type.ebsOptimizedAvailable }} + + {% endfor %} + +"""