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 +4 -4
- data/lib/chef/knife/ec2_server_create.rb +25 -0
- data/lib/knife-ec2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f2a7bca6d0b163b05f66380d1c3d0dfede7e8d4ccd62f16d1b89d4fbdffe199
|
|
4
|
+
data.tar.gz: ff715b4e93d86c630f5cb6b1efc65ea7fa10207e69b89abb8dd5bca4e18d8db5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/knife-ec2/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2019-08-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: chef
|