In case you use CI/CD pipeline to deploy your lambda Api you might wonder how you could validate serverless.yml file format before you go through all the steps of your pipeline and suddnely face a very small formatting issue in your yml file.

I assume you are using serverless and one of the easiest way is using the following command:

sls deploy --noDeploy --stage dev --region ap-southeast-2  

you pass the required variables to the sls deploy --noDeploy command and if the format of your serverless.yml file is acceptable and correct you will get back a package which can be potentially deploy to the s3 bucket containing all your files and modules.