Class: Topo::Provision::AwsNodeGroupGenerator

Inherits:
ResourceGenerator show all
Defined in:
lib/topo/provision/aws/generators/node_group.rb

Instance Attribute Summary

Attributes inherited from ResourceGenerator

#name, #resource_attributes, #resource_type, #undeploy_action

Instance Method Summary collapse

Methods inherited from ResourceGenerator

#default_resource_template, #do_action, #template, #template_root_dir

Methods included from Topo::ParseGen

#convert_keys_to_sym, #convert_keys_to_sym_deep, #expand_ref, #lazy_attribute_to_s, #topo_refs, #value_from_path

Constructor Details

#initialize(data) ⇒ AwsNodeGroupGenerator

Returns a new instance of AwsNodeGroupGenerator.



29
30
31
32
33
34
35
36
# File 'lib/topo/provision/aws/generators/node_group.rb', line 29

def initialize(data)
  super
  @resources=[]
  launch_config = Topo::Provision::AwsLaunchConfigurationGenerator.from_node(data)
  @resources << Topo::Provision::AwsMachineImageGenerator.new(data) if launch_config.needs_image?
  @resources << launch_config
  @resources << Topo::Provision::AwsAutoScalingGroupGenerator.from_node(data)
end

Instance Method Details

#default_action(action) ⇒ Object



56
57
58
59
60
# File 'lib/topo/provision/aws/generators/node_group.rb', line 56

def default_action(action)
  @resources.each do |resource|
    resource.do_action(action) 
  end
end

#deployObject



38
39
40
41
42
# File 'lib/topo/provision/aws/generators/node_group.rb', line 38

def deploy() 
  @resources.each do |resource|
    resource.do_action("deploy") 
  end
end

#stopObject



50
51
52
53
54
# File 'lib/topo/provision/aws/generators/node_group.rb', line 50

def stop()
  @resources.reverse.each do |resource|
    resource.do_action("stop") 
  end
end

#undeployObject



44
45
46
47
48
# File 'lib/topo/provision/aws/generators/node_group.rb', line 44

def undeploy() 
  @resources.reverse.each do |resource|
    resource.do_action("undeploy") 
  end
end