Skip to content

Repository files navigation

Simplify Framework - Converter

NPM DownloadsPackage Version

This is a facility toolkit to support converting from Serverless framework's YAML definition to OpenAPI 3.0 specs that compatible with Simplify specs definition.

Node.js-based command line toolkit requires node >= 8.x version or later.

npm install -g simplify-converter
simplify-converter -i serverless.yaml -o .

Serverless Framework example: serverless.yaml

# For full config options, check the docs:# docs.serverless.com# https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/## Happy Coding!service: pets-service# You can pin your service to only deploy with a specific Serverless version# Check out our docs for more details# frameworkVersion: "=X.X.X"provider:
name: awsruntime: nodejs12.xiamRoleStatements:
- Effect: 'Allow'Action:
- 's3:ListBucket'Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- Ref: SharedFileResourcesBucket
- Effect: 'Allow'Action:
- 's3:PutObject'Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- Ref: SharedFileResourcesBucket
- '/*'functions:
get-pets-list:
handler: src/handlers/index.handlerevents:
- http:
method: getpath: petsdescription: Retrieve list of pets.
- schedule: rate(2 hours)
- cloudwatchLog: '/aws/lambda/hello'
- sns:
arn: arn:aws:sns:${self:provider.region}:${self:provider.accountId, '01234567890'}:topicnametopicName: topicname-${self:provider.accountId, '01234567890'}-${self:provider.region}plugins:
- serverless-webpack
- serverless-plugin-log-retentionresources:
Resources:
SharedFileResourcesBucket:
Type: AWS::S3::BucketProperties:
BucketName: ${self:service}-bucketCorsConfiguration:
CorsRules:
- AllowedMethods:
- GET
- POSTAllowedOrigins:
- "*"

Resource dependancy will be generated into one CloudFormation YAML stack and be able to manage it independently.

HOW TO: Deploy external resources

Simplify Converter generates a set of managed stacks including Simplify SDK script to be able to run by npm commands:

cd resources
npm install
npm run stack-deploy
...
npm run stack-destroy

Your AWS Credentials must be configured manually to have permission for deploying external resources.

Simplify Framework @Copyright 2020

About

Convert from Serverless Framework's YAML definition to OpenAPI 3.0 specs that is compatible with Simplify Framework specs definition.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages