Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature Request] Support configuring a custom IAM permissions boundary for generated roles

Aperta
#2,246 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
aws, typescript

Direzione di ricerca

Inizia tracciando l'entry point generato bin/cdk.ts attraverso il template della CLI e il flusso di materializzazione di cdk/ utilizzato da agentcore deploy. Verifica come vengono sintetizzati i ruoli di harness e runtime, quindi verifica che un boundary configurato raggiunga ogni ruolo generato o creato da L3, che sia assente per impostazione predefinita e che sopravviva alla rigenerazione e al deployment.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
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 deploy flow with no manual edits to generated cdk/ files.
  • Survives cdk/ regeneration/materialization.
  • No boundary is applied when the setting is absent (backward compatible).
Additional Context
  • @aws/agentcore CLI: 0.28.1
  • CDK (bundled): 2.1126.0
  • Node.js: 22.x
  • Deploy target: single-harness project, PYTHON runtime, region <region>
Lingua principale
TypeScript
Stelle
291
Fork
96
Merge medio
20h 50m
PR unite (30g)
214

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/agentcore-cli

Tutte le issue di aws/agentcore-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.