@@ -8,11 +8,13 @@ import { AppConfigProvider } from '@aws-lambda-powertools/parameters/appconfig';
8
8
import { DynamoDBProvider } from '@aws-lambda-powertools/parameters/dynamodb' ;
9
9
import { SecretsProvider } from '@aws-lambda-powertools/parameters/secrets' ;
10
10
import { SSMProvider } from '@aws-lambda-powertools/parameters/ssm' ;
11
+ import { CloudFormationCustomResourceCreateSchema } from '@aws-lambda-powertools/parser/schemas' ;
11
12
import { Tracer } from '@aws-lambda-powertools/tracer' ;
12
13
import { AppConfigDataClient } from '@aws-sdk/client-appconfigdata' ;
13
14
import { DynamoDBClient } from '@aws-sdk/client-dynamodb' ;
14
15
import { SecretsManagerClient } from '@aws-sdk/client-secrets-manager' ;
15
16
import { SSMClient } from '@aws-sdk/client-ssm' ;
17
+ import type { CloudFormationCustomResourceCreateEvent } from 'aws-lambda' ;
16
18
17
19
const logger = new Logger ( {
18
20
logLevel : 'DEBUG' ,
@@ -79,7 +81,9 @@ const getVersionFromModule = async (moduleName: string): Promise<string> => {
79
81
return moduleVersion ;
80
82
} ;
81
83
82
- export const handler = async ( ) : Promise < void > => {
84
+ export const handler = async (
85
+ event : CloudFormationCustomResourceCreateEvent
86
+ ) : Promise < void > => {
83
87
// Check that the packages version matches the expected one
84
88
for ( const moduleName of [
85
89
'commons' ,
@@ -89,6 +93,7 @@ export const handler = async (): Promise<void> => {
89
93
'parameters' ,
90
94
'idempotency' ,
91
95
'batch' ,
96
+ 'parser' ,
92
97
] ) {
93
98
const moduleVersion = await getVersionFromModule ( moduleName ) ;
94
99
if ( moduleVersion !== expectedVersion ) {
@@ -115,4 +120,7 @@ export const handler = async (): Promise<void> => {
115
120
// the presence of a log will indicate that the logger is working
116
121
// while the content of the log will indicate that the tracer is working
117
122
logger . debug ( 'subsegment' , { subsegment : subsegment . format ( ) } ) ;
123
+
124
+ // Check that the parser is working
125
+ CloudFormationCustomResourceCreateSchema . parse ( event ) ;
118
126
} ;
0 commit comments