Module: Ufo::TaskDefinition::Helpers::StackOutput

Includes:
AwsServices, Concerns::Names
Defined in:
lib/ufo/task_definition/helpers/stack_output.rb

Instance Method Summary collapse

Methods included from Concerns::Names

#names

Methods included from AwsServices

#acm, #applicationautoscaling, #aws_options, #cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #find_stack, #ssm_client, #stack_resources, #status, #task_definition_arns

Instance Method Details

#stack_output(name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ufo/task_definition/helpers/stack_output.rb', line 6

def stack_output(name)
  stack_name, output_key = name.split(".")
  stack_name = names.expansion(stack_name)
  resp = cloudformation.describe_stacks(stack_name: stack_name)
  stack = resp.stacks.first
  if stack
    o = stack.outputs.detect { |h| h.output_key == output_key }
  end

  if o
    o.output_value
  else
    logger.info "WARN: NOT FOUND: output #{key} for stack #{stack_name}"
    nil
  end
end