lib/humidifier/reservoir/stack.rb in humidifier-reservoir-0.2.2 vs lib/humidifier/reservoir/stack.rb in humidifier-reservoir-0.2.3
- old
+ new
@@ -37,11 +37,11 @@
def deploy(wait = false)
return unless ensure_resources
valid?
opts = { capabilities: %w[CAPABILITY_IAM CAPABILITY_NAMED_IAM] }
- wait ? humidifier_stack.deploy_and_wait(opts) : humidifier_stack.deploy(opts)
+ humidifier_stack.public_send(wait ? :deploy_and_wait : :deploy, opts)
end
def resources
Reservoir.files_for(name).each_with_object({}) do |filepath, resources|
resources.merge!(parse(filepath, File.basename(filepath, '.yml')))
@@ -54,23 +54,29 @@
def to_cf
humidifier_stack.to_cf
end
+ def upload
+ humidifier_stack.upload
+ end
+
def valid?
humidifier_stack.valid?
rescue Aws::CloudFormation::Errors::AccessDenied
- raise Error, <<-MSG
-The authenticated AWS profile does not have the requisite permissions to run
-this command. Ensure the profile has cloudformation:ValidateTemplate.
-MSG
+ raise Error, <<~MSG
+ The authenticated AWS profile does not have the requisite permissions
+ to run this command. Ensure the profile has
+ cloudformation:ValidateTemplate.
+ MSG
end
private
def ensure_resources
return true if humidifier_stack.resources.any?
- puts "Refusing to deploy stack #{humidifier_stack.name} with no resources"
+ puts "Refusing to deploy stack #{humidifier_stack.name} with no " \
+ 'resources'
false
end
def humidifier_stack
Humidifier::Stack.new(