formatron 0.1.15 → 0.1.16

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
  SHA1:
3
- metadata.gz: 932f38c884b67c73450aa6842772390de1db150f
4
- data.tar.gz: 7e70e25c5de6024938501fc0935c33c392546bc0
3
+ metadata.gz: 5dc23305a2c92b7c561a92448718f825838a290a
4
+ data.tar.gz: a0177f3af41161bdeaaf39ed426e75cbac5837f1
5
5
  SHA512:
6
- metadata.gz: 9c1d72b86843a572767eadc0607cc3a8b8275d392b3ad73902186313c04809446dde1ba7bd13c2ea74b2f8b3a371014a2b95c1956a5e98da8b5fb099a7dca76e
7
- data.tar.gz: 69abb715018d08008170e6192499695561dc8532c00dd5f2aed3283e989538aed49bd3d43d5fbaaa6f71087c20292fd6080d25f7b9185451d242424a3fb1c29d
6
+ metadata.gz: d07528b6d5d0d765d63c2950bd2778a8fa7d7432612322f83540429fa7a862ff0c77bf94cd21f92eabda1900abcd682e672d5749d586391e557f5f1a5798ca68
7
+ data.tar.gz: 2d8a8f5fd738049ea766db611ecb84a627e9af7bf9a92e8d06e76492a488b4f0174f8bc70677f830bda130bf35aadc803533aad2e2c642b269ecee94bd5a2db8
@@ -287,8 +287,14 @@ class Formatron
287
287
  security_group:,
288
288
  logical_id:,
289
289
  source_dest_check:,
290
- os:
290
+ os:,
291
+ ami:
291
292
  )
293
+ ami = Template.find_in_map(
294
+ Template::REGION_MAP,
295
+ Template.ref('AWS::Region'),
296
+ os
297
+ ) if ami.nil?
292
298
  if os.eql? 'windows'
293
299
  user_data = Template.base_64(
294
300
  Template.join(
@@ -347,11 +353,7 @@ class Formatron
347
353
  Template.ref('AWS::Region'),
348
354
  availability_zone
349
355
  ),
350
- ImageId: Template.find_in_map(
351
- Template::REGION_MAP,
352
- Template.ref('AWS::Region'),
353
- os
354
- ),
356
+ ImageId: ami,
355
357
  SourceDestCheck: source_dest_check,
356
358
  InstanceType: instance_type,
357
359
  KeyName: key_name,
@@ -65,6 +65,7 @@ class Formatron
65
65
  @availability_zone = availability_zone
66
66
  @instance_type = @instance.instance_type || 't2.micro'
67
67
  @os = @instance.os || 'ubuntu'
68
+ @ami = @instance.ami
68
69
  @key_pair = key_pair
69
70
  @administrator_name = administrator_name
70
71
  @administrator_password = administrator_password
@@ -135,7 +136,8 @@ class Formatron
135
136
  security_group: @security_group_id,
136
137
  logical_id: @instance_id,
137
138
  source_dest_check: @source_dest_check,
138
- os: @os
139
+ os: @os,
140
+ ami: @ami
139
141
  )
140
142
  setup = Setup.new(
141
143
  setup: @setup,
@@ -22,6 +22,7 @@ class Formatron
22
22
  dsl_property :source_dest_check
23
23
  dsl_property :instance_type
24
24
  dsl_property :os
25
+ dsl_property :ami
25
26
  dsl_block :chef, 'Chef'
26
27
  dsl_block :policy, 'Policy'
27
28
  dsl_block :security_group, 'SecurityGroup'
@@ -1,4 +1,4 @@
1
1
  # add version to class
2
2
  class Formatron
3
- VERSION = '0.1.15'
3
+ VERSION = '0.1.16'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Halliday