Skip to content

Commit 61024d3

Browse files
committed
feat(import): capture encryptionKeyArn during memory import
Add encryptionKeyArn to CLI schema, MemoryDetail, and toMemorySpec so imported memories preserve their KMS encryption key configuration. Also update CDK L3 construct to pass encryptionKeyArn through to CfnMemory.
1 parent e159158 commit 61024d3

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/cli/aws/agentcore-control.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export interface MemoryDetail {
260260
reflectionNamespaces?: string[];
261261
}[];
262262
tags?: Record<string, string>;
263+
encryptionKeyArn?: string;
263264
}
264265

265266
/**
@@ -314,6 +315,7 @@ export async function getMemoryDetail(options: GetMemoryOptions): Promise<Memory
314315
description: memory.description,
315316
eventExpiryDuration: memory.eventExpiryDuration,
316317
tags,
318+
encryptionKeyArn: memory.encryptionKeyArn,
317319
strategies: (memory.strategies ?? []).map(s => {
318320
if (!s.type) {
319321
throw new Error(`Memory ${options.memoryId} has a strategy with missing required field: type`);

src/cli/commands/import/import-memory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function toMemorySpec(memory: MemoryDetail, localName: string): Memory {
6767
eventExpiryDuration: Math.max(7, Math.min(365, memory.eventExpiryDuration)),
6868
strategies,
6969
...(memory.tags && Object.keys(memory.tags).length > 0 && { tags: memory.tags }),
70+
...(memory.encryptionKeyArn && { encryptionKeyArn: memory.encryptionKeyArn }),
7071
};
7172
}
7273

src/schema/schemas/agentcore-project.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const MemorySchema = z.object({
103103
)
104104
),
105105
tags: TagsSchema.optional(),
106+
encryptionKeyArn: z.string().optional(),
106107
});
107108

108109
export type Memory = z.infer<typeof MemorySchema>;

0 commit comments

Comments
 (0)