Module: Ufo::Stack::Helper
Instance Method Summary
collapse
Methods included from Util
#default_cluster, #display_params, #execute, #pretty_time, #settings, #task_definition_arns, #user_params
Methods included from AwsService
#cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb
Instance Method Details
#adjust_stack_name(cluster, service) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/ufo/stack/helper.rb', line 19
def adjust_stack_name(cluster, service)
if settings[:stack_naming].nil?
puts "WARN: In ufo v4.5 the UFO_ENV value gets appends to the end of the CloudFormation stack name. This means a new stack gets created. You must upgrade to using the new stack and delete the old stack manually. More info: https://ufoships.com/docs/upgrading/upgrade4.5/".color(:yellow)
puts "To get rid of this warning you can add `stack_naming: append_ufo_env` to your `.ufo/settings.yml config. New versions of ufo init do this automatically."
puts "Pausing for 20 seconds."
sleep 20
end
parts = case settings[:stack_naming]
when "prepend_cluster" [cluster, service, Ufo.] when "append_env", "append_cluster" [service, cluster, Ufo.]
when "append_nothing", "prepend_nothing"
[service, Ufo.]
else [service, Ufo.env, Ufo.]
end
parts.reject {|x| x==''}.compact.join('-') end
|
#cfn ⇒ Object
42
43
44
|
# File 'lib/ufo/stack/helper.rb', line 42
def cfn
Ufo::Setting::Profile.new(:cfn, settings[:cfn_profile]).data
end
|
#find_stack(stack_name) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/ufo/stack/helper.rb', line 7
def find_stack(stack_name)
resp = cloudformation.describe_stacks(stack_name: stack_name)
resp.stacks.first
rescue Aws::CloudFormation::Errors::ValidationError => e
if e.message =~ /Stack with/ && e.message =~ /does not exist/
nil
else
raise
end
end
|
#status ⇒ Object
46
47
48
|
# File 'lib/ufo/stack/helper.rb', line 46
def status
Status.new(@stack_name)
end
|