lib/kumogata/client.rb in kumogata-0.4.11 vs lib/kumogata/client.rb in kumogata-0.4.12
- old
+ new
@@ -13,10 +13,11 @@
template = open_template(path_or_url)
update_deletion_policy(template)
add_encryption_password(template)
outputs = create_stack(template, stack_name)
+ filter_outputs(template, outputs)
@post_processing.run(:create, outputs)
outputs
end
@@ -56,10 +57,11 @@
template = open_template(path_or_url)
update_deletion_policy(template, :update_metadate => true)
add_encryption_password(template)
outputs = update_stack(template, stack_name)
+ filter_outputs(template, outputs)
@post_processing.run(:update, outputs)
outputs
end
@@ -260,10 +262,14 @@
end
@__hash__[path] = value
end
+ def _outputs_filter(&block)
+ @__hash__[:_outputs_filter] = block
+ end
+
def _post(options = {}, &block)
commands = Dslh::ScopeBlock.nest(binding, 'block')
@__hash__[:_post] = {
:options => options,
@@ -615,7 +621,15 @@
return unless stack_name
unless /\A[a-zA-Z][-a-zA-Z0-9]*\Z/i =~ stack_name
raise "1 validation error detected: Value '#{stack_name}' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*"
end
+ end
+
+ def filter_outputs(template, outputs)
+ if (_outputs_filter = template.delete(:_outputs_filter))
+ _outputs_filter.call(outputs)
+ end
+
+ return outputs
end
end