infopark-aws_utils 0.4.0 → 0.5.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: e7dd829e9e5517b0d255fccd27e1a356dec75c44
4
- data.tar.gz: decdb8c540685c5472457ba120eac8b1387a9859
3
+ metadata.gz: 3127256fb77c8ea8965a58acd4a1913e257046a3
4
+ data.tar.gz: 07b73f8cb44c245506b312b00586c0f045f54a8d
5
5
  SHA512:
6
- metadata.gz: 18eb5572a0577bd269f2af29b303fcb5ad715cb5d3f63af02c211c274f32d04df82a56e09072e844056338122b03f50f3ec28c4be6a4c00d5af1a63d9cf82205
7
- data.tar.gz: 928da282abc792543e5e18577b34ba1dd1f7f392cbf972c446eb30c3321093cef01b800ce564567f5565cb9e3fff0bdf4dd42f45c04e4af2ff731e0dd4b1e4a5
6
+ metadata.gz: 51589ba5d0f959e2c021b97deb6134332625ebccf115e26b2eeabf0653480c4e6858eb8be64928b1b562ede711125c1df7de1e4ac91bf34d6718d12519593734
7
+ data.tar.gz: b7730823788aac144a667ef7005304072c3c8fe7239495648be8a9f44e15eeab3a1d4f8ec34b7b9d1210d17f258703f269710865fc88a8577ee03d499cb3a164
@@ -86,14 +86,28 @@ class Env
86
86
  account?(PROD_ACCOUNT_ID)
87
87
  end
88
88
 
89
- def latest_base_image
89
+ def latest_base_image(root_device_type: :instance)
90
+ root_device_filter_value =
91
+ case root_device_type
92
+ when :instance
93
+ ["instance-store"]
94
+ when :ebs
95
+ ["ebs"]
96
+ else
97
+ raise "invalid root_device_type: #{root_device_type}"
98
+ end
90
99
  available_images = AwsUtils.gather_all(ec2, :describe_images,
91
100
  owners: [AWS_AMI_OWNER],
92
101
  filters: [
93
- {name: "root-device-type", values: ["instance-store"]},
102
+ {name: "root-device-type", values: root_device_filter_value},
103
+ {name: "ena-support", values: ["true"]},
94
104
  {name: "image-type", values: ["machine"]},
95
105
  {name: "virtualization-type", values: ["hvm"]},
96
- ]).reject {|image| image.name.include?(".rc-") || image.name.include?("-minimal-") }
106
+ ])
107
+ .reject {|image| image.name.include?(".rc-") }
108
+ .reject {|image| image.name.include?("-minimal-") }
109
+ .reject {|image| image.name.include?("-test") }
110
+ .reject {|image| image.name.include?("amzn-ami-vpc-nat-") }
97
111
  available_images.sort_by(&:creation_date).last
98
112
  end
99
113
 
@@ -1,5 +1,5 @@
1
1
  module Infopark
2
2
  module AwsUtils
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark-aws_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilo Prütz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-07 00:00:00.000000000 Z
11
+ date: 2018-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-applicationautoscaling