cloudformation-tool 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d47ec3cc3379ca6dfb0cc2f85ffade8b42e0422d4b761cf15da9ee1c97ca960
|
4
|
+
data.tar.gz: 4853ad5baa7f8b2322cf745f62e68603d098b53a1744562db5ec92ecd3200001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e37177758d4c82350f8af6e842ecfbfc1e336230a50a11e946c87a325f8a27ec8cfe6b07a3b7ee7d8ba3c1682bb74a235c3cfceb7627394d27f173a1598ba368
|
7
|
+
data.tar.gz: af3e5b0a4dac828b3b846c0b5242b2661aec5d221b4fde8b3612756b9048009404ab1f2d64bd45c5fc7339c4b126eef0bfc07ecefa0afea834a171a6b62275e2
|
@@ -4,11 +4,16 @@ module CloudFormationTool
|
|
4
4
|
class Compile < Clamp::Command
|
5
5
|
include ParamSupport
|
6
6
|
|
7
|
+
option "--user-data-size", "SIZE", "Maximum size of VM user data", default: $MAX_USER_DATA_SIZE do |s|
|
8
|
+
Integer(s)
|
9
|
+
end
|
10
|
+
|
7
11
|
parameter 'FILE', 'Template main file'
|
8
12
|
|
9
13
|
add_param_options
|
10
14
|
|
11
15
|
def execute
|
16
|
+
$MAX_USER_DATA_SIZE = user_data_size
|
12
17
|
if file.end_with? '.init'
|
13
18
|
puts CloudInit.new(file).encode(false) # make sure cloud-init files obey AWS user-data restrictions, but are also printable
|
14
19
|
else
|
@@ -45,11 +45,11 @@ module CloudFormationTool
|
|
45
45
|
def encode(allow_gzip = true)
|
46
46
|
yamlout = compile
|
47
47
|
usegzip = false
|
48
|
-
if allow_gzip and yamlout.size >
|
48
|
+
if allow_gzip and yamlout.size > $MAX_USER_DATA_SIZE # max AWS EC2 user data size - try compressing it
|
49
49
|
yamlout = Zlib::Deflate.new(nil, 31).deflate(yamlout, Zlib::FINISH) # 31 is the magic word to have deflate create a gzip compatible header
|
50
50
|
usegzip = true
|
51
51
|
end
|
52
|
-
if yamlout.size >
|
52
|
+
if yamlout.size > $MAX_USER_DATA_SIZE # still to big, we should upload to S3 and create an include file
|
53
53
|
url = upload make_filename('init'),
|
54
54
|
yamlout, mime_type: 'text/cloud-config', gzip: usegzip
|
55
55
|
log "Wrote cloud config to #{url}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudformation-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oded Arbel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|