Class: DrawCloud::Map
Defined Under Namespace
Classes: MapLookup
Instance Attribute Summary collapse
-
#map_by_function ⇒ Object
Returns the value of attribute map_by_function.
-
#name ⇒ Object
Returns the value of attribute name.
-
#values ⇒ Object
Returns the value of attribute values.
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, #metadata, #network_acls, #network_interfaces, #outputs, #parameters, #parent, #rdses, #resources, #route_tables, #security_groups, #sns_topics, #subnets, #vpcs, #wait_handles
Instance Method Summary collapse
- #[](key) ⇒ Object
- #function_resource ⇒ Object
-
#initialize(name, map_by_function, options, values = {}) ⇒ Map
constructor
A new instance of Map.
- #load_into_config(config) ⇒ 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, #resource_name
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, map_by_function, options, values = {}) ⇒ Map
Returns a new instance of Map.
34 35 36 37 38 39 |
# File 'lib/draw_cloud/map.rb', line 34 def initialize(name, map_by_function, , values={}) @name = name @map_by_function = map_by_function @values = values super() end |
Instance Attribute Details
#map_by_function ⇒ Object
Returns the value of attribute map_by_function.
33 34 35 |
# File 'lib/draw_cloud/map.rb', line 33 def map_by_function @map_by_function end |
#name ⇒ Object
Returns the value of attribute name.
33 34 35 |
# File 'lib/draw_cloud/map.rb', line 33 def name @name end |
#values ⇒ Object
Returns the value of attribute values.
33 34 35 |
# File 'lib/draw_cloud/map.rb', line 33 def values @values end |
Instance Method Details
#[](key) ⇒ Object
41 42 43 |
# File 'lib/draw_cloud/map.rb', line 41 def [](key) MapLookup.new(self, key) end |
#function_resource ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/draw_cloud/map.rb', line 45 def function_resource case map_by_function when :map_by_region {"Ref" => "AWS::Region"} when Parameter map_by_function.ref else raise ArgumentError, "Unknown map function #{map_by_function}" end end |
#load_into_config(config) ⇒ Object
56 57 58 59 |
# File 'lib/draw_cloud/map.rb', line 56 def load_into_config(config) config.cf_add_mapping resource_name, self super(config) end |
#to_h ⇒ Object
61 62 63 |
# File 'lib/draw_cloud/map.rb', line 61 def to_h values end |