0
0

More than 3 years have passed since last update.

Fargateでコンテナ内でタスクのIDを取得する

Posted at

取得したいケースがあったのでメモ書き

uri = "#{ENV['ECS_CONTAINER_METADATA_URI']}/task"
response = Net::HTTP.get_response(URI.parse(uri))
json = JSON.parse(response.body)
json['TaskARN'].split('/').last

メタデータを取得してTaskのARNから抽出している。
環境変数から取得できるようにしてほしい・・・

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0