Skip to content

Commit 9aff173

Browse files
author
Dane Pilcher
committed
Merge branch 'main' into apiid-resolver
2 parents 9ad666c + cfdc854 commit 9aff173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+857
-70
lines changed

.changeset/fair-ghosts-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/backend-deployer': patch
3+
---
4+
5+
handle cdk error mapping for more generic invalid credentials

.changeset/five-comics-beg.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/platform-core': patch
3+
---
4+
5+
return amplify user error as it is from `AmplifyError.fromError`

.changeset/forty-bulldogs-end.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@aws-amplify/backend-function': minor
3+
'@aws-amplify/backend': minor
4+
---
5+
6+
Add support to `@aws-amplify/backend-function` for Node 22
7+
8+
Add support to `@aws-amplify/backend-function` for Node 22, which is a [supported Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels) that was added in [`aws-cdk-lib/aws-lambda` version `2.168.0`](https://github.com/aws/aws-cdk/releases/tag/v2.168.0) on November 20th, 2024

.changeset/new-rings-suffer.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@aws-amplify/backend-platform-test-stubs': patch
3+
'@aws-amplify/backend-output-storage': patch
4+
'@aws-amplify/integration-tests': patch
5+
'@aws-amplify/backend-deployer': patch
6+
'@aws-amplify/backend-function': patch
7+
'@aws-amplify/schema-generator': patch
8+
'@aws-amplify/backend-storage': patch
9+
'@aws-amplify/auth-construct': patch
10+
'@aws-amplify/ai-constructs': patch
11+
'@aws-amplify/client-config': patch
12+
'@aws-amplify/backend-auth': patch
13+
'@aws-amplify/backend-data': patch
14+
'@aws-amplify/plugin-types': patch
15+
'@aws-amplify/backend-ai': patch
16+
'@aws-amplify/backend': patch
17+
'@aws-amplify/sandbox': patch
18+
---
19+
20+
update aws-cdk lib to ^2.168.0

.changeset/poor-moons-refuse.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@aws-amplify/ai-constructs': minor
3+
'@aws-amplify/backend-ai': minor
4+
'@aws-amplify/backend-function': minor
5+
'@aws-amplify/backend': minor
6+
'@aws-amplify/platform-core': minor
7+
---
8+
9+
Add options to control log settings

.changeset/poor-phones-attend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/backend-deployer': patch
3+
---
4+
5+
extract generic cdk asset publish failures

package-lock.json

Lines changed: 39 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ai-constructs/API.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
/// <reference types="node" />
88

99
import { AIConversationOutput } from '@aws-amplify/backend-output-schemas';
10+
import { ApplicationLogLevel } from 'aws-cdk-lib/aws-lambda';
1011
import { BackendOutputStorageStrategy } from '@aws-amplify/plugin-types';
1112
import * as bedrock from '@aws-sdk/client-bedrock-runtime';
1213
import { Construct } from 'constructs';
1314
import { FunctionResources } from '@aws-amplify/plugin-types';
1415
import * as jsonSchemaToTypeScript from 'json-schema-to-ts';
1516
import { ResourceProvider } from '@aws-amplify/plugin-types';
17+
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
1618

1719
declare namespace __export__conversation {
1820
export {
@@ -55,6 +57,10 @@ type ConversationHandlerFunctionProps = {
5557
region?: string;
5658
}>;
5759
memoryMB?: number;
60+
logging?: {
61+
level?: ApplicationLogLevel;
62+
retention?: RetentionDays;
63+
};
5864
outputStorageStrategy?: BackendOutputStorageStrategy<AIConversationOutput>;
5965
};
6066

packages/ai-constructs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"typescript": "^5.0.0"
3939
},
4040
"peerDependencies": {
41-
"aws-cdk-lib": "^2.158.0",
41+
"aws-cdk-lib": "^2.168.0",
4242
"constructs": "^10.0.0"
4343
}
4444
}

packages/ai-constructs/src/conversation/conversation_handler_construct.test.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { ConversationHandlerFunction } from './conversation_handler_construct';
55
import { Template } from 'aws-cdk-lib/assertions';
66
import path from 'path';
77
import { StackMetadataBackendOutputStorageStrategy } from '@aws-amplify/backend-output-storage';
8+
import { ApplicationLogLevel } from 'aws-cdk-lib/aws-lambda';
9+
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
810

911
void describe('Conversation Handler Function construct', () => {
1012
void it('creates handler with log group with JWT token redacting policy', () => {
@@ -284,4 +286,41 @@ void describe('Conversation Handler Function construct', () => {
284286
}, new Error('memoryMB must be a whole number between 128 and 10240 inclusive'));
285287
});
286288
});
289+
290+
void describe('logging options', () => {
291+
void it('sets log level', () => {
292+
const app = new App();
293+
const stack = new Stack(app);
294+
new ConversationHandlerFunction(stack, 'conversationHandler', {
295+
models: [],
296+
logging: {
297+
level: ApplicationLogLevel.DEBUG,
298+
},
299+
});
300+
const template = Template.fromStack(stack);
301+
302+
template.hasResourceProperties('AWS::Lambda::Function', {
303+
LoggingConfig: {
304+
ApplicationLogLevel: 'DEBUG',
305+
LogFormat: 'JSON',
306+
},
307+
});
308+
});
309+
310+
void it('sets log retention', () => {
311+
const app = new App();
312+
const stack = new Stack(app);
313+
new ConversationHandlerFunction(stack, 'conversationHandler', {
314+
models: [],
315+
logging: {
316+
retention: RetentionDays.ONE_YEAR,
317+
},
318+
});
319+
const template = Template.fromStack(stack);
320+
321+
template.hasResourceProperties('AWS::Logs::LogGroup', {
322+
RetentionInDays: 365,
323+
});
324+
});
325+
});
287326
});

0 commit comments

Comments
 (0)