cloudformation-tool 1.4.0 → 1.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 818f632bb0756f9be2ba922936b2a68e93a12d3af1a10b069e48941dd0615cfd
4
- data.tar.gz: 612c5e90b2a95f54435e1ddcbd65a4f833863097c61709a7d9d6895dd041c91e
3
+ metadata.gz: 5d47ec3cc3379ca6dfb0cc2f85ffade8b42e0422d4b761cf15da9ee1c97ca960
4
+ data.tar.gz: 4853ad5baa7f8b2322cf745f62e68603d098b53a1744562db5ec92ecd3200001
5
5
  SHA512:
6
- metadata.gz: ed6cb8daf2f5990b0a0df87149f9537e29153aacaa65c81a73fee2f2dc05e7d882a99463c22e1fafb00f46757961418df392e730cca805783922ad62db6114ba
7
- data.tar.gz: 9d584621509bf30401687ca5c946d9dd45d38a9ad6454b929283099db0ed2ae2aa4ddf93eecf2e123936c4c0a98c605bbe9bfb38c44609c94d4b06e09f626cb1
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
@@ -1,6 +1,7 @@
1
1
  require 'clamp'
2
2
  require 'io/console'
3
3
 
4
+ $MAX_USER_DATA_SIZE = 16384
4
5
 
5
6
  module CloudFormationTool
6
7
  module CLI
@@ -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 > 16000 # max AWS EC2 user data size - try compressing it
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 > 16384 # still to big, we should upload to S3 and create an include file
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}"
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
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.0
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-01-17 00:00:00.000000000 Z
11
+ date: 2021-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake