knife-ec2 1.0.9 → 1.0.11

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: b3dc4e9ddac397fb8898196dffc621899eeb68c5fc2902f81ebf095f47b2e3c1
4
- data.tar.gz: e71fb1bdb5a8b8846c8404d8b4a5b84df26ede74a516f086ff6fcbc542c9e01d
3
+ metadata.gz: 6f2a7bca6d0b163b05f66380d1c3d0dfede7e8d4ccd62f16d1b89d4fbdffe199
4
+ data.tar.gz: ff715b4e93d86c630f5cb6b1efc65ea7fa10207e69b89abb8dd5bca4e18d8db5
5
5
  SHA512:
6
- metadata.gz: 7d9ce828a23864e13a605c864ea90474d15dd47b61a4ea17c55246d423362286564a953d8e8ba0fe8e6d6b16ba638480cbe1aac16370247419080803af85e52a
7
- data.tar.gz: 3ec7c9f801b45fb197dc777b47bd54f3f44efbba23adf21e24dbafeffba7536d771721ac86c777db73b5a37637937e2bc53fc4e8af701f337831b53f42d39531
6
+ metadata.gz: dd5e6b6b6fc99b4e3170135e50316951d66eb485063b1dad598a30134409928a852e7df47e0fc1b7a52d6e4d38684f0025385896e1f7f49e7ff46fdae34dbd73
7
+ data.tar.gz: 05ce9e4a754df26b507693377793969c6ef3b6d7f2fb54177883d7bb9437b0c1635d5da9a11b88610514b729c83137d4c2f024cbd7cf4a734fb0d31fc40c12b3
@@ -269,6 +269,12 @@ class Chef
269
269
  Chef::Config[:knife][:aws_tag]
270
270
  }
271
271
 
272
+ option :cpu_credits,
273
+ long: "--cpu-credits CPU_CREDITS",
274
+ description: "The credit option for CPU usage of the instance. Valid values are standard and unlimited. T3 instances launch as unlimited by default. T2 instances launch as standard by default.",
275
+ default: "standard",
276
+ in: %w{standard unlimited}
277
+
272
278
  def plugin_create_instance!
273
279
  requested_elastic_ip = config[:associate_eip] if config[:associate_eip]
274
280
 
@@ -334,6 +340,7 @@ class Chef
334
340
  msg_pair("AWS Tags", printed_aws_tags)
335
341
  msg_pair("Volume Tags", printed_volume_tags)
336
342
  msg_pair("SSH Key", server.key_name)
343
+ msg_pair("T2/T3 Unlimited", printed_t2_t3_unlimited)
337
344
 
338
345
  puts("\n")
339
346
 
@@ -718,6 +725,11 @@ class Chef
718
725
  config[:tags] += config_value(:chef_tag)
719
726
  ui.warn("[DEPRECATED] --chef-tag option is deprecated and will be removed in future release. Use --tags TAGS option instead.")
720
727
  end
728
+
729
+ if config_value(:cpu_credits) && !config_value(:flavor)
730
+ ui.error("Instance type should be specified and should be any of T2/T3 type.")
731
+ exit 1
732
+ end
721
733
  end
722
734
 
723
735
  def parse_aws_tags
@@ -958,6 +970,11 @@ class Chef
958
970
  attributes[:disable_api_termination] = config_value(:disable_api_termination) if config_value(:spot_price).nil?
959
971
 
960
972
  attributes[:instance_initiated_shutdown_behavior] = config_value(:instance_initiated_shutdown_behavior)
973
+
974
+ attributes[:credit_specification] =
975
+ {
976
+ cpu_credits: config[:cpu_credits],
977
+ }
961
978
  attributes
962
979
  end
963
980
 
@@ -1401,6 +1418,14 @@ class Chef
1401
1418
  def printed_aws_tags
1402
1419
  hashed_tags.map { |tag, val| "#{tag}: #{val}" }.join(", ")
1403
1420
  end
1421
+
1422
+ def printed_t2_t3_unlimited
1423
+ if config[:cpu_credits] == "unlimited"
1424
+ "Enabled"
1425
+ else
1426
+ "Disabled"
1427
+ end
1428
+ end
1404
1429
  end
1405
1430
  end
1406
1431
  end
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Ec2
3
- VERSION = "1.0.9".freeze
3
+ VERSION = "1.0.11".freeze
4
4
  MAJOR, MINOR, TINY = VERSION.split(".")
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-29 00:00:00.000000000 Z
11
+ date: 2019-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef