The Spring @ComponentScan annotation can receive a package and automatically scans all of the classes in the package for Spring-related configuration, resources, and beans. While this comes very handy during development, when classes are changing frequently, it forces the Spring framework to perform the notoriously heavy operation of discovering all of the necessary classes at is starts. Before deploying your application to AWS Lambda, you should consider switching from the @ComponentScan annotation to direct @Import of your classes.
Starting the SpringLambdaContainerHandler with the PetStoreAppConfig class above, allows Spring to introspect only the classes you declared in your @Import statement - which are also already loaded by the JVM - thus avoiding the heavy task of scanning an entire package.