Class: DrawCloud::ASLaunchConfiguration
- Defined in:
- lib/draw_cloud/as_launch_configuration.rb
Instance Attribute Summary collapse
-
#image_id ⇒ Object
Returns the value of attribute image_id.
-
#instance_monitoring ⇒ Object
(also: #monitoring)
Returns the value of attribute instance_monitoring.
-
#instance_type ⇒ Object
(also: #instance_class)
Returns the value of attribute instance_type.
-
#kernel_id ⇒ Object
Returns the value of attribute kernel_id.
-
#key_name ⇒ Object
Returns the value of attribute key_name.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ram_disk_id ⇒ Object
Returns the value of attribute ram_disk_id.
-
#security_groups ⇒ Object
Returns the value of attribute security_groups.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#user_data ⇒ Object
Returns the value of attribute user_data.
Attributes inherited from Base
#as_groups, #as_launch_configurations, #deletion_policy, #depends_on, #ec2_instances, #elastic_ips, #gateways, #iam_access_keys, #iam_policies, #iam_users, #mappings, #network_acls, #network_interfaces, #outputs, #parameters, #parent, #rdses, #resources, #route_tables, #sns_topics, #subnets, #vpcs, #wait_handles
Instance Method Summary collapse
- #as_launch_configuration ⇒ Object
-
#initialize(name, options = {}, &block) ⇒ ASLaunchConfiguration
constructor
A new instance of ASLaunchConfiguration.
- #load_into_config(config) ⇒ Object
- #resource_name ⇒ Object
- #to_h ⇒ Object
Methods inherited from Base
#[], #accessor, #add_standard_properties, #create_as_group, #create_as_launch_configuration, #create_ec2_instance, #create_ec2_instance_template, #create_elastic_ip, #create_iam_access_key, #create_iam_policy, #create_iam_user, #create_mapping, #create_network_acl, #create_network_interface, #create_output, #create_parameter, #create_rds, #create_route_table, #create_security_group, #create_service, #create_sns_topic, #create_subnet, #create_vpc, #create_wait_handle, #ref
Methods included from Locations
Methods included from Utilities
#desplice, #fnbase64, #fngetatt, #fnjoin, #hash_to_tag_array, #region, #resource_style, #splice, #stack_name
Constructor Details
#initialize(name, options = {}, &block) ⇒ ASLaunchConfiguration
Returns a new instance of ASLaunchConfiguration.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 26 def initialize(name, ={}, &block) @name = name @image_id = .fetch(:image_id, nil) @instance_monitoring = .fetch(:instance_monitoring, nil) @instance_type = .fetch(:instance_type, nil) @kernel_id = .fetch(:kernel_id, nil) @key_name = .fetch(:key_name, nil) @ram_disk_id = .fetch(:ram_disk_id, nil) @security_groups = .fetch(:security_groups, nil) @user_data = .fetch(:user_data, nil) super(, &block) end |
Instance Attribute Details
#image_id ⇒ Object
Returns the value of attribute image_id.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def image_id @image_id end |
#instance_monitoring ⇒ Object Also known as: monitoring
Returns the value of attribute instance_monitoring.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def instance_monitoring @instance_monitoring end |
#instance_type ⇒ Object Also known as: instance_class
Returns the value of attribute instance_type.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def instance_type @instance_type end |
#kernel_id ⇒ Object
Returns the value of attribute kernel_id.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def kernel_id @kernel_id end |
#key_name ⇒ Object
Returns the value of attribute key_name.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def key_name @key_name end |
#metadata ⇒ Object
Returns the value of attribute metadata.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def @metadata end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def name @name end |
#ram_disk_id ⇒ Object
Returns the value of attribute ram_disk_id.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def ram_disk_id @ram_disk_id end |
#security_groups ⇒ Object
Returns the value of attribute security_groups.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def security_groups @security_groups end |
#tags ⇒ Object
Returns the value of attribute tags.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def @tags end |
#user_data ⇒ Object
Returns the value of attribute user_data.
21 22 23 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 21 def user_data @user_data end |
Instance Method Details
#as_launch_configuration ⇒ Object
39 40 41 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 39 def as_launch_configuration self end |
#load_into_config(config) ⇒ Object
43 44 45 46 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 43 def load_into_config(config) config.cf_add_resource resource_name, self super(config) end |
#resource_name ⇒ Object
48 49 50 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 48 def resource_name resource_style(name) + "LaunchConfig" end |
#to_h ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/draw_cloud/as_launch_configuration.rb', line 52 def to_h h = { "Type" => "AWS::AutoScaling::LaunchConfiguration", "Properties" => { "ImageId" => DrawCloud.ref(image_id), "InstanceType" => DrawCloud.ref(instance_type), } } p = h["Properties"] p["InstanceMonitoring"] = DrawCloud.ref(instance_monitoring) if instance_monitoring p["KernelId"] = DrawCloud.ref(kernel_id) if kernel_id p["KeyName"] = DrawCloud.ref(key_name) if key_name p["RamDiskId"] = DrawCloud.ref(ram_disk_id) if ram_disk_id p["SecurityGroups"] = security_groups.collect {|s| DrawCloud.ref(s)} if security_groups p["UserData"] = DrawCloud.ref(user_data) if user_data h["Metadata"] = DrawCloud.ref() unless .nil? || .empty? add_standard_properties(h) end |