Region from ~/.aws/config includes an inline comment, so every AWS call fails

オープン 初心者向け
#2,939 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
aws, typescript
領域
cli

調査の方向性

src/core/region.ts、特に regionFromConfigFile から始め、共有設定値の処理を、issueで説明されている @smithy/core/config の parseIni の動作と比較してください。デフォルトプロファイルに region = us-west-2 # main region のような行があり、リージョン環境変数が設定されていない状態で再現してください。CLIが us-west-2 を解決し、説明されているAWSコマンドが失敗しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Description

When no --region, AWS_REGION or AWS_DEFAULT_REGION is set, the CLI reads the region from the
shared config file itself (regionFromConfigFile in src/core/region.ts). It keeps everything
after =, so a comment on the same line becomes part of the region. The AWS SDK's own ini parser
strips such comments, so the same file works with the AWS CLI and SDKs.

Steps to Reproduce
  1. ~/.aws/config:
    [default]
    region = us-west-2 # main region
    
  2. Unset AWS_REGION / AWS_DEFAULT_REGION and run any command, e.g. agentcore harness list --json.
Expected Behavior

The CLI uses us-west-2, as aws configure get region and the SDK do.

Actual Behavior

The region is us-west-2 # main region, and the SDK rejects it:
Region not accepted: region="us-west-2 # main region" is not a valid hostname component.

CLI Version

1.2.0 (current v1.x, a6452a4)

Operating System

Linux

Additional Context

The SDK (@smithy/core/config parseIni) drops #/; comments at line start or after
whitespace. The CLI's parser also matches any key that merely starts with region.

主要言語
TypeScript
スター
339
フォーク
129
平均マージ
19時間 21分
マージ済み PR(30日)
125

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/agentcore-cli のほかの issue

aws/agentcore-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。