[Feature Request] Support configuring a custom IAM permissions boundary for generated roles
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- aws, typescript
- 領域
- cloud, infrastructure
調査の方向性
まず、agentcore deploy で使用される CLI テンプレートと cdk/ のマテリアライズフローを通じて、生成された bin/cdk.ts エントリポイントを追跡します。harness ロールと runtime ロールがどのように合成されるかを確認し、設定された boundary が生成されたロールまたは L3 で作成されたすべてのロールに適用されること、デフォルトでは存在しないこと、再生成とデプロイ後も維持されることを検証します。
索引モデルが issue の本文から書いたものです。
説明
Description
Please add first-class support for attaching a custom IAM permissions boundary to every IAM role that AgentCore generates during agentcore deploy.
Many enterprise and partner AWS accounts enforce an organization-managed permissions boundary on all IAM principals. A common form of this guardrail is an explicit Deny on iam:CreateRole unless the new role attaches a specific policy as its own permissions boundary.
In such accounts, agentcore deploy fails at role creation. Example error when deploying a project with a single harness:
User: arn:aws:sts::<acct>:assumed-role/cdk-hnb659fds-cfn-exec-role-<acct>-<region>/AWSCloudFormation
is not authorized to perform: iam:CreateRole
on resource: arn:aws:iam::<acct>:role/<project>_<harness>
with an explicit deny in a permissions boundary: arn:aws:iam::<acct>:policy/<OrgBoundaryPolicy>
(Status Code: 403; HandlerErrorCode: UnauthorizedTaggingOperation)
The generated roles have no PermissionsBoundary property, so CloudFormation's iam:CreateRole call is denied and the whole stack rolls back. There is currently no supported configuration (CLI flag, aws-targets.json field, env var, or agentcore.json field) to inject a boundary.
I confirmed the root cause is the "must attach boundary on create" rule (creating a probe role with the boundary succeeds; without it 403s). I patched the generated bin/cdk.ts to apply an App-wide boundary via the CDK IAM aspect:
import * as iam from 'aws-cdk-lib/aws-iam';
iam.PermissionsBoundary.of(app).apply(
iam.ManagedPolicy.fromManagedPolicyArn(
app,
'OrgPermissionsBoundary',
'arn:aws:iam::<acct>:policy/<OrgBoundaryPolicy>'
)
);
This makes the deploy succeed (stack reaches CREATE_COMPLETE), but it is not viable long-term because agentcore deploy re-materializes the cdk/ directory from CLI templates and overwrites the patch. I must deploy via raw cdk deploy instead, which leaves AgentCore's local state (.cli/deployed-state.json) out of sync.
Acceptance Criteria
- When configured, every generated IAM role (harness/runtime execution roles, and any L3-created roles) is synthesized with the specified
PermissionsBoundary. - Works through the standard
agentcore deployflow with no manual edits to generatedcdk/files. - Survives
cdk/regeneration/materialization. - No boundary is applied when the setting is absent (backward compatible).
Additional Context
@aws/agentcoreCLI:0.28.1- CDK (bundled):
2.1126.0 - Node.js:
22.x - Deploy target: single-harness project,
PYTHONruntime, region<region>
- 主要言語
- 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 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
aws/agentcore-cli#2392 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws/agentcore-cli#2267 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/agentcore-cli#2258 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/agentcore-cli#2176 ·
aws/agentcore-cli の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
motiondivision/motion#3849 ·
-
Add: S Play Event HD オープンcheck:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
i-am-bee/beeai-framework#1697 · リアクション 1 件 ·
-
Support bun dedupe オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
antfu/node-modules-inspector#214 ·