Repository navigation
Conversation
d6dad35 to
a5adc86
Compare
| return undefined; | ||
| } | ||
| // Strict so a misspelled optional key, such as s3BucketOwner, fails instead of dropping the check. | ||
| export const S3BucketMountConfigSchema = z.strictObject({ |
There was a problem hiding this comment.
This copies the L3 bucket and prefix grammar (about 110 lines, same regexes and limits), and L3 runs the same check at synth, before CloudFormation starts. EFS and S3 Files only mirror the ARN pattern and mount path here, so this is the one type where the two copies are likely to drift when the service adds a placeholder or character. Could the CLI keep a lighter check (bucket and mountPath shape, the V2 rule) and leave the full grammar to L3? Also, the comment above says this avoids a failure partway through a deploy; L3 already fails at synth, so the CLI copy only moves the error to add and validate.
| * anything is created. Entries that aren't S3 bucket mounts are ignored; schema validation reports bad ones. | ||
| */ | ||
| export function s3BucketMountNotes( | ||
| filesystemConfigurations: unknown, |
There was a problem hiding this comment.
We don't print deploy notes for other filesystem configurations. Please remove this.
| "Must be a path under /mnt with exactly one subdirectory (e.g. /mnt/bucket)", | ||
| ) | ||
| // "/mnt/." is /mnt itself, which would hide every other mount, and "/mnt/.." is the root. | ||
| .refine( |
There was a problem hiding this comment.
Same as on L3: the existing types' mountPath schemas still accept /mnt/. and /mnt/... Either share one mountPath schema across all filesystem types or drop this check so the types stay consistent.
|
|
||
| More: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-v2-optimize.html | ||
|
|
||
| ### S3 bucket mounts |
There was a problem hiding this comment.
No other filesystem type has a README section. Please remove this for now.
| code to work that is the same for every request, and create random values | ||
| (`secrets` or `os.urandom()`), timestamps, and credentials inside the | ||
| request handler. | ||
| - Under an `s3BucketMount` path, write whole files and close them. Keep git |
There was a problem hiding this comment.
Remove this. We don't follow this for other filesystem configurations.
| {{#if sessionStorageMountPath}}- {{sessionStorageMountPath}}: ephemeral session storage (lost when session ends) | ||
| {{/if}}{{#each efsMounts}}- {{mountPath}}: EFS persistent storage (persists across sessions and agent restarts) | ||
| {{/each}}{{#each s3Mounts}}- {{mountPath}}: S3 Files persistent storage (durable, backed by S3) | ||
| {{/each}}{{#each s3BucketMounts}}- {{mountPath}}: S3 bucket mount (durable; read-only unless the runtime was granted write access; a file is saved to S3 when it is closed; write whole files, as appending, renaming and editing in place are not supported) |
There was a problem hiding this comment.
The other mount types get one short clause each in this prompt. I'd keep the Mountpoint semantics (write whole files) and drop "read-only unless the runtime was granted write access". The mount should be read-write by default (see aws/agentcore-l3-cdk-constructs#480), and it's IAM guidance the model can't act on.
| code to work that is the same for every request, and create random values | ||
| (`/dev/urandom`, not the `crypto` module), timestamps, and credentials | ||
| inside the request handler. | ||
| - Under an `s3BucketMount` path, write whole files and close them. Keep git |
|
|
||
| More: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-v2-optimize.html | ||
|
|
||
| ### S3 bucket mounts |
There was a problem hiding this comment.
Please remove as we don't do this for other file systems.
| }); | ||
| }); | ||
|
|
||
| test("an S3 bucket mount prints what deploy grants and how to add write access", async () => { |
There was a problem hiding this comment.
Please ask your agent to perform a golden test here. Instead of stubbing it.
| flag( | ||
| "filesystem-configurations", | ||
| "filesystem mount configurations (JSON)", | ||
| "filesystem mount configurations (JSON); an s3BucketMount needs --platform-version V2 and gets read-only S3 access", |
There was a problem hiding this comment.
Please drop "gets read-only S3 access". The mount should be read-write by default (see aws/agentcore-l3-cdk-constructs#480), and no other filesystem type puts its permissions in this help text.
a5adc86 to
48273c4
Compare
jariy17
left a comment
There was a problem hiding this comment.
The changes look good. We can't launch this until CloudFormation supports S3BucketMount in all regions, so please don't merge until then.
Description
Adds
s3BucketMount(Mountpoint for Amazon S3) as afilesystemConfigurationsentry for runtimes, inagentcore.jsonand inagentcore add runtime --filesystem-configurations. Fields:bucketandmountPath(required),prefix,s3BucketOwnerands3BucketRegion(optional).Design decisions:
platformVersion: "V2"rather than relying on the service default. The--filesystem-configurationshelp says so.mountPathpattern, owner and Region formats). The CDK app and the service check the bucket and prefix rules. The object is strict, so a misspelleds3BucketOwnerfails instead of being dropped.agentcore deploycreates gets read-write access scoped to the bucket and prefix, from aws/agentcore-l3-cdk-constructs#480.Depends on aws/agentcore-l3-cdk-constructs#480. Deploying needs an
@aws/agentcore-cdkrelease that supportss3BucketMount, and a bump of the pin insrc/assets/cdk/package.json. The current pin (1.2.0) rejects the entry at synth, so this should merge with or after that bump.Related Issue
Closes #2898
Documentation PR
Not applicable.
Type of Change
Testing
How have you tested the change?
bun test(one failure,CodeZipDevRunner > starts tsx directly when Node dependencies exist, fails the same way onfeat/snapshotwithout this change)bun run test:e2e, or explained why they are not applicable(CI does not run them for you): not run yet; deploying needs the
@aws/agentcore-cdkrelease above. Planned for the bug bash.bun run typecheckbun run lint:checkbun run format:checkbun run auditbun run secrets:checkbun run buildsrc/assets/, I updated affected snapshots withbun test <test-file> --update-snapshotsand committed them (adds a golden snapshot,src/handlers/project/add/runtime/__snapshots__/index.test.ts.snap)by this PR (none re-recorded)
command.md(the release workflow regenerates it)Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.