Skip to content

fix(cdk): lambda-microvm grants hardcode the us. inference-profile prefix instead of bedrockGeoRegion #955

Open

Description

@ayushtr-aws

Summary

cdk/src/constructs/lambda-microvm-compute.ts builds the Bedrock inference-profile grant ARN with a hardcoded prefix:

resource: 'inference-profile',
resourceName: `us.${modelId}`,

The AgentCore runtime (stacks/agent.ts) and ECS (constructs/ecs-agent-cluster.ts) derive the prefix from resolveBedrockGeoRegion and inject the same geo into ANTHROPIC_MODEL / ANTHROPIC_DEFAULT_HAIKU_MODEL. The Lambda MicroVM backend therefore grants us.* profiles while the agent is told to invoke <geo>.*.

Impact

Any bedrockGeoRegion other than us (the shipped cdk.json sets global) on the lambda-microvm backend fails every task at turn 0 with AccessDenied — the exact grant/env drift bedrock-model-constants.ts documents as the failure mode to avoid. Pre-existing; surfaced during review of #954.

Fix

  • Import resolveBedrockGeoRegion (or accept bedrockGeoRegion as a prop, matching ECS) and use inferenceProfileId(geo, modelId) for the ARN.
  • Add a test.each(['global', 'eu']) case mirroring cdk/test/constructs/ecs-agent-cluster.test.ts ("bedrockGeoRegion=%s injects both models…") that asserts the MicroVM role's inference-profile/<geo>.<model> ARNs and the absence of us. ones.

Acceptance

  • bedrockGeoRegion=global synth grants inference-profile/global.* on the MicroVM execution role and no us.*.
  • Existing us default unchanged.

Activity

  1. added
    infra-cdkCDK stacks/constructs, bootstrap, deploy topology, tags, IAM wiring, teardown
    P1medium priority
    on Oct 16, 2026
  2. proton0210 commented on Oct 18, 2026

    @proton0210

    I would like to take this on. The proposed scope is to resolve the configured Bedrock geo for the Lambda MicroVM execution-role grants using the shared inference-profile helper, preserve the us default, and add synthesis regressions for global and eu. I will complete three audit passes before submitting a focused PR. Per ADR-003, could a permitted maintainer apply the approved label? I will self-assign and start implementation after approval.

    Update: Draft implementation: PR #960. It includes the geo-aware grants and synthesis regressions described above. Maintainer approval for #955 remains pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1medium priorityinfra-cdkCDK stacks/constructs, bootstrap, deploy topology, tags, IAM wiring, teardown

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions