Method: CloudShaped::CoreMethods#ref

Defined in:
lib/cloud_shaped/core_methods.rb

#ref(resource_name, attribute_name = nil) ⇒ Object

Returns a resource reference.

If attribute_name is specified, we use “Fn::GetAtt”; otherwise, we use “Ref”.

Parameters:

  • resource_name (String)

    name of the resource

  • attribute_name (String) (defaults to: nil)

    atttribute of the resource to refer to



90
91
92
93
94
95
96
# File 'lib/cloud_shaped/core_methods.rb', line 90

def ref(resource_name, attribute_name = nil)
  if attribute_name
    { "Fn::GetAtt" => [resource_name, attribute_name] }
  else
    { "Ref" => resource_name }
  end
end