Lookup the class for an Instance in Autoscaling
Instead of hardcoding the class for handling instances in autoscaling, look up the class for the AWS::EC2::Instance resource type using the same mechanism used for creating resources normally. Change-Id: I37b9aff9a83b89cdc782467720970a04549d7b1e Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
4b6f1b8ad0
commit
b6711c12e3
|
@ -65,9 +65,10 @@ class AutoScalingGroup(resource.Resource):
|
||||||
return self.UPDATE_REPLACE
|
return self.UPDATE_REPLACE
|
||||||
|
|
||||||
def _make_instance(self, name):
|
def _make_instance(self, name):
|
||||||
|
Instance = resource.get_class('AWS::EC2::Instance')
|
||||||
conf = self.properties['LaunchConfigurationName']
|
conf = self.properties['LaunchConfigurationName']
|
||||||
instance_definition = self.stack.t['Resources'][conf]
|
instance_definition = self.stack.t['Resources'][conf]
|
||||||
return instance.Instance(name, instance_definition, self.stack)
|
return Instance(name, instance_definition, self.stack)
|
||||||
|
|
||||||
def handle_delete(self):
|
def handle_delete(self):
|
||||||
if self.resource_id is not None:
|
if self.resource_id is not None:
|
||||||
|
|
Loading…
Reference in New Issue