Skip to content

feat(bedrockagentcore): graduate Policy submodule to stable - #38687

Draft
alvazjor wants to merge 4 commits into
mainfrom
feat/agentcore-graduate-policy
Draft

feat(bedrockagentcore): graduate Policy submodule to stable#38687
alvazjor wants to merge 4 commits into
mainfrom
feat/agentcore-graduate-policy

Conversation

@alvazjor

Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #37219.

Reason for this change

The AgentCore Policy submodule (PolicyEngine, Policy, PolicyStatement) is only available in the alpha module @aws-cdk/aws-bedrock-agentcore-alpha. This graduates it to the stable aws-cdk-lib/aws-bedrockagentcore module so it can be used without depending on an alpha package.

Description of changes

  • Move the Policy submodule (PolicyEngine, Policy, PolicyStatement, and their supporting base classes, types, and permission helpers) into aws-cdk-lib/aws-bedrockagentcore and export it from the module entry point.
  • Add the Gateway policy-engine association: Gateway.policyEngineConfiguration, the GatewayPolicyEngineConfig interface, and the PolicyEngineMode enum-like class, wired into the underlying Gateway resource. The gateway role is automatically granted evaluate permissions on the associated policy engine.
  • Scope the service principal used as the grantPrincipal of PolicyEngine and Policy with aws:SourceArn and aws:SourceAccount conditions for cross-service confused deputy prevention.
  • Add README documentation for the Policy Engine constructs.

Describe any new or updated permissions being added

  • grantEvaluateForGateway grants bedrock-agentcore:GetPolicyEngine (scoped to the policy engine ARN) and bedrock-agentcore:AuthorizeAction / bedrock-agentcore:PartiallyAuthorizeActions (scoped to the policy engine and gateway ARNs).
  • grantEvaluate and grantRead on PolicyEngine, and grantRead on Policy, grant the corresponding data-plane read/evaluate actions scoped to the specific resource ARN.
  • The service principal used as the grantPrincipal for PolicyEngine and Policy is scoped with aws:SourceArn and aws:SourceAccount conditions.

Description of how you validated changes

  • Added unit tests for the PolicyEngine and Policy constructs, including tests asserting the confused deputy conditions render in the synthesized template.
  • Added integration tests that create a PolicyEngine and Policy resources; the integration tests deploy successfully.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@alvazjor
alvazjor deployed to automation August 27, 2026 22:07 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 27, 2026 22:07 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 27, 2026 22:07 — with GitHub Actions Active
@mergify mergify Bot added the contribution/core This is a PR that came from AWS. label Aug 27, 2026
@mergify
mergify Bot deployed to automation August 27, 2026 22:08 Active
@github-actions github-actions Bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Aug 27, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team August 27, 2026 22:08
@mergify
mergify Bot deployed to automation August 27, 2026 22:08 Active
@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Aug 27, 2026
Graduate the AgentCore Policy submodule (PolicyEngine, Policy,
PolicyStatement) from @aws-cdk/aws-bedrock-agentcore-alpha into the
stable aws-cdk-lib/aws-bedrockagentcore module. Policy was excluded from
the original graduation (#37876) due to a CFN NotStabilized issue on
AWS::BedrockAgentCore::Policy, now resolved.

Reuses the preserved graduation migration and restores the Gateway
policy-engine association that was stripped when Policy was pulled:

- lib/policy: PolicyEngine, Policy, PolicyStatement and supporting
  base/types/perms/validation-helpers, exported from the module index.
- lib/gateway/gateway.ts: re-add PolicyEngineMode, GatewayPolicyEngineConfig
  and Gateway.policyEngineConfiguration, wiring it into the L1 CfnGateway
  and granting the gateway role evaluate permissions on the engine.
- tests: policy unit tests and gateway policy-engine association tests.
- integ: policy and policy-auto-generated-name integ tests with snapshots.
- README: restore the Policy Engine section, the Gateway
  policyEngineConfiguration row, and the table-of-contents entries.

The only user-facing breaking change carried by this submodule is the
metric() signature (the positional dimensions parameter was removed,
consistent with the rest of the graduation). No Policy construct or
property was renamed.

Closes #37219
@alvazjor
alvazjor force-pushed the feat/agentcore-graduate-policy branch from 41d591b to 6d735c5 Compare August 28, 2026 16:07
@alvazjor
alvazjor deployed to automation August 28, 2026 16:07 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 28, 2026 16:07 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 28, 2026 16:13 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 28, 2026 16:14 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 28, 2026 16:14 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 28, 2026 16:15 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 29, 2026 12:17 — with GitHub Actions Active
@alvazjor
alvazjor deployed to automation August 29, 2026 12:18 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-bedrock-agentcore): Add L2 constructs for Policy and PolicyEngine with type-safe Cedar policy builder

2 participants