lib/ufo/task_definition/helpers/vars/builder.rb in ufo-6.3.8 vs lib/ufo/task_definition/helpers/vars/builder.rb in ufo-6.3.9
- old
+ new
@@ -39,11 +39,10 @@
show_layers(layers)
layers.select { |l| File.exist?(l) }
end
def show_layers(paths)
- label = @ext.sub('.','').capitalize
paths.each do |path|
if ENV['UFO_LAYERS_ALL']
logger.info " #{path}"
elsif Ufo.config.layering.show
logger.info " #{path} "if File.exist?(path)
@@ -83,13 +82,21 @@
secrets = env('.secrets')
secrets.map do |item|
value = item.delete(:value)
arn = normalize_to_arn(item[:name], value)
value = expansion(arn)
- value = value.sub('parameter//','parameter/') # auto fix accidental leading slash for user
+ value = autofix(value)
item[:valueFrom] = value
end
secrets
+ end
+
+ def autofix(value)
+ value = value.sub('parameter//','parameter/') # auto fix accidental leading slash for user
+ if value.include?(':secret:') && value.count(':') == 7 # missing trailing ::
+ value += "::"
+ end
+ value
end
def normalize_to_arn(name, value)
case value
when /^ssm:/i