aws-ec2 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +84 -52
- data/README.md +3 -4
- data/aws-ec2.gemspec +3 -0
- data/lib/aws-ec2.rb +7 -4
- data/lib/aws_ec2/ami.rb +7 -8
- data/lib/aws_ec2/cli.rb +12 -10
- data/lib/aws_ec2/command.rb +13 -0
- data/lib/aws_ec2/compile_scripts.rb +30 -0
- data/lib/aws_ec2/core.rb +4 -1
- data/lib/aws_ec2/create.rb +14 -84
- data/lib/aws_ec2/create/params.rb +157 -0
- data/lib/aws_ec2/dotenv.rb +30 -0
- data/lib/aws_ec2/help/ami.md +11 -0
- data/lib/aws_ec2/help/create.md +3 -3
- data/lib/aws_ec2/help/user_data.md +4 -4
- data/lib/aws_ec2/hook.rb +32 -0
- data/lib/aws_ec2/script.rb +26 -0
- data/lib/aws_ec2/scripts/ami_creation.sh +24 -16
- data/lib/aws_ec2/scripts/auto_terminate.sh +95 -0
- data/lib/aws_ec2/template_helper.rb +47 -12
- data/lib/aws_ec2/template_helper/ami_helper.rb +23 -0
- data/lib/aws_ec2/template_helper/partial_helper.rb +71 -0
- data/lib/aws_ec2/version.rb +1 -1
- data/spec/fixtures/demo_project/config/test.yml +9 -0
- data/spec/fixtures/demo_project/profiles/default.yml +33 -0
- data/spec/lib/cli_spec.rb +9 -4
- data/spec/spec_helper.rb +4 -3
- metadata +57 -8
- data/example/profiles/spot/default.yml +0 -14
- data/example/profiles/spot/dev.yml +0 -15
- data/lib/aws_ec2/help/spot.md +0 -3
- data/lib/aws_ec2/spot.rb +0 -81
- data/lib/aws_ec2/user_data.rb +0 -17
- data/lib/aws_ec2/util.rb +0 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b159b7648562e89bf4552a9f42b81ebdda0fca33d979c7f5ae6a5ef38f29ca7
|
4
|
+
data.tar.gz: f3a261914d4442d75af1afd00f9ee7e1dd4e6bf2d155168ddc80b1fcbe2d8e61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f2c2ccfe42c46ce64049ec6b04bb1bad648a252e6a7f071829cd4f8f52d97b4372a0c7889c6ead9726bc0d4b0f27acb9fc64bc8948e1f5f7c52ac2e3d63f8d
|
7
|
+
data.tar.gz: d82ba0ed306f5024fb262d018fd9fe7a76b8a25ff242cc1a5a4c78d4edf122eb3b444625c45d256eaaf84d1be17ddd6ac7885c8eb0297b8c7f0b5c7b13ce8572
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.4.0]
|
7
|
+
- aws-ec2 ami command
|
8
|
+
- create: add --source-ami options
|
9
|
+
- compile_scripts command
|
10
|
+
- custom helper support
|
11
|
+
- dotenv support
|
12
|
+
- hook support
|
13
|
+
- latest_ami helper
|
14
|
+
- partial support
|
15
|
+
- starter specs: spec for ami
|
16
|
+
- remove aws-ec2 spot command
|
17
|
+
- remove aws-ec2 userdata command, sanity rspec passing
|
18
|
+
|
6
19
|
## [0.3.0]
|
7
20
|
- Do not merge profile to default profile. This was pretty confusing usage.
|
8
21
|
- Add --ami option which result in automatically creating an ami at the end of
|
data/Gemfile.lock
CHANGED
@@ -1,88 +1,120 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
aws-ec2 (0.3.0)
|
5
|
+
activesupport
|
6
|
+
aws-sdk-ec2
|
5
7
|
colorize
|
8
|
+
dotenv
|
6
9
|
hashie
|
7
10
|
thor
|
8
11
|
|
9
12
|
GEM
|
10
13
|
remote: https://rubygems.org/
|
11
14
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
activesupport (5.1.4)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (~> 0.7)
|
18
|
+
minitest (~> 5.1)
|
19
|
+
tzinfo (~> 1.1)
|
20
|
+
aws-partitions (1.57.0)
|
21
|
+
aws-sdk-core (3.14.0)
|
22
|
+
aws-partitions (~> 1.0)
|
23
|
+
aws-sigv4 (~> 1.0)
|
24
|
+
jmespath (~> 1.0)
|
25
|
+
aws-sdk-ec2 (1.25.0)
|
26
|
+
aws-sdk-core (~> 3)
|
27
|
+
aws-sigv4 (~> 1.0)
|
28
|
+
aws-sigv4 (1.0.2)
|
29
|
+
byebug (9.1.0)
|
30
|
+
codeclimate-test-reporter (1.0.8)
|
31
|
+
simplecov (<= 0.13)
|
32
|
+
coderay (1.1.2)
|
33
|
+
colorize (0.8.1)
|
34
|
+
concurrent-ruby (1.0.5)
|
35
|
+
diff-lcs (1.3)
|
19
36
|
docile (1.1.5)
|
20
|
-
|
37
|
+
dotenv (2.2.1)
|
38
|
+
ffi (1.9.18)
|
21
39
|
formatador (0.2.5)
|
22
|
-
guard (2.
|
40
|
+
guard (2.14.2)
|
23
41
|
formatador (>= 0.2.4)
|
24
|
-
listen (
|
25
|
-
lumberjack (
|
42
|
+
listen (>= 2.7, < 4.0)
|
43
|
+
lumberjack (>= 1.0.12, < 2.0)
|
26
44
|
nenv (~> 0.1)
|
45
|
+
notiffany (~> 0.0)
|
27
46
|
pry (>= 0.9.12)
|
47
|
+
shellany (~> 0.0)
|
28
48
|
thor (>= 0.18.1)
|
29
49
|
guard-bundler (2.1.0)
|
30
50
|
bundler (~> 1.0)
|
31
51
|
guard (~> 2.2)
|
32
52
|
guard-compat (~> 1.1)
|
33
|
-
guard-compat (1.2.
|
34
|
-
guard-rspec (4.
|
53
|
+
guard-compat (1.2.1)
|
54
|
+
guard-rspec (4.7.3)
|
35
55
|
guard (~> 2.1)
|
36
56
|
guard-compat (~> 1.1)
|
37
57
|
rspec (>= 2.99.0, < 4.0)
|
38
|
-
hashie (3.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
58
|
+
hashie (3.5.7)
|
59
|
+
i18n (0.9.3)
|
60
|
+
concurrent-ruby (~> 1.0)
|
61
|
+
jmespath (1.3.1)
|
62
|
+
json (2.1.0)
|
63
|
+
listen (3.1.5)
|
64
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
65
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
66
|
+
ruby_dep (~> 1.2)
|
67
|
+
lumberjack (1.0.12)
|
68
|
+
method_source (0.9.0)
|
69
|
+
minitest (5.11.3)
|
70
|
+
nenv (0.3.0)
|
71
|
+
notiffany (0.1.1)
|
72
|
+
nenv (~> 0.1)
|
73
|
+
shellany (~> 0.0)
|
74
|
+
pry (0.11.3)
|
49
75
|
coderay (~> 1.1.0)
|
50
|
-
method_source (~> 0.
|
51
|
-
|
52
|
-
|
53
|
-
rb-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
rspec-
|
58
|
-
rspec-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
76
|
+
method_source (~> 0.9.0)
|
77
|
+
rake (12.3.0)
|
78
|
+
rb-fsevent (0.10.2)
|
79
|
+
rb-inotify (0.9.10)
|
80
|
+
ffi (>= 0.5.0, < 2)
|
81
|
+
rspec (3.7.0)
|
82
|
+
rspec-core (~> 3.7.0)
|
83
|
+
rspec-expectations (~> 3.7.0)
|
84
|
+
rspec-mocks (~> 3.7.0)
|
85
|
+
rspec-core (3.7.1)
|
86
|
+
rspec-support (~> 3.7.0)
|
87
|
+
rspec-expectations (3.7.0)
|
88
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
89
|
+
rspec-support (~> 3.7.0)
|
90
|
+
rspec-mocks (3.7.0)
|
63
91
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
-
rspec-support (~> 3.
|
65
|
-
rspec-
|
66
|
-
|
67
|
-
|
68
|
-
simplecov (0.
|
92
|
+
rspec-support (~> 3.7.0)
|
93
|
+
rspec-support (3.7.0)
|
94
|
+
ruby_dep (1.5.0)
|
95
|
+
shellany (0.0.1)
|
96
|
+
simplecov (0.13.0)
|
69
97
|
docile (~> 1.1.0)
|
70
|
-
|
71
|
-
simplecov-html (~> 0.
|
72
|
-
simplecov-html (0.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
98
|
+
json (>= 1.8, < 3)
|
99
|
+
simplecov-html (~> 0.10.0)
|
100
|
+
simplecov-html (0.10.2)
|
101
|
+
thor (0.20.0)
|
102
|
+
thread_safe (0.3.6)
|
103
|
+
tzinfo (1.2.4)
|
104
|
+
thread_safe (~> 0.1)
|
77
105
|
|
78
106
|
PLATFORMS
|
79
107
|
ruby
|
80
108
|
|
81
109
|
DEPENDENCIES
|
82
|
-
|
110
|
+
aws-ec2!
|
111
|
+
bundler
|
112
|
+
byebug
|
83
113
|
codeclimate-test-reporter
|
84
114
|
guard
|
85
115
|
guard-bundler
|
86
116
|
guard-rspec
|
87
117
|
rake
|
88
|
-
|
118
|
+
|
119
|
+
BUNDLED WITH
|
120
|
+
1.16.1
|
data/README.md
CHANGED
@@ -31,9 +31,9 @@ aws-ec2 create myserver
|
|
31
31
|
|
32
32
|
## User-Data
|
33
33
|
|
34
|
-
You can provide user-data script to customize the server upon launch. The user-data scripts are under the
|
34
|
+
You can provide user-data script to customize the server upon launch. The user-data scripts are under the app/user-data folder.
|
35
35
|
|
36
|
-
*
|
36
|
+
* app/user-data/myserver.yml
|
37
37
|
|
38
38
|
The user-data script is generated on the machine that is running the aws-ec2 command. If this is your local macosx machine, then the context is your local macosx machine is available. To see the generated user-data script, you can use the `aws userdata NAME`. Example:
|
39
39
|
|
@@ -47,7 +47,7 @@ You can set a config file and define variables in there that are available to in
|
|
47
47
|
|
48
48
|
## Noop mode
|
49
49
|
|
50
|
-
You can do a test run with the `--noop` flag. This will print out what settings will be used to launch the instance.
|
50
|
+
You can do a test run with the `--noop` flag. This will print out what settings will be used to launch the instance. This is a good way to inspect the generated user-data script.
|
51
51
|
|
52
52
|
```sh
|
53
53
|
aws-ec2 create myserver --profile myserver --noop
|
@@ -65,7 +65,6 @@ Spot instance support natively supported by the AWS run_instances command. Simp
|
|
65
65
|
```sh
|
66
66
|
aws-ec2 create help
|
67
67
|
aws-ec2 userdata help
|
68
|
-
aws-ec2 spot help
|
69
68
|
aws-ec2 help # general help
|
70
69
|
```
|
71
70
|
|
data/aws-ec2.gemspec
CHANGED
@@ -22,6 +22,9 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency "thor"
|
23
23
|
spec.add_dependency "hashie"
|
24
24
|
spec.add_dependency "colorize"
|
25
|
+
spec.add_dependency "dotenv"
|
26
|
+
spec.add_dependency "activesupport"
|
27
|
+
spec.add_dependency "aws-sdk-ec2"
|
25
28
|
|
26
29
|
spec.add_development_dependency "bundler"
|
27
30
|
spec.add_development_dependency "byebug"
|
data/lib/aws-ec2.rb
CHANGED
@@ -7,14 +7,17 @@ module AwsEc2
|
|
7
7
|
autoload :Command, "aws_ec2/command"
|
8
8
|
autoload :CLI, "aws_ec2/cli"
|
9
9
|
autoload :AwsServices, "aws_ec2/aws_services"
|
10
|
-
autoload :Util, "aws_ec2/util"
|
11
10
|
autoload :Create, "aws_ec2/create"
|
12
|
-
autoload :Spot, "aws_ec2/spot"
|
13
|
-
autoload :TemplateHelper, "aws_ec2/template_helper"
|
14
|
-
autoload :UserData, "aws_ec2/user_data"
|
15
11
|
autoload :Ami, "aws_ec2/ami"
|
12
|
+
autoload :TemplateHelper, "aws_ec2/template_helper"
|
13
|
+
autoload :Script, "aws_ec2/script"
|
16
14
|
autoload :Config, "aws_ec2/config"
|
17
15
|
autoload :Core, "aws_ec2/core"
|
16
|
+
autoload :Dotenv, "aws_ec2/dotenv"
|
17
|
+
autoload :Hook, "aws_ec2/hook"
|
18
|
+
autoload :CompileScripts, "aws_ec2/compile_scripts"
|
18
19
|
|
19
20
|
extend Core
|
20
21
|
end
|
22
|
+
|
23
|
+
AwsEc2::Dotenv.load!
|
data/lib/aws_ec2/ami.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
module AwsEc2
|
2
2
|
class Ami
|
3
|
-
def initialize(
|
4
|
-
@
|
3
|
+
def initialize(options)
|
4
|
+
@options = options.clone
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
8
|
-
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
ERB.new(template, nil, "-").result(binding)
|
7
|
+
def run
|
8
|
+
# Delegates to the Create command.
|
9
|
+
# So we just have to set up the option for it.
|
10
|
+
@options[:ami_name] = @options[:name]
|
11
|
+
Create.new(@options).run
|
13
12
|
end
|
14
13
|
end
|
15
14
|
end
|
data/lib/aws_ec2/cli.rb
CHANGED
@@ -5,23 +5,25 @@ module AwsEc2
|
|
5
5
|
class_option :profile, desc: "profile name to use"
|
6
6
|
|
7
7
|
desc "create NAME", "create ec2 instance"
|
8
|
-
option :ami, desc: "ami name, if specified an ami will be created at the end of user data"
|
9
8
|
long_desc Help.text(:create)
|
9
|
+
option :ami_name, desc: "when specified, an ami creation script is appended to the user-data script"
|
10
|
+
option :auto_terminate, type: :boolean, default: false, desc: "automatically terminate the instance at the end of user-data"
|
11
|
+
option :source_ami, desc: "override the source image_id in profile"
|
10
12
|
def create(name)
|
11
13
|
Create.new(options.merge(name: name)).run
|
12
14
|
end
|
13
15
|
|
14
|
-
desc "
|
15
|
-
long_desc Help.text(:
|
16
|
-
|
17
|
-
|
16
|
+
desc "ami NAME", "launches instance and uses it create AMI"
|
17
|
+
long_desc Help.text(:ami)
|
18
|
+
option :auto_terminate, type: :boolean, default: true, desc: "automatically terminate the instance at the end of user-data"
|
19
|
+
def ami(name)
|
20
|
+
Ami.new(options.merge(name: name)).run
|
18
21
|
end
|
19
22
|
|
20
|
-
desc "
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
UserData.new(options.merge(name: name)).run
|
23
|
+
desc "compile_scripts", "compiles app/scripts into tmp/app/scripts"
|
24
|
+
long_desc Help.text(:compile_scripts)
|
25
|
+
def compile_scripts
|
26
|
+
CompileScripts.new(options).compile
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
data/lib/aws_ec2/command.rb
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
require "thor"
|
2
2
|
|
3
|
+
# Override thor's long_desc identation behavior
|
4
|
+
# https://github.com/erikhuda/thor/issues/398
|
5
|
+
class Thor
|
6
|
+
module Shell
|
7
|
+
class Basic
|
8
|
+
def print_wrapped(message, options = {})
|
9
|
+
message = "\n#{message}" unless message[0] == "\n"
|
10
|
+
stdout.puts message
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
3
16
|
module AwsEc2
|
4
17
|
class Command < Thor
|
5
18
|
class << self
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module AwsEc2
|
4
|
+
class CompileScripts
|
5
|
+
include TemplateHelper
|
6
|
+
BUILD_ROOT = "tmp"
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@options = options
|
10
|
+
end
|
11
|
+
|
12
|
+
def compile
|
13
|
+
puts "Compiling app/scripts to..."
|
14
|
+
clean
|
15
|
+
Dir.glob("#{AwsEc2.root}/app/scripts/**/*").each do |path|
|
16
|
+
next if File.directory?(path)
|
17
|
+
result = erb_result(path)
|
18
|
+
tmp_path = path.sub(%r{.*/app/}, "#{BUILD_ROOT}/app/")
|
19
|
+
puts " #{tmp_path}"
|
20
|
+
FileUtils.mkdir_p(File.dirname(tmp_path))
|
21
|
+
IO.write(tmp_path, result)
|
22
|
+
end
|
23
|
+
puts "Compiled app/scripts."
|
24
|
+
end
|
25
|
+
|
26
|
+
def clean
|
27
|
+
FileUtils.rm_rf(BUILD_ROOT)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/aws_ec2/core.rb
CHANGED
data/lib/aws_ec2/create.rb
CHANGED
@@ -3,8 +3,8 @@ require 'active_support/core_ext/hash'
|
|
3
3
|
|
4
4
|
module AwsEc2
|
5
5
|
class Create
|
6
|
+
autoload :Params, "aws_ec2/create/params"
|
6
7
|
include AwsServices
|
7
|
-
include Util
|
8
8
|
|
9
9
|
def initialize(options)
|
10
10
|
@options = options
|
@@ -18,6 +18,7 @@ module AwsEc2
|
|
18
18
|
return
|
19
19
|
end
|
20
20
|
|
21
|
+
Hook.run(:before_run_instances, @options)
|
21
22
|
resp = ec2.run_instances(params)
|
22
23
|
puts "EC2 instance #{@options[:name]} created! 🎉"
|
23
24
|
puts "Visit https://console.aws.amazon.com/ec2/home to check on the status"
|
@@ -25,89 +26,7 @@ module AwsEc2
|
|
25
26
|
|
26
27
|
# params are main derived from profile files
|
27
28
|
def params
|
28
|
-
params
|
29
|
-
decorate_params(params)
|
30
|
-
normalize_launch_template(params).deep_symbolize_keys
|
31
|
-
end
|
32
|
-
|
33
|
-
def decorate_params(params)
|
34
|
-
upsert_name_tag(params)
|
35
|
-
params
|
36
|
-
end
|
37
|
-
|
38
|
-
# Adds instance ec2 tag if not already provided
|
39
|
-
def upsert_name_tag(params)
|
40
|
-
specs = params["tag_specifications"] || []
|
41
|
-
|
42
|
-
# insert an empty spec placeholder if one not found
|
43
|
-
spec = specs.find do |s|
|
44
|
-
s["resource_type"] == "instance"
|
45
|
-
end
|
46
|
-
unless spec
|
47
|
-
spec = {
|
48
|
-
"resource_type" => "instance",
|
49
|
-
"tags" => []
|
50
|
-
}
|
51
|
-
specs << spec
|
52
|
-
end
|
53
|
-
# guaranteed there's a tag_specifications with resource_type instance at this point
|
54
|
-
|
55
|
-
tags = spec["tags"] || []
|
56
|
-
|
57
|
-
unless tags.map { |t| t["key"] }.include?("Name")
|
58
|
-
tags << { "key" => "Name", "value" => @options[:name] }
|
59
|
-
end
|
60
|
-
|
61
|
-
specs = specs.map do |s|
|
62
|
-
# replace the name tag value
|
63
|
-
if s["resource_type"] == "instance"
|
64
|
-
{
|
65
|
-
"resource_type" => "instance",
|
66
|
-
"tags" => tags
|
67
|
-
}
|
68
|
-
else
|
69
|
-
s
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
params["tag_specifications"] = specs
|
74
|
-
params
|
75
|
-
end
|
76
|
-
|
77
|
-
# Allow adding launch template as a simple string.
|
78
|
-
#
|
79
|
-
# Standard structure:
|
80
|
-
# {
|
81
|
-
# launch_template: { launch_template_name: "TestLaunchTemplate" },
|
82
|
-
# }
|
83
|
-
#
|
84
|
-
# Simple string:
|
85
|
-
# {
|
86
|
-
# launch_template: "TestLaunchTemplate",
|
87
|
-
# }
|
88
|
-
#
|
89
|
-
# When launch_template is a simple String it will get transformed to the
|
90
|
-
# standard structure.
|
91
|
-
def normalize_launch_template(params)
|
92
|
-
if params["launch_template"].is_a?(String)
|
93
|
-
launch_template_identifier = params["launch_template"]
|
94
|
-
launch_template = if launch_template_identifier =~ /^lt-/
|
95
|
-
{ "launch_template_id" => launch_template_identifier }
|
96
|
-
else
|
97
|
-
{ "launch_template_name" => launch_template_identifier }
|
98
|
-
end
|
99
|
-
params["launch_template"] = launch_template
|
100
|
-
end
|
101
|
-
params
|
102
|
-
end
|
103
|
-
|
104
|
-
# Hard coded sensible defaults.
|
105
|
-
# Can be overridden easily with profiles
|
106
|
-
def defaults
|
107
|
-
{
|
108
|
-
max_count: 1,
|
109
|
-
min_count: 1,
|
110
|
-
}
|
29
|
+
@params ||= Params.new(@options).generate
|
111
30
|
end
|
112
31
|
|
113
32
|
def display_info
|
@@ -137,5 +56,16 @@ module AwsEc2
|
|
137
56
|
puts "Please double check that it exists."
|
138
57
|
exit
|
139
58
|
end
|
59
|
+
|
60
|
+
def pretty_display(data)
|
61
|
+
data = data.deep_stringify_keys
|
62
|
+
|
63
|
+
if data["user_data"]
|
64
|
+
message = "base64-encoded: cat /tmp/aws-ec2/user-data.txt to view"
|
65
|
+
data["user_data"] = message
|
66
|
+
end
|
67
|
+
|
68
|
+
puts YAML.dump(data)
|
69
|
+
end
|
140
70
|
end
|
141
71
|
end
|