refactor(infra-cdk): migrate to L2 constructs, drop NestedStacks; fix Cedar policy + vite 8 build - #133
Merged
Merged
Conversation
… Cedar policy perms - Memory: CfnResource -> agentcore.Memory (L2) - Gateway: CfnGateway/CfnGatewayTarget -> agentcore.Gateway + addLambdaTarget (L2) - Move from @aws-cdk/aws-bedrock-agentcore-alpha to stable aws-cdk-lib/aws-bedrockagentcore - Cognito/Backend/AmplifyHosting NestedStacks -> Constructs - AgentName CfnParameter -> config.yaml (agent_name) - Add bedrock-agentcore:InvokeGateway to the Cedar policy Lambda role (required by AgentCore CreatePolicy validation; fixes pre-existing CREATE_FAILED) - Bump deps to latest (aws-cdk-lib 2.260.x); drop graduated/unused alpha packages Deployed and verified end-to-end on a test account (cdk deploy + deploy-frontend + cdk destroy).
Vite 8 (rolldown) rejects the object form of build.rollupOptions.output.manualChunks with "manualChunks is not a function". Convert to the function form, preserving the react/ui/auth vendor chunks. Bump vite to 8.1.0 and apply in-range dependency updates.
|
Latest scan for commit: Security Scan ResultsScan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies: Column Explanations: Severity Levels (S/C/H/M/L/I):
Other Columns:
Scanner Results:
Severity Thresholds (Thresh Column):
Threshold Source: Values in parentheses indicate where the threshold is configured:
Statistics calculation:
|
brianz
approved these changes
Jun 30, 2026
brianz
left a comment
Contributor
There was a problem hiding this comment.
I tested this on a fresh install, and it works as described. Clean backend and frontend deployments, and also verified the fixes which are present on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Recreates the intent of #6 on current main: migrate the CDK infra to L2 constructs
and replace NestedStacks with Constructs. Also fixes two pre-existing, unrelated
bugs that blocked a clean end-to-end deploy.
Infra (infra-cdk/)
CfnResource→agentcore.Memory(L2)CfnGateway/CfnGatewayTarget→agentcore.Gateway+addLambdaTarget()(L2)@aws-cdk/aws-bedrock-agentcore-alphato stableaws-cdk-lib/aws-bedrockagentcore(graduated in 2.260)CognitoStack/BackendStack/AmplifyHostingStack→ Constructs (no NestedStacks)AgentNameCfnParameter→config.yaml(agent_name, typed inAppConfig)Fixes (pre-existing, also broken on main)
bedrock-agentcore:InvokeGatewayto the policy Lambda role.AgentCore's
CreatePolicyvalidation now calls the gateway; without this the policygoes
CREATE_FAILED("Insufficient permissions to call gateway"). Confirmed via A/Btest that main fails identically. Ref: AgentCore policy-permissions docs (Troubleshooting).
vite.config.tsused the object form ofmanualChunks, which vite 8(rolldown) rejects with "manualChunks is not a function". Converted to the function form
(same react/ui/auth vendor chunks) and bumped vite to 8.1.0.
Testing
Verified end-to-end on a test account with the standard commands (no flags):
cdk deploy→CREATE_COMPLETE(incl. Cedar GatewayPolicy)python scripts/deploy-frontend.py→ AmplifySUCCEED, app loads + login workscdk destroy→ clean teardown, no orphaned policy enginestsc+jest+cdk synthgreen; frontendnpm run buildgreen