-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(lambda): add toString to lambda architecture (#26145)
Add toString to Lambda Architecture property When throwing errors during synthesis, you can't see the architecture chosen for a lambda. Adding this toString method solves that Closes #26117 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
669dd7f
commit 3b9c983
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
import { App, Stack } from '../../core'; | ||
import * as lambda from '../lib'; | ||
|
||
describe('architecture', () => { | ||
const app = new App(); | ||
const stack = new Stack(app, 'stack'); | ||
|
||
test('toString to return the architecture name', () => { | ||
// GIVEN | ||
const testLambda = new lambda.Function(stack, 'testLambda', { | ||
code: new lambda.InlineCode('foo'), | ||
handler: 'index.handler', | ||
runtime: lambda.Runtime.NODEJS_14_X, | ||
}, | ||
); | ||
|
||
// THEN | ||
expect(`${testLambda.architecture}`).toEqual(testLambda.architecture.name); | ||
}); | ||
}); |