Documentation: .env.local only works for agentcore dev, not agentcore deploy
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 74/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- aws
- 領域
- cli, cloud, documentation
調査の方向性
README の環境変数セクションと、agentcore dev および agentcore deploy に関するドキュメントから始め、.env.local、agentcore.json の envVars、AWS Secrets Manager が現在どのように説明されているかを確認します。ローカルのみの範囲、デプロイの動作、本番環境向けのより安全な選択肢が明示され、関連するエントリポイントが特定された場合は、要求された CLI 警告にも対応できていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Title:
Documentation: .env.local only works for agentcore dev, not agentcore deploy
Labels:
documentation, enhancement
Description:
Problem
The documentation doesn't clearly explain that .env.local only provides environment variables for local development (agentcore dev), and is not deployed to AWS when running agentcore deploy. This leads to confusion when agents work locally but fail in production due to missing environment variables.
Expected Behavior
Documentation should clearly state:
.env.localis loaded duringagentcore devonly.env.localis gitignored and NOT uploaded during deployment- For production deployments, users must use either:
envVarsarray inagentcore.json(not recommended for secrets)- AWS Secrets Manager (recommended for sensitive data)
Actual Behavior
Current documentation mentions .env.local but doesn't clarify its scope. Users naturally assume that if .env.local works locally, it will also work when deployed.
Current project structure documentation:
agentcore/
├── .env.local # Secrets — API keys (gitignored)
This suggests .env.local is for secrets, but doesn't explain it's local-only.
User Impact
- Confusion: Agent works with
agentcore dev, fails afteragentcore deploy - Debugging time: Users spend time troubleshooting why environment variables are missing in production
- Security risk: Some users might add credentials to
envVarsinagentcore.jsonand accidentally commit to git
Real-World Example
Use case: Deploying an agent that needs external API credentials
Local (works):
# .env.local
API_KEY=xxx
API_SECRET=yyy
# Agent code
api_key = os.getenv("API_KEY") # ✅ Works with agentcore dev
Deployed (fails):
agentcore deploy # .env.local not uploaded
# Runtime error: Missing API_KEY
Suggested Documentation Improvements
- Add clear section in README:
## Environment Variables
### Local Development
Use `.env.local` for local development with `agentcore dev`:
- Automatically loaded by the CLI
- Gitignored (never committed)
- **NOT deployed to AWS**
### Production Deployment
For deployed agents, choose one:
**Option A: envVars in agentcore.json** (not recommended for secrets)
```json
{
"runtimes": [{
"envVars": [
{"name": "API_KEY", "value": "xxx"}
]
}]
}
⚠️ Warning: This file is typically committed to git. Do not store secrets here.
Option B: AWS Secrets Manager (recommended)
import boto3
client = boto3.client("secretsmanager")
secrets = json.loads(client.get_secret_value(SecretId="my-secret")["SecretString"])
2. **Add warning in CLI output:**
$ agentcore deploy
⚠️ Note: .env.local is not deployed. Use envVars in agentcore.json or AWS Secrets Manager for production credentials.
### Additional Context
- This is a common pattern confusion in serverless deployments
- Similar tools (Vercel, Netlify) clearly document local vs production env behavior
- AgentCore CDK constructs don't have built-in Secrets Manager integration
### Related Issues
- Missing: Built-in pattern for AWS Secrets Manager integration
- Missing: Example templates showing production credential management
- 主要言語
- TypeScript
- スター
- 291
- フォーク
- 96
- 平均マージ
- 20時間 50分
- マージ済み PR(30日)
- 214
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/agentcore-cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
aws/agentcore-cli#2395 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
aws/agentcore-cli#2392 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws/agentcore-cli#2267 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/agentcore-cli#2258 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/agentcore-cli#2176 ·
メンテナーはふだん 1 日以内に返信
aws/agentcore-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
diegosouzapw/OmniRoute#14869 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
メンテナーはふだん 1 日以内に返信
-
status: waiting triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
freeCodeCamp/freeCodeCamp#70412 ·
メンテナーはふだん 1 日以内に返信
-
Mend: dependency security vulnerability untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
opensearch-project/OpenSearch-Dashboards#12816 ·
メンテナーはふだん 1 日以内に返信