feat(evaluator): add kmsKeyArn support for custom evaluator#994
feat(evaluator): add kmsKeyArn support for custom evaluator#994aws-aditya21 wants to merge 1 commit intomainfrom
Conversation
Coverage Report
|
ba4c55c to
fe5cd4b
Compare
|
Field naming inconsistency: Other primitives in both Additionally, CFN uses Options:
Please confirm the field name with the companion CDK PR before merging, since whatever is in |
|
Unsafe cast in
kmsKeyArn: (response as unknown as Record<string, unknown>).kmsKeyArn as string | undefined,This double-cast bypasses TypeScript's checking of the SDK response type. Compare with how Given that CFN exposes this as Options:
Either way, please verify by inspecting the actual |
|
KMS key ARN validation regex is too restrictive The regex used in both will reject several valid KMS key ARN formats:
Additionally, duplicating the same regex in two places risks them drifting; consider extracting to a shared helper (e.g. Options:
|
|
|
Reviewed the PR. The three existing automation comments (field naming |
Description
Add optional
kmsKeyArnsupport for custom evaluators, enabling customers to specify a KMS key for evaluator encryption at rest.Changes (9 files)
src/schema/schemas/agentcore-project.ts— addedkmsKeyArntoEvaluatorSchemasrc/cli/primitives/EvaluatorPrimitive.ts— added--kms-key-arnCLI flag, updated options, action handler, andcreateEvaluatorsrc/cli/tui/screens/evaluator/types.ts— addedkms-key-arnstep andkmsKeyArntoAddEvaluatorConfigsrc/cli/tui/screens/evaluator/useAddEvaluatorWizard.ts— added KMS state, callback, wired into all wizard flowssrc/cli/tui/screens/evaluator/AddEvaluatorScreen.tsx— added KMS key ARN text input and confirm fieldsrc/cli/tui/hooks/useCreateEvaluator.ts— passeskmsKeyArnthrough to primitivesrc/cli/commands/import/import-evaluator.ts—toEvaluatorSpecforwardskmsKeyArnfrom API responsesrc/cli/aws/agentcore-control.ts— addedkmsKeyArntoGetEvaluatorResultsrc/cli/commands/import/__tests__/import-evaluator.test.ts— added tests forkmsKeyArnforwardingCompanion PR
CDK constructs: https://github.com/aws/agentcore-l3-cdk-constructs/pull/184
CFN support for
EncryptionKeyArnonAWS::BedrockAgentCore::Evaluatoris assumed ready per service team confirmation.Closes #
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.