knife-cloudformation 0.2.24 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +16 -0
- data/knife-cloudformation.gemspec +14 -4
- data/lib/knife-cloudformation.rb +0 -28
- data/lib/knife-cloudformation/version.rb +1 -1
- metadata +18 -80
- data/lib/chef/knife/cloudformation_create.rb +0 -147
- data/lib/chef/knife/cloudformation_describe.rb +0 -99
- data/lib/chef/knife/cloudformation_destroy.rb +0 -84
- data/lib/chef/knife/cloudformation_events.rb +0 -117
- data/lib/chef/knife/cloudformation_export.rb +0 -162
- data/lib/chef/knife/cloudformation_import.rb +0 -141
- data/lib/chef/knife/cloudformation_inspect.rb +0 -206
- data/lib/chef/knife/cloudformation_list.rb +0 -72
- data/lib/chef/knife/cloudformation_promote.rb +0 -40
- data/lib/chef/knife/cloudformation_update.rb +0 -137
- data/lib/chef/knife/cloudformation_validate.rb +0 -36
- data/lib/knife-cloudformation/cache.rb +0 -385
- data/lib/knife-cloudformation/knife.rb +0 -9
- data/lib/knife-cloudformation/knife/base.rb +0 -195
- data/lib/knife-cloudformation/knife/stack.rb +0 -197
- data/lib/knife-cloudformation/knife/template.rb +0 -213
- data/lib/knife-cloudformation/monkey_patch.rb +0 -8
- data/lib/knife-cloudformation/monkey_patch/stack.rb +0 -195
- data/lib/knife-cloudformation/provider.rb +0 -225
- data/lib/knife-cloudformation/utils.rb +0 -24
- data/lib/knife-cloudformation/utils/animal_strings.rb +0 -28
- data/lib/knife-cloudformation/utils/debug.rb +0 -31
- data/lib/knife-cloudformation/utils/json.rb +0 -64
- data/lib/knife-cloudformation/utils/object_storage.rb +0 -28
- data/lib/knife-cloudformation/utils/output.rb +0 -79
- data/lib/knife-cloudformation/utils/path_selector.rb +0 -99
- data/lib/knife-cloudformation/utils/ssher.rb +0 -29
- data/lib/knife-cloudformation/utils/stack_exporter.rb +0 -271
- data/lib/knife-cloudformation/utils/stack_parameter_scrubber.rb +0 -37
- data/lib/knife-cloudformation/utils/stack_parameter_validator.rb +0 -124
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09df8cb94ede3e5f2acb06a24a3d5c1da789d3b8
|
4
|
+
data.tar.gz: 8d0f3491417f99d2c00c5cbc65eabf14b0fdd0a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97475581fca99161a2d90216599cd63bf3aaec50031c6d64bc92fd71334a015613b157efe7c926add09f911b91f2f71f13f964eecaeb5db05ef6cb22a43da42b
|
7
|
+
data.tar.gz: 02d540b417b741a783681be85e220976792f645a4100b836872ce887845dcb6b95a267f5bdc07257d6c39104876129a5f303b614fd93a460221f0489447e44b3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## v0.5.0
|
2
|
+
|
3
|
+
_NOTE: This gem is deprecated and no longer maintained. The knife
|
4
|
+
plugin is now distributed via the sfn gem!_
|
5
|
+
|
6
|
+
* Remove all real content
|
7
|
+
* Update gemspec to install sfn automatically
|
8
|
+
* Add notes to README and after install notification
|
9
|
+
|
10
|
+
|
1
11
|
## v0.2.24
|
2
12
|
* Force parameter value set on defaults
|
3
13
|
|
data/README.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# DEPRECATION WARNING
|
2
|
+
|
3
|
+
_NOTE: The `knife-cloudformation` gem is deprecated. Please install
|
4
|
+
the `sfn` gem instead_:
|
5
|
+
|
6
|
+
```
|
7
|
+
$ gem uninstall knife-cloudformation
|
8
|
+
$ gem install sfn
|
9
|
+
```
|
10
|
+
|
11
|
+
or make the appropriate adjustments to your Gemfile. The `sfn` gem
|
12
|
+
now provides the `knife cloudformation` plugin.
|
13
|
+
|
14
|
+
* https://github.com/sparkleformation/sfn
|
15
|
+
|
16
|
+
|
1
17
|
# Knife CloudFormation
|
2
18
|
|
3
19
|
This is a plugin for the `knife` command provided by
|
@@ -10,9 +10,19 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = 'Knife tooling for Cloud Formation'
|
11
11
|
s.license = 'Apache-2.0'
|
12
12
|
s.require_path = 'lib'
|
13
|
-
s.add_dependency '
|
14
|
-
s.add_dependency 'miasma'
|
15
|
-
s.add_dependency 'net-ssh'
|
16
|
-
s.add_dependency 'sparkle_formation', '~> 0.2.0'
|
13
|
+
s.add_dependency 'sfn', '< 1.0'
|
17
14
|
s.files = Dir['lib/**/*'] + %w(knife-cloudformation.gemspec README.md CHANGELOG.md LICENSE)
|
15
|
+
s.post_install_message = <<-EOF
|
16
|
+
IMPORTANT NOTE: The knife-cloudformation gem is deprecated!
|
17
|
+
|
18
|
+
Please uninstall the knife-cloudformation gem as it is no longer maintained. The cloudformation
|
19
|
+
knife plugin is distributed via the sfn gem which has been automatically installed as a dependency.
|
20
|
+
|
21
|
+
---
|
22
|
+
gem uninstall knife-cloudformation
|
23
|
+
---
|
24
|
+
|
25
|
+
Thanks and happy stacking!
|
26
|
+
EOF
|
27
|
+
|
18
28
|
end
|
data/lib/knife-cloudformation.rb
CHANGED
@@ -1,29 +1 @@
|
|
1
1
|
require 'knife-cloudformation/version'
|
2
|
-
require 'miasma'
|
3
|
-
|
4
|
-
module KnifeCloudformation
|
5
|
-
|
6
|
-
autoload :Provider, 'knife-cloudformation/provider'
|
7
|
-
autoload :Cache, 'knife-cloudformation/cache'
|
8
|
-
autoload :Export, 'knife-cloudformation/export'
|
9
|
-
autoload :Utils, 'knife-cloudformation/utils'
|
10
|
-
autoload :MonkeyPatch, 'knife-cloudformation/monkey_patch'
|
11
|
-
autoload :Knife, 'knife-cloudformation/knife'
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
class Chef
|
16
|
-
class Knife
|
17
|
-
autoload :CloudformationCreate, 'chef/knife/cloudformation_create'
|
18
|
-
autoload :CloudformationDescribe, 'chef/knife/cloudformation_describe'
|
19
|
-
autoload :CloudformationDestroy, 'chef/knife/cloudformation_destroy'
|
20
|
-
autoload :CloudformationEvents, 'chef/knife/cloudformation_events'
|
21
|
-
autoload :CloudformationExport, 'chef/knife/cloudformation_export'
|
22
|
-
autoload :CloudformationImport, 'chef/knife/cloudformation_import'
|
23
|
-
autoload :CloudformationInspect, 'chef/knife/cloudformation_inspect'
|
24
|
-
autoload :CloudformationList, 'chef/knife/cloudformation_list'
|
25
|
-
autoload :CloudformationPromote, 'chef/knife/cloudformation_promote'
|
26
|
-
autoload :CloudformationUpdate, 'chef/knife/cloudformation_update'
|
27
|
-
autoload :CloudformationValidate, 'chef/knife/cloudformation_validate'
|
28
|
-
end
|
29
|
-
end
|
metadata
CHANGED
@@ -1,71 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-cloudformation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: sfn
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "<"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: miasma
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: net-ssh
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: sparkle_formation
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.0
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.2.0
|
26
|
+
version: '1.0'
|
69
27
|
description: Knife tooling for Cloud Formation
|
70
28
|
email: code@chrisroberts.org
|
71
29
|
executables: []
|
@@ -76,43 +34,23 @@ files:
|
|
76
34
|
- LICENSE
|
77
35
|
- README.md
|
78
36
|
- knife-cloudformation.gemspec
|
79
|
-
- lib/chef/knife/cloudformation_create.rb
|
80
|
-
- lib/chef/knife/cloudformation_describe.rb
|
81
|
-
- lib/chef/knife/cloudformation_destroy.rb
|
82
|
-
- lib/chef/knife/cloudformation_events.rb
|
83
|
-
- lib/chef/knife/cloudformation_export.rb
|
84
|
-
- lib/chef/knife/cloudformation_import.rb
|
85
|
-
- lib/chef/knife/cloudformation_inspect.rb
|
86
|
-
- lib/chef/knife/cloudformation_list.rb
|
87
|
-
- lib/chef/knife/cloudformation_promote.rb
|
88
|
-
- lib/chef/knife/cloudformation_update.rb
|
89
|
-
- lib/chef/knife/cloudformation_validate.rb
|
90
37
|
- lib/knife-cloudformation.rb
|
91
|
-
- lib/knife-cloudformation/cache.rb
|
92
|
-
- lib/knife-cloudformation/knife.rb
|
93
|
-
- lib/knife-cloudformation/knife/base.rb
|
94
|
-
- lib/knife-cloudformation/knife/stack.rb
|
95
|
-
- lib/knife-cloudformation/knife/template.rb
|
96
|
-
- lib/knife-cloudformation/monkey_patch.rb
|
97
|
-
- lib/knife-cloudformation/monkey_patch/stack.rb
|
98
|
-
- lib/knife-cloudformation/provider.rb
|
99
|
-
- lib/knife-cloudformation/utils.rb
|
100
|
-
- lib/knife-cloudformation/utils/animal_strings.rb
|
101
|
-
- lib/knife-cloudformation/utils/debug.rb
|
102
|
-
- lib/knife-cloudformation/utils/json.rb
|
103
|
-
- lib/knife-cloudformation/utils/object_storage.rb
|
104
|
-
- lib/knife-cloudformation/utils/output.rb
|
105
|
-
- lib/knife-cloudformation/utils/path_selector.rb
|
106
|
-
- lib/knife-cloudformation/utils/ssher.rb
|
107
|
-
- lib/knife-cloudformation/utils/stack_exporter.rb
|
108
|
-
- lib/knife-cloudformation/utils/stack_parameter_scrubber.rb
|
109
|
-
- lib/knife-cloudformation/utils/stack_parameter_validator.rb
|
110
38
|
- lib/knife-cloudformation/version.rb
|
111
39
|
homepage: http://github.com/hw-labs/knife-cloudformation
|
112
40
|
licenses:
|
113
41
|
- Apache-2.0
|
114
42
|
metadata: {}
|
115
|
-
post_install_message:
|
43
|
+
post_install_message: |
|
44
|
+
IMPORTANT NOTE: The knife-cloudformation gem is deprecated!
|
45
|
+
|
46
|
+
Please uninstall the knife-cloudformation gem as it is no longer maintained. The cloudformation
|
47
|
+
knife plugin is distributed via the sfn gem which has been automatically installed as a dependency.
|
48
|
+
|
49
|
+
---
|
50
|
+
gem uninstall knife-cloudformation
|
51
|
+
---
|
52
|
+
|
53
|
+
Thanks and happy stacking!
|
116
54
|
rdoc_options: []
|
117
55
|
require_paths:
|
118
56
|
- lib
|
@@ -1,147 +0,0 @@
|
|
1
|
-
require 'sparkle_formation'
|
2
|
-
require 'pathname'
|
3
|
-
require 'knife-cloudformation'
|
4
|
-
|
5
|
-
class Chef
|
6
|
-
class Knife
|
7
|
-
# Cloudformation create command
|
8
|
-
class CloudformationCreate < Knife
|
9
|
-
|
10
|
-
include KnifeCloudformation::Knife::Base
|
11
|
-
include KnifeCloudformation::Knife::Template
|
12
|
-
include KnifeCloudformation::Knife::Stack
|
13
|
-
|
14
|
-
banner 'knife cloudformation create NAME'
|
15
|
-
|
16
|
-
option(:timeout,
|
17
|
-
:short => '-t MIN',
|
18
|
-
:long => '--timeout MIN',
|
19
|
-
:description => 'Set timeout for stack creation',
|
20
|
-
:proc => lambda {|val|
|
21
|
-
Chef::Config[:knife][:cloudformation][:options][:timeout_in_minutes] = val
|
22
|
-
}
|
23
|
-
)
|
24
|
-
option(:rollback,
|
25
|
-
:short => '-R',
|
26
|
-
:long => '--[no]-rollback',
|
27
|
-
:description => 'Rollback on stack creation failure',
|
28
|
-
:boolean => true,
|
29
|
-
:default => true,
|
30
|
-
:proc => lambda {|val| Chef::Config[:knife][:cloudformation][:options][:disable_rollback] = !val }
|
31
|
-
)
|
32
|
-
option(:capability,
|
33
|
-
:short => '-C CAPABILITY',
|
34
|
-
:long => '--capability CAPABILITY',
|
35
|
-
:description => 'Specify allowed capabilities. Can be used multiple times.',
|
36
|
-
:proc => lambda {|val|
|
37
|
-
Chef::Config[:knife][:cloudformation][:options][:capabilities] ||= []
|
38
|
-
Chef::Config[:knife][:cloudformation][:options][:capabilities].push(val).uniq!
|
39
|
-
}
|
40
|
-
)
|
41
|
-
option(:notifications,
|
42
|
-
:long => '--notification ARN',
|
43
|
-
:description => 'Add notification ARN. Can be used multiple times.',
|
44
|
-
:proc => lambda {|val|
|
45
|
-
Chef::Config[:knife][:cloudformation][:options][:notification_ARNs] ||= []
|
46
|
-
Chef::Config[:knife][:cloudformation][:options][:notification_ARNs].push(val).uniq!
|
47
|
-
}
|
48
|
-
)
|
49
|
-
option(:print_only,
|
50
|
-
:long => '--print-only',
|
51
|
-
:description => 'Print template and exit'
|
52
|
-
)
|
53
|
-
option(:apply_stacks,
|
54
|
-
:long => '--apply-stack NAME_OR_ID',
|
55
|
-
:description => 'Autofill parameters using existing stack outputs. Can be used multiple times',
|
56
|
-
:proc => lambda {|val|
|
57
|
-
Chef::Config[:knife][:cloudformation][:create] ||= Mash.new
|
58
|
-
Chef::Config[:knife][:cloudformation][:create][:apply_stacks] ||= []
|
59
|
-
Chef::Config[:knife][:cloudformation][:create][:apply_stacks].push(val).uniq!
|
60
|
-
}
|
61
|
-
)
|
62
|
-
|
63
|
-
# Run the stack creation command
|
64
|
-
def _run
|
65
|
-
name = name_args.first
|
66
|
-
unless(name)
|
67
|
-
ui.fatal "Formation name must be specified!"
|
68
|
-
exit 1
|
69
|
-
end
|
70
|
-
if(Chef::Config[:knife][:cloudformation][:template])
|
71
|
-
file = Chef::Config[:knife][:cloudformation][:template]
|
72
|
-
else
|
73
|
-
file = load_template_file
|
74
|
-
nested_stacks_unpack = file.delete('sfn_nested_stack')
|
75
|
-
end
|
76
|
-
ui.info "#{ui.color('Cloud Formation:', :bold)} #{ui.color('create', :green)}"
|
77
|
-
stack_info = "#{ui.color('Name:', :bold)} #{name}"
|
78
|
-
if(Chef::Config[:knife][:cloudformation][:path])
|
79
|
-
stack_info << " #{ui.color('Path:', :bold)} #{Chef::Config[:knife][:cloudformation][:file]}"
|
80
|
-
if(Chef::Config[:knife][:cloudformation][:disable_processing])
|
81
|
-
stack_info << " #{ui.color('(not pre-processed)', :yellow)}"
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
unless(config[:print_only])
|
86
|
-
ui.info " -> #{stack_info}"
|
87
|
-
end
|
88
|
-
|
89
|
-
if(nested_stacks_unpack)
|
90
|
-
|
91
|
-
unpack_nesting(name, file, :create)
|
92
|
-
|
93
|
-
else
|
94
|
-
|
95
|
-
stack = provider.connection.stacks.build(
|
96
|
-
Chef::Config[:knife][:cloudformation][:options].dup.merge(
|
97
|
-
:name => name,
|
98
|
-
:template => file
|
99
|
-
)
|
100
|
-
)
|
101
|
-
|
102
|
-
apply_stacks!(stack)
|
103
|
-
stack.template = KnifeCloudformation::Utils::StackParameterScrubber.scrub!(stack.template)
|
104
|
-
|
105
|
-
if(config[:print_only])
|
106
|
-
ui.info _format_json(translate_template(stack.template))
|
107
|
-
return
|
108
|
-
end
|
109
|
-
|
110
|
-
populate_parameters!(stack.template)
|
111
|
-
stack.parameters = Chef::Config[:knife][:cloudformation][:options][:parameters]
|
112
|
-
|
113
|
-
stack.template = translate_template(stack.template)
|
114
|
-
stack.save
|
115
|
-
|
116
|
-
end
|
117
|
-
|
118
|
-
if(stack)
|
119
|
-
if(Chef::Config[:knife][:cloudformation][:poll])
|
120
|
-
poll_stack(stack.name)
|
121
|
-
stack = provider.connection.stacks.get(name)
|
122
|
-
|
123
|
-
if(stack.reload.success?)
|
124
|
-
ui.info "Stack create complete: #{ui.color('SUCCESS', :green)}"
|
125
|
-
knife_output = Chef::Knife::CloudformationDescribe.new
|
126
|
-
knife_output.name_args.push(name)
|
127
|
-
knife_output.config[:outputs] = true
|
128
|
-
knife_output.run
|
129
|
-
else
|
130
|
-
ui.fatal "Create of new stack #{ui.color(name, :bold)}: #{ui.color('FAILED', :red, :bold)}"
|
131
|
-
ui.info ""
|
132
|
-
knife_inspect = Chef::Knife::CloudformationInspect.new
|
133
|
-
knife_inspect.name_args.push(name)
|
134
|
-
knife_inspect.config[:instance_failure] = true
|
135
|
-
knife_inspect.run
|
136
|
-
exit 1
|
137
|
-
end
|
138
|
-
else
|
139
|
-
ui.warn 'Stack state polling has been disabled.'
|
140
|
-
ui.info "Stack creation initialized for #{ui.color(name, :green)}"
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
@@ -1,99 +0,0 @@
|
|
1
|
-
require 'knife-cloudformation'
|
2
|
-
|
3
|
-
class Chef
|
4
|
-
class Knife
|
5
|
-
# Cloudformation describe command
|
6
|
-
class CloudformationDescribe < Knife
|
7
|
-
|
8
|
-
include KnifeCloudformation::Knife::Base
|
9
|
-
|
10
|
-
banner 'knife cloudformation describe NAME'
|
11
|
-
|
12
|
-
option(:resources,
|
13
|
-
:short => '-r',
|
14
|
-
:long => '--resources',
|
15
|
-
:description => 'Display resources for stack'
|
16
|
-
)
|
17
|
-
option(:outputs,
|
18
|
-
:short => '-o',
|
19
|
-
:long => '--outputs',
|
20
|
-
:description => 'Display output for stack'
|
21
|
-
)
|
22
|
-
option(:attribute,
|
23
|
-
:short => '-a ATTR',
|
24
|
-
:long => '--attribute ATTR',
|
25
|
-
:description => 'Attribute to print. Can be used multiple times.',
|
26
|
-
:proc => lambda {|val|
|
27
|
-
Chef::Config[:knife][:cloudformation][:attributes] ||= []
|
28
|
-
Chef::Config[:knife][:cloudformation][:attributes].push(val).uniq!
|
29
|
-
}
|
30
|
-
)
|
31
|
-
option(:all,
|
32
|
-
:long => '--all-attributes',
|
33
|
-
:description => 'Print all attributes'
|
34
|
-
)
|
35
|
-
|
36
|
-
# information available
|
37
|
-
unless(defined?(AVAILABLE_DISPLAYS))
|
38
|
-
AVAILABLE_DISPLAYS = [:resources, :outputs]
|
39
|
-
end
|
40
|
-
|
41
|
-
# Run the stack describe action
|
42
|
-
def _run
|
43
|
-
stack_name = name_args.last
|
44
|
-
stack = provider.connection.stacks.get(stack_name)
|
45
|
-
if(stack)
|
46
|
-
display = [].tap do |to_display|
|
47
|
-
AVAILABLE_DISPLAYS.each do |display_option|
|
48
|
-
if(config[display_option])
|
49
|
-
to_display << display_option
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
display = AVAILABLE_DISPLAYS.dup if display.empty?
|
54
|
-
display.each do |display_method|
|
55
|
-
self.send(display_method, stack)
|
56
|
-
ui.info ''
|
57
|
-
end
|
58
|
-
else
|
59
|
-
ui.fatal "Failed to find requested stack: #{ui.color(stack_name, :bold, :red)}"
|
60
|
-
exit -1
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# Display resources
|
65
|
-
#
|
66
|
-
# @param stack [Miasma::Models::Orchestration::Stack]
|
67
|
-
def resources(stack)
|
68
|
-
stack_resources = stack.resources.all.sort do |x, y|
|
69
|
-
y.updated <=> x.updated
|
70
|
-
end.map do |resource|
|
71
|
-
Mash.new(resource.attributes)
|
72
|
-
end
|
73
|
-
things_output(stack.name, stack_resources, :resources)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Display outputs
|
77
|
-
#
|
78
|
-
# @param stack [Miasma::Models::Orchestration::Stack]
|
79
|
-
def outputs(stack)
|
80
|
-
ui.info "Outputs for stack: #{ui.color(stack.name, :bold)}"
|
81
|
-
unless(stack.outputs.empty?)
|
82
|
-
stack.outputs.each do |output|
|
83
|
-
key, value = output.key, output.value
|
84
|
-
key = snake(key).to_s.split('_').map(&:capitalize).join(' ')
|
85
|
-
ui.info [' ', ui.color("#{key}:", :bold), value].join(' ')
|
86
|
-
end
|
87
|
-
else
|
88
|
-
ui.info " #{ui.color('No outputs found')}"
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
# @return [Array<String>] default attributes
|
93
|
-
def default_attributes
|
94
|
-
%w(updated logical_id type status status_reason)
|
95
|
-
end
|
96
|
-
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|