Class: Admiral::Tasks::CloudFormation
- Inherits:
-
Thor
- Object
- Thor
- Admiral::Tasks::CloudFormation
show all
- Extended by:
- Base
- Includes:
- Util::CloudFormation
- Defined in:
- lib/admiral-cloudformation/tasks.rb
Constant Summary
collapse
- EXAMPLES =
['elasticsearch', 'meteor', 'mongo']
- NAME =
'cf'
- USAGE =
'cf <command> <options>'
- DESCRIPTION =
'Commands for wielding AWS CloudFormation templates.'
Util::CloudFormation::DEFAULT_RECIPES, Util::CloudFormation::FAILED_STATS, Util::CloudFormation::SUCCESS_STATS
Instance Method Summary
collapse
#client, #create_stack, #name, #params, #stack_name, #update_stack
Instance Method Details
#create ⇒ Object
29
30
31
32
|
# File 'lib/admiral-cloudformation/tasks.rb', line 29
def create
template = File.read options[:template]
create_stack stack_name(options[:environment]), template, params(options[:environment])
end
|
#destroy ⇒ Object
45
46
47
|
# File 'lib/admiral-cloudformation/tasks.rb', line 45
def destroy
super stack_name options[:environment]
end
|
#init(type) ⇒ Object
51
52
53
54
55
56
57
|
# File 'lib/admiral-cloudformation/tasks.rb', line 51
def init(type)
raise ArgumentError, "#{type} must be one of #{EXAMPLES.join(',')}" unless EXAMPLES.include?(type)
path = File.expand_path("../../../examples/#{type}", __FILE__)
FileUtils.cp Dir.glob("#{path}/*"), Dir.getwd
puts "[admiral] #{type} CloudFormation setup initialized."
end
|
#update ⇒ Object
37
38
39
40
|
# File 'lib/admiral-cloudformation/tasks.rb', line 37
def update
template = File.read options[:template]
update_stack stack_name(options[:environment]), template, params(options[:environment])
end
|