Documentation: .env.local only works for agentcore dev, not agentcore deploy
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- aws
- Lĩnh vực
- cli, cloud, documentation
Hướng nghiên cứu
Bắt đầu với phần biến môi trường trong README và tài liệu về agentcore dev và agentcore deploy; xem lại cách .env.local, envVars trong agentcore.json và AWS Secrets Manager hiện được mô tả. Công việc được xem là hoàn tất khi phạm vi chỉ dành cho local, hành vi triển khai và các tùy chọn an toàn hơn cho production được nêu rõ, đồng thời mọi cảnh báo CLI được yêu cầu cũng được xử lý nếu xác định được entry point liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 291
- Fork
- 96
- Merge trung bình
- 20 giờ 50 phút
- Pull request đã merge (30 ngày)
- 214
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/agentcore-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
aws/agentcore-cli#2395 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
aws/agentcore-cli#2392 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/agentcore-cli#2267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/agentcore-cli#2258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/agentcore-cli#2176 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws/agentcore-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rohitg00/agentmemory#1428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
boxlite-ai/boxlite#1729 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Detect Deno tasks from deno.jsonĐang mởdetectors enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
SM260845/readme-gen#1 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
angular/angularfire#3774 ·
Maintainer thường phản hồi trong vòng 2 ngày