instance_definition = self.stack.t['Resources'][conf_name].copy()
instance_definition['Type'] = 'AWS::EC2::Instance'
instance_definition['Properties']['Tags'] = self._tags()
+ # resolve references within the context of this stack.
+ static_parsed = self.stack.resolve_static_data(instance_definition)
+ fully_parsed = self.stack.resolve_runtime_data(static_parsed)
+
resources = {}
for i in range(num_instances):
- resources["%s-%d" % (self.name, i)] = instance_definition
+ resources["%s-%d" % (self.name, i)] = fully_parsed
return {"Resources": resources}
def resize(self, new_capacity):
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AutoScaling Test",
"Parameters" : {
- "KeyName": {
- "Type": "String"
- }
+ "ImageId": {"Type": "String"},
+ "KeyName": {"Type": "String"}
},
"Resources" : {
"WebServerGroup" : {
"LaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
- "ImageId" : "foo",
+ "ImageId" : {"Ref": "ImageId"},
"InstanceType" : "bar",
}
}
class AutoScalingTest(HeatTestCase):
dummy_instance_id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
- params = {'KeyName': 'test'}
+ params = {'KeyName': 'test', 'ImageId': 'foo'}
def setUp(self):
super(AutoScalingTest, self).setUp()