Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add ECS Task Metadata client

未关闭
#3,136 5 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
50/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
aws, ruby
领域
cloud

调研方向

首先阅读现有的 Aws::EC2Metadata 客户端和 ECS Task Metadata endpoint v4 文档。跟踪客户端如何支持获取 EC2 instance ID,然后定义对应的 ECS task metadata 入口点以及 UpdateContainerInstancesState 所需的 Cluster 值;完成的标准是客户端公开这些数据,并覆盖预期响应。

由索引模型根据 Issue 内容生成。

描述

cross-sdk feature-request
Describe the feature

Similar to the existing Aws::EC2Metadata client class, it would be helpful to have a metadata client class that retrieves and presents data from the ECS Task Metadata endpoint described here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html

While I could retrieve the response from the ECS Task Metadata endpoint and parse the Cluster field from it, having a built-in method to retrieve this would be simpler and cleaner, and is in keeping with how I get the EC2 instance ID already.

Use Case

I want to use this client class to let an application running in ECS on EC2 retrieve the name of the ECS Cluster name it is a part of, for use when calling UpdateContainerInstancesState https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateContainerInstancesState.html
. This method requires passing in the cluster name, as well as the EC2 instance ID, to set the status to a value. I want to set the status to DRAINING to prevent ECS from placing a task on an EC2 instance that is in one of the Terminating states, but ECS is not aware of this. Because I can control when an EC2 instance is put into a Terminating state, I can also put the ECS container instance state to DRAINING at the same time.

Proposed Solution

Implement similar to the Aws::EC2Metadata client class.

Other Information

No response

Acknowledgements
  • I may be able to implement this feature request
  • This feature might incur a breaking change
SDK version used

3.165.0

Environment details (OS name and version, etc.)

Ruby 3.1.2 on Linux, e.g. ruby:3.1.2-slim-bullseye from docker hub

主要语言
Ruby
星标
3.7k
派生
1.2k
平均合并
1 天 16 小时
30 天内合并 PR
25

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/aws-sdk-ruby 的其他 Issue

查看 aws/aws-sdk-ruby 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。