class Pods::Pod

Attributes

availability_zones[R]
cidr[R]
name[R]

Public Class Methods

new(data = {}) click to toggle source
# File lib/podbay/pod.rb, line 7
def initialize(data = {})
  load!(data.deep_symbolize_keys)
end

Public Instance Methods

load(podfile_path) click to toggle source

Load details from a Podfile.

# File lib/podbay/pod.rb, line 13
def load(podfile_path)
  load!(YAML.load_file(podfile_path).deep_symbolize_keys)
end
load!(data) click to toggle source
# File lib/podbay/pod.rb, line 17
def load!(data)
  @name = @data[:name].to_s.underscore
  @cidr = @data[:cidr]
  @availability_zones = @data[:availability_zones]
end
services() click to toggle source
# File lib/podbay/pod.rb, line 27
def services
  @data[:services] || []
end
tags() click to toggle source
# File lib/podbay/pod.rb, line 42
def tags
  { pod: name }
end
to_template() click to toggle source

Returns a cloudformation template for the Pod.

# File lib/podbay/pod.rb, line 33
def to_template
  template_path = File.expand_path(
    '../templates/cloudformation.template.erb',
    __FILE__
  )

  ERB.new(File.read(template_path)).result(binding)
end

Private Instance Methods

_validate_data(data) click to toggle source
# File lib/podbay/pod.rb, line 48
def _validate_data(data)
  # Raise an error if something is invalid.
end