Simple convertor from serverless.yml to serverless.ts
service:
name: example-project
frameworkVersion: '>=1.72.0'
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
plugins:
- serverless-webpack
provider:
name: aws
runtime: nodejs12.x
apiGateway:
minimumCompressionSize: 1024
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
functions:
hello:
handler: handler.hello
events:
- http:
method: get
path: hello
import { Serverless } from 'serverless/aws';
export const service: Serverless = {
"service": {
"name": "example-project"
},
"frameworkVersion": ">=1.72.0",
"custom": {
"webpack": {
"webpackConfig": "./webpack.config.js",
"includeModules": true
}
},
"plugins": [
"serverless-webpack"
],
"provider": {
"name": "aws",
"runtime": "nodejs12.x",
"apiGateway": {
"minimumCompressionSize": 1024
},
"environment": {
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": 1
}
},
"functions": {
"hello": {
"handler": "handler.hello",
"events": [
{
"http": {
"method": "get",
"path": "hello"
}
}
]
}
}
}
module.exports = service
$ npm install -g serverless-yaml2ts
$ sls-yaml2ts COMMAND
running command...
$ sls-yaml2ts (-v|--version|version)
serverless-yaml2ts/0.0.3 darwin-x64 node-v12.9.1
$ sls-yaml2ts --help [COMMAND]
USAGE
$ sls-yaml2ts COMMAND
...