cloudformation-tool 1.3.4 → 1.4.0

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: 5e68236a0ceae7d8423b08ad878d8800398f6f3d4035883961369db5cce9e69a
4
- data.tar.gz: 2f0d5633efd0cd1a20caa428135e1e81f483855dfa77dedaabc9d3b8657a2d01
3
+ metadata.gz: 818f632bb0756f9be2ba922936b2a68e93a12d3af1a10b069e48941dd0615cfd
4
+ data.tar.gz: 612c5e90b2a95f54435e1ddcbd65a4f833863097c61709a7d9d6895dd041c91e
5
5
  SHA512:
6
- metadata.gz: cfc5b645933403a7ec6b66151bcd0bb47e74324573ebe61455cbe10505e46c1ff7867960fd108b91f9a6302da8ae165ddd981f633f96175a149a74fcae6b8e70
7
- data.tar.gz: 0ea95fa0ca26a6b3106f7ecd31b659025f7d7f7d76d15d0b19fd47475102135883165c5e8e655a4ceadade2ddde17ecf65fea73a1771a4a8c34f45d6f85f11b4
6
+ metadata.gz: ed6cb8daf2f5990b0a0df87149f9537e29153aacaa65c81a73fee2f2dc05e7d882a99463c22e1fafb00f46757961418df392e730cca805783922ad62db6114ba
7
+ data.tar.gz: 9d584621509bf30401687ca5c946d9dd45d38a9ad6454b929283099db0ed2ae2aa4ddf93eecf2e123936c4c0a98c605bbe9bfb38c44609c94d4b06e09f626cb1
data/README.md CHANGED
@@ -103,27 +103,30 @@ multiple sub-templates, this is an error that would cause the tool to abort.
103
103
 
104
104
  ### Loading user data files
105
105
 
106
- When specifying a user-data block for a `LaunchConfiguration` resource or an `Instance`
107
- resource, the user-data can be loaded from an external YAML file (only YAML formatted user-data
108
- is currently supported, sorry) by specifying the `UserData` element as a map with the single
109
- field `File` that is set with the relative path to the user-data file. The user-data file is
110
- expected to be a cloud-init configuration file with the default extension `.init`.
111
-
112
- Alternatively, the field `FileTemplate` can be used under `UserData` to load an external cloud-init configuration file that includes variable place holders for the
113
- (CloudFormation intrinsic function Sub)[http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html]. The `FileTemplate` mode supports all
114
- the features described above as well as it performs the parsing detailed below, except
115
- compression and S3 offloading - as doing so prevents CloudFormation from performing the
116
- substitution operation. As a result, if the resulting cloud-init file is larger than 16KB
117
- you should expect that the template will fail to create the server.
106
+ When specifying a user-data block for a `LaunchConfiguration` resource, `Instance`
107
+ resource, or a `LaunchTemplate` resource, the user-data can be loaded from an external
108
+ YAML file (only YAML formatted user-data is currently supported, sorry) by specifying the
109
+ `UserData` element as a map with the single field `File` that is set with the relative
110
+ path to the user-data file. The user-data file is expected to be a cloud-init configuration
111
+ file with the default extension `.init` (but there really aren't any filename requirements).
112
+
113
+ Alternatively, the field `FileTemplate` can be used under `UserData` to load an external
114
+ cloud-init configuration file that includes variable place holders for the
115
+ (CloudFormation intrinsic function Sub)[http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html].
116
+ The `FileTemplate` mode supports all the features described above as well as it performs
117
+ the parsing detailed below, except compression and S3 offloading - as doing so prevents
118
+ CloudFormation from performing the substitution operation. As a result, if the resulting
119
+ cloud-init file is larger than 16KB you should expect that the template will fail to create
120
+ the stack.
118
121
 
119
122
  #### User data file parsing
120
123
 
121
124
  The reference file will be loaded and parsed as a ("Cloud Config data" file)[http://cloudinit.readthedocs.io/en/latest/topics/format.html#cloud-config-data]
122
- with the special `write_files` and `write_directories` enhancement (see below). The result is then checked that it
123
- does not exceed the user-data size limitation. If the file is bigger than can fit in the AWS
124
- user-data block, it will first be compressed using gzip and if it is still too large, it will
125
- be uploaded to S3 and the user-data block will be set with a cloud-init download reference to
126
- the S3 object.
125
+ with the special `write_files` and `write_directories` enhancement (see below).
126
+ The result is then checked that it does not exceed the user-data size limitation.
127
+ If the file is bigger than can fit in the AWS user-data block, it will first be compressed
128
+ using gzip and if it is still too large, it will be uploaded to S3 and the user-data block
129
+ will be set with a cloud-init download reference to the S3 object.
127
130
 
128
131
  ##### Enhanced `write_files`
129
132
 
@@ -23,7 +23,7 @@ module CloudFormationTool
23
23
  begin
24
24
  text = File.read(@path)
25
25
  # remove comments because white space seen between comments can seriously psych Psych
26
- text.gsub!(/^#.*\n/s,'')
26
+ text.gsub!(/^#.*\n/,'')
27
27
  text = fixShorthand(text)
28
28
  @data = YAML.load(text).to_h
29
29
  rescue Psych::SyntaxError => e
@@ -167,7 +167,7 @@ module CloudFormationTool
167
167
  restype = data['Type'] if restype.nil? and data.key?('Type')
168
168
  data.inject({}) do |dict, (key, val)|
169
169
  dict[key] = case restype
170
- when 'AWS::AutoScaling::LaunchConfiguration'
170
+ when 'AWS::AutoScaling::LaunchConfiguration', 'AWS::EC2::LaunchTemplate'
171
171
  if (key == "UserData") and (val["File"])
172
172
  # Support LaunchConfiguration UserData from file
173
173
  CloudInit.new("#{@basedir}/#{val["File"]}").to_base64
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '1.3.4'
2
+ VERSION = '1.4.0'
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.3.4
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Arbel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-07 00:00:00.000000000 Z
11
+ date: 2021-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake