Class: CloudFormationWrapper::StackManager
- Inherits:
-
Object
- Object
- CloudFormationWrapper::StackManager
- Defined in:
- lib/cloudformation_wrapper/stack_manager.rb
Overview
Stack Manager Class Class containing static convenience methods for deploying and managing CloudFormation Stacks.
Class Method Summary collapse
Class Method Details
.deploy(options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cloudformation_wrapper/stack_manager.rb', line 6 def self.deploy() unless [:client] access_key_id = [:access_key_id] || ENV['AWS_ACCESS_KEY_ID'] || ENV['ACCESS_KEY'] || raise(ArgumentError, 'Cannot find AWS Access Key ID.') secret_access_key = [:secret_access_key] || ENV['AWS_SECRET_ACCESS_KEY'] || ENV['SECRET_KEY'] || raise(ArgumentError, 'Cannot find AWS Secret Key.') credentials = Aws::Credentials.new(access_key_id, secret_access_key) end region = [:region] || ENV['AWS_REGION'] || ENV['AMAZON_REGION'] || ENV['AWS_DEFAULT_REGION'] || raise(ArgumentError, 'Cannot find AWS Region.') = () cf_client = [:client] || Aws::CloudFormation::Client.new(credentials: credentials, region: region) ensure_template_file_exists([:template_path], cf_client) deploy_stack( [:parameters], [:name], [:template_path], [:wait_for_stack], cf_client ) end |