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

Đã đóng Phù hợp với người mới
#955 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@proton0210 đang làm issue này rồi.

Từ ngày 18/10/2026.

  • #960 của @proton0210 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
aws, typescript
Lĩnh vực
infrastructure

Hướng nghiên cứu

Bắt đầu từ cdk/src/constructs/lambda-microvm-compute.ts, nơi quyền inference-profile đang gán cứng tiền tố us. trong resourceName. So sánh với cdk/src/constructs/ecs-agent-cluster.ts, file này lấy geo từ resolveBedrockGeoRegion, rồi chuyển quyền sang inferenceProfileId(geo, modelId). Thêm một test.each cho 'global' và 'eu', theo mẫu cdk/test/constructs/ecs-agent-cluster.test.ts. Hoàn thành khi synth global cấp quyền inference-profile/global.* mà không có ARN us.*, và đầu ra mặc định cho us không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

infra-cdk P1

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.
Ngôn ngữ chính
TypeScript
Star
170
Fork
52
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws-samples/sample-autonomous-cloud-coding-agents

Tất cả issue của aws-samples/sample-autonomous-cloud-coding-agents

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.