beaker-aws 0.7.0 → 0.8.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
  SHA1:
3
- metadata.gz: 4866acd6653e805a28c64c04e3ca86c9906ff7e5
4
- data.tar.gz: e6b5052bbe8d40251c1cd9f91bd0c28fec0e905a
3
+ metadata.gz: 5b26a191837d6178ca381188d630580e7164fb81
4
+ data.tar.gz: 8f99f771202aac99eca8c1398d0b8c6c9c72df81
5
5
  SHA512:
6
- metadata.gz: 5118363801c1e62579baa718d2e8a2e2a53fb4a46e15d8f42d20116480696e320dec38a4095e050073c095f1299d8d39ef33e1b945e9a89e64fad99291caea13
7
- data.tar.gz: 43651255fa2ea328814945204fc859f2415468024863ba292195c1da7b5dfe171d8a496a7f27e0545cff3b6061f717e18bacb3260553fc699e6b8f2ecb0c538c
6
+ metadata.gz: d8097804f569ec2a6ff9138de95df973af467b2f49d7c03c34b1062313af88a20ae3dc69a1c6f9aafc1d7aaf453574c5e0bf164566b675ab1f5f48669336d297
7
+ data.tar.gz: 41146639bd25556a5e0a3853c7ad96adaf4b7ae3a20984efb26dd6a0bfd65f22ad1dad3710701c966f24837b98ff5d0a2380e5e313066a456565405b1355ea98
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Change Log
2
2
 
3
+ [Unreleased](https://github.com/puppetlabs/beaker-aws/compare/0.8.0...master)
4
+
5
+ ## [0.8.0](https://github.com/puppetlabs/beaker-aws/tree/0.8.0) (2018-12-12)
6
+ [Full Changelog](https://github.com/puppetlabs/beaker-aws/compare/0.7.0...0.8.0)
7
+
8
+ **Merged pull requests:**
9
+
10
+ - \(BKR-1546\) Added associate\_public\_ip\_address as host variable that is inserted into the AWS config if set
11
+
12
+ ## [0.7.0](https://github.com/puppetlabs/beaker-aws/tree/0.7.0) (2018-08-27)
13
+ [Full Changelog](https://github.com/puppetlabs/beaker-aws/compare/0.6.0...0.7.0)
14
+
15
+ **Merged pull requests:**
16
+
17
+ - \(BKR-1522\) Add options to drop some of the provisioning
18
+ - \(BKR-1509\) Hypervisor usage instructions for Beaker 4.0
19
+
3
20
  ## [0.6.0](https://github.com/puppetlabs/beaker-aws/tree/0.6.0) (2018-07-16)
4
21
  [Full Changelog](https://github.com/puppetlabs/beaker-aws/compare/0.5.0...0.6.0)
5
22
 
@@ -49,4 +66,4 @@
49
66
 
50
67
 
51
68
 
52
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
69
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/ec2.md CHANGED
@@ -114,3 +114,8 @@ By default root login is not allowed with Amazon Linux. Setting it to ec2-user w
114
114
 
115
115
  #### `disable_root_ssh` ####
116
116
  By default Beaker enabled root login on the instance. There are situation where we use AMIs which are pre-configured. Setting `disable_root_ssh` to `true` will stop enablign the root login.
117
+
118
+ #### `associate_public_ip_address` ####
119
+ Beaker uses default setting from subnet policies for the boolean
120
+ variable "associate public ip address". Use this setting to
121
+ override that when needed.
@@ -1,3 +1,3 @@
1
1
  module BeakerAws
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -342,12 +342,17 @@ module Beaker
342
342
  :enabled => true,
343
343
  },
344
344
  :key_name => ensure_key_pair(region).key_pairs.first.key_name,
345
- :security_group_ids => [security_group.group_id, ping_security_group.group_id],
346
345
  :instance_type => amisize,
347
346
  :disable_api_termination => false,
348
347
  :instance_initiated_shutdown_behavior => "terminate",
349
- :subnet_id => subnet_id,
348
+ :network_interfaces => [{
349
+ :subnet_id => subnet_id,
350
+ :groups => [security_group.group_id, ping_security_group.group_id],
351
+ :device_index => 0,
352
+ }],
350
353
  }
354
+ assoc_pub_ip_addr = host['associate_public_ip_address']
355
+ config[:network_interfaces][0][:associate_public_ip_address] = assoc_pub_ip_addr unless assoc_pub_ip_addr.nil?
351
356
  config[:block_device_mappings] = block_device_mappings if image.root_device_type == :ebs
352
357
  reservation = client(region).run_instances(config)
353
358
  reservation.instances.first
@@ -1213,5 +1213,45 @@ module Beaker
1213
1213
  aws
1214
1214
  end
1215
1215
  end
1216
+
1217
+ describe 'create_instance' do
1218
+ let(:mock_client) { instance_double(Aws::EC2::Client) }
1219
+
1220
+ before(:each) do
1221
+ allow(aws).to receive(:client).and_return(mock_client)
1222
+ vpc = instance_double(Aws::EC2::Types::Vpc, :vpc_id => 1337)
1223
+ describe_vpcs_result = instance_double(Aws::EC2::Types::DescribeVpcsResult, :vpcs => [vpc])
1224
+ allow(mock_client).to receive(:describe_vpcs).and_return(describe_vpcs_result)
1225
+ image = instance_double(Aws::EC2::Types::Image, :root_device_type => :no_device)
1226
+ described_images = instance_double(Aws::EC2::Types::DescribeImagesResult, :images => [image])
1227
+ allow(mock_client).to receive(:describe_images).and_return(described_images)
1228
+ security_group = instance_double(Aws::EC2::Types::GroupIdentifier, :group_id => 69)
1229
+ security_groups_result =
1230
+ instance_double(Aws::EC2::Types::DescribeSecurityGroupsResult, :security_groups => [security_group])
1231
+ allow(mock_client).to receive(:describe_security_groups).and_return(security_groups_result)
1232
+ key_pair = instance_double(Aws::EC2::Types::KeyPairInfo, :key_name => 'a-key')
1233
+ key_pair_result = instance_double(Aws::EC2::Types::DescribeKeyPairsResult, :key_pairs => [key_pair])
1234
+ allow(aws).to receive(:ensure_key_pair).and_return(key_pair_result)
1235
+ end
1236
+
1237
+ it 'sets associate_public_ip_address when included' do
1238
+ host = @hosts[0]
1239
+ host['associate_public_ip_address'] = true
1240
+ variable_path = hash_including(
1241
+ :network_interfaces => [hash_including(:associate_public_ip_address => true)])
1242
+ reservation = instance_double(Aws::EC2::Types::Reservation, :instances => [instance_double(Aws::EC2::Types::Instance)])
1243
+ expect(mock_client).to receive(:run_instances).with(variable_path).and_return(reservation)
1244
+ aws.create_instance(host, amispec, nil)
1245
+ end
1246
+
1247
+ it 'omits associate_public_ip_address when not included' do
1248
+ host = @hosts[0]
1249
+ variable_path = hash_including(
1250
+ :network_interfaces => [hash_excluding(:associate_public_ip_address => anything)])
1251
+ reservation = instance_double(Aws::EC2::Types::Reservation, :instances => [instance_double(Aws::EC2::Types::Instance)])
1252
+ expect(mock_client).to receive(:run_instances).with(variable_path).and_return(reservation)
1253
+ aws.create_instance(host, amispec, nil)
1254
+ end
1255
+ end
1216
1256
  end
1217
1257
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rishi Javia, Kevin Imber, Tony Vu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec