aws / aws/bedrock-agentcore-sdk-python

feat: Support Secrets Manager references in runtime environment variables

未关闭
#396 0 条评论 13 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
764
派生
148
平均合并
1 天 23 小时
30 天内合并 PR
7

描述

Problem

The environment_variables block on AgentCore Agent Runtime only accepts plaintext values. There is no mechanism to reference secrets from AWS Secrets Manager (or SSM Parameter Store) that get resolved at container start time.
This is a gap compared to other AWS container services. For example, ECS task definitions support valueFrom on container environment variables, which resolves Secrets Manager ARNs or SSM Parameter Store paths when the container starts — without ever exposing the secret value in the task definition, Terraform state, or the AWS console.

Use Case

When integrating third-party services that require credentials via environment variables (observability platforms, external APIs, etc.), the current options are:

  1. Plaintext env vars — credentials are visible in Terraform state, terraform plan output, the AgentCore console, and the AWS API. This is undesirable for production workloads with compliance requirements.
  2. Runtime secret fetching — application code fetches secrets from Secrets Manager at startup and sets env vars programmatically. This works but introduces timing issues when platform-level components (e.g., ADOT auto-instrumentation) read environment variables before application code has a chance to set them.

Neither option provides the same security and ergonomics that ECS users already have.

Proposed Solution

Support an optional secret reference syntax in environment_variables that resolves Secrets Manager (and ideally SSM Parameter Store) values at container start, before any application code or auto-instrumentation runs. For example:

# Pseudocode 
environment_variables = {                                                                                                                                                                     
   "MY_API_KEY": {"secret_arn": "arn:aws:secretsmanager:us-east-1:123456789:secret:my-key"},                                                                                                 
   "SOME_CONFIG": "plaintext-value",  # existing behavior preserved                                                                                                                          }              

This would:

  • Keep secrets out of Terraform state and API responses
  • Ensure secrets are available as env vars before any process (including auto-instrumentation) starts
  • Align with the ECS valueFrom pattern that AWS users are already familiar with

贡献指南

打开贡献指南

从这里开始

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

调研方向

未指定实现文件或测试。首先定位 AgentCore Agent Runtime 的 environment_variables schema 和相关测试,然后将提议的 secret_arn 形状与 ECS valueFrom 模式进行比较;完成的标准是纯文本值仍然有效,并且受支持的 Secrets Manager 或 SSM 引用会在容器启动前解析,同时不会暴露 secret 值。

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

评估

技术栈
aws, python
领域
cloud, security
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

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