Class: AwsStack::CloudFormation
- Inherits:
-
Object
- Object
- AwsStack::CloudFormation
- Defined in:
- lib/awsstack/cloudformation.rb
Overview
AWS Session creation with profile
Instance Method Summary collapse
- #check ⇒ Object
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(options) ⇒ CloudFormation
constructor
A new instance of CloudFormation.
- #operation_names ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(options) ⇒ CloudFormation
Returns a new instance of CloudFormation.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/awsstack/cloudformation.rb', line 7 def initialize() @credentials = [:credentials] create_cfn_client @operation = [:operation].to_sym @stackname = [:stackname] @templatefile = [:templatefile] @paramfile = [:paramfile] @environment = [:environment] @debug = [:debug] if public_methods.include?(@operation) public_send @operation else puts "Requested operation '#{@operation}' is not a public method." end end |
Instance Method Details
#check ⇒ Object
24 25 26 27 |
# File 'lib/awsstack/cloudformation.rb', line 24 def check raise unless validate_template puts "Template '#{@templatefile}' validated! OK." end |
#create ⇒ Object
29 30 31 32 33 |
# File 'lib/awsstack/cloudformation.rb', line 29 def create check @params = read_param_file pp create_stack end |
#delete ⇒ Object
41 42 43 44 |
# File 'lib/awsstack/cloudformation.rb', line 41 def delete delete_stack puts 'Delete started...' end |
#operation_names ⇒ Object
46 47 48 |
# File 'lib/awsstack/cloudformation.rb', line 46 def operation_names pp @cfn.operation_names end |
#update ⇒ Object
35 36 37 38 39 |
# File 'lib/awsstack/cloudformation.rb', line 35 def update check @params = read_param_file update_stack end |