Class: AWS::CloudFormation::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/pryaws/cloud-formation.rb

Instance Method Summary collapse

Instance Method Details

#infoObject



15
16
17
18
# File 'lib/pryaws/cloud-formation.rb', line 15

def info
  sr = status_reason()
  "#{name()} (#{status()}#{sr.nil? ? '' : ' :' + sr})"
end

#save_template(path) ⇒ Object



20
21
22
# File 'lib/pryaws/cloud-formation.rb', line 20

def save_template(path)
  File.open(path, 'w'){|f| f.write JSON.pretty_generate(JSON.parse(template()))}
end

#set_param(key, value) ⇒ Object



24
25
26
27
28
29
# File 'lib/pryaws/cloud-formation.rb', line 24

def set_param(key, value)
  p = parameters()
  raise "Invalid param '#{key}'." if p[key].nil?
  p[key] = value
  update :template => template, :parameters => p, :capabilities => ['CAPABILITY_IAM']
end