Skip to content

Presigned URL の発行時のエラー解消#1564

Open
Cen4Soca wants to merge 18 commits into
aws-samples:mainfrom
Cen4Soca:main
Open

Presigned URL の発行時のエラー解消#1564
Cen4Soca wants to merge 18 commits into
aws-samples:mainfrom
Cen4Soca:main

Conversation

@Cen4Soca
Copy link
Copy Markdown

@Cen4Soca Cen4Soca commented May 9, 2026

Description of Changes

素敵なOSSをありがとうございます。日々、活用させていただいております。
PRの発行は初めてのため、不備があればご指摘頂けますと幸いです。
GenU と SDPM (Spec-Driven Presentation Maker) を組み合わせて利用することを想定しています。

当PRの内容は大きく下記2点になります。

PR #1526 (comment) を個人のリポジトリにフォークして、コンフリクト解消した上で動作確認したところ、Agent Builder で SDPM を用いてファイル出力した際に Presigned URL の発行でエラーとなりました。
upload_file_to_s3_and_retrieve_s3_url で取得した S3 URL から Presigned URL を生成する際、Lambda 関数自体がそのS3バケットへのアクセス権限を必要としますが、現在の実装では API Lambda は Agent Core のS3バケットへのアクセス権限を持っておらず、Agent CoreのS3バケットに対して Presigned URL を生成できません。"api.ts" を変更して Lambda に Agent Core S3 バケット (additionalS3Buckets) への read 権限を追加しました。

Summary

  • API Lambda が Agent Core の S3 バケットに対して Presigned URL を生成する際、Lambda 自身がそのバケットへの s3:GetObject 権限を持つ必要がある
  • additionalS3Buckets として渡される Agent Core の file bucket に対して、grantRead で読み取り権限を付与
  • これにより、API Lambda が Agent Core S3 バケット内のファイルに対して有効な Presigned URL を生成できるようになる

Checklist

  • Modified relevant documentation
  • Verified operation in local environment
  • Executed npm run cdk:test and if there are snapshot differences, execute npm run cdk:test:update-snapshot to update snapshots

Related PR

#1526 (comment)

Shintaro Okamoto and others added 18 commits April 9, 2026 22:52
The UI's LinkRenderer detects S3 URLs in Markdown links and converts
them to presigned URLs for download. Without Markdown link format,
S3 URLs for non-image files (e.g. .pptx) are rendered as plain text
and cannot be downloaded.
- Revert cdk.json formatting noise and createGenericAgentCoreRuntime
  back to false (default)
- Add agentCoreCodeInterpreterEnabled to correct location (default false)
- Add agentCoreCodeInterpreterEnabled to English DEPLOY_OPTION.md
- Remove sdpm-specific example from Japanese DEPLOY_OPTION.md
- Update CDK test snapshots
Adds a write_file tool that allows agents to create and append to files
under /tmp/ws without requiring Code Interpreter. This enables MCP tools
that expect file paths (e.g. generate_pptx with slides_json_path) to
work without the Code Interpreter sandbox isolation issue.

Path traversal is prevented by requiring all paths to be under WORKSPACE_DIR.
Allows agents to fetch text content from URLs. HTML is automatically
stripped of scripts/styles/tags for readability. Useful for reading
documentation, reference materials, or API responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant