enviroblyd 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: e1557473923398525894640e93df45810a6333ede11a9b51974071bf80b48509
4
- data.tar.gz: 77a34dabf2f079257158827a8a2f80448c9b19c0d879b194f29dab720ec9de66
3
+ metadata.gz: 4662a74b3e3eb17cad2ef6c6f511fc79e4460eb9a40635a8f476e50076b075e7
4
+ data.tar.gz: 4fba6adca14dd3247decf29333e6452e544c91b9772012c494c1e452cdee74ae
5
5
  SHA512:
6
- metadata.gz: ff373c35e37d10c84fa9d70bde75c12845d99eb89e24f3fb597c9abfad81a20b3646a8be542d4d36b0303893984aa331f3fdfcd19a08abf82509bf21ef53d514
7
- data.tar.gz: 8f6819a56c04a72a18e1b41e9aee4ad5ab9f21adbcd032b8df9ee1440464f871edae1734ef9a13d96dcabb13132caa5fe0dc04cd04c445b86c985f5a7e63bea9
6
+ metadata.gz: 9ea39b7b42bdd486e064ef256524fcb5ca42030bcc3a91d51382436b0f5c035c8da438cc4d5f094aec714319429df255dc717fb74b7240e44cb051d86bd2e987
7
+ data.tar.gz: eeb5ea402402c421d298da8dd2e641fa8c0c46e39dfd5e27abffe89752aa180df8c5a965461d337ca097446486a27f47e25a265b48142df9018245d7cd43f4cf
@@ -13,9 +13,13 @@ class Enviroblyd::Cli::Main < Enviroblyd::Base
13
13
  API_HOST = ENV.fetch("ENVIROBLYD_API_HOST", "envirobly.com")
14
14
  desc "boot", "Get IMDSv2 metadata"
15
15
  def boot
16
- token = http("http://#{IMDS_HOST}/latest/api/token").body.chomp("")
16
+ token = http("http://#{IMDS_HOST}/latest/api/token",
17
+ type: Net::HTTP::Put, headers: { "X-aws-ec2-metadata-token-ttl-seconds" => TOKEN_TTL_SECONDS.to_s }).
18
+ body.chomp("")
17
19
  puts "token: #{token} ."
18
- instance_id = http("http://#{IMDS_HOST}/latest/meta-data/instance-id").body.chomp("")
20
+ instance_id = http("http://#{IMDS_HOST}/latest/meta-data/instance-id",
21
+ headers: { "X-aws-ec2-metadata-token" => token }).
22
+ body.chomp("")
19
23
  puts "instance_id: #{instance_id} ."
20
24
 
21
25
  response = http("https://#{API_HOST}/api/v1/boots/#{instance_id}", retry_interval: 3, retries: 5, backoff: :exponential)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enviroblyd
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enviroblyd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Starsi