GithubHelp home page GithubHelp logo

medifle / serverless-manifest-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidwells/serverless-manifest-plugin

0.0 0.0 0.0 105 KB

Output manifest of endpoints, resources, outputs, etc. of a serverless service

Home Page: https://youtu.be/sq4rMN5fwUQ

License: MIT License

JavaScript 100.00%

serverless-manifest-plugin's Introduction

Serverless Manifest Plugin

Generate a list of API endpoints, function information & stack outputs to a service manifest file.

The manifest data can be quite useful for:

After serverless deploy finishes, a .serverless/manifest.json file, is created.

Usage

Add to plugins array in serverless.yml

service: my-example-service

plugins:
 - serverless-manifest-plugin

Then run serverless manifest --help to see all options.

Options

You can set options via CLI flags or via the custom field in serverless.yml

# Custom settings for manifest plugin
custom:
  manifest:
    # Custom manifest output path. Default ./.serverless/manifest.json
    output: ./serverless.manifest.json
    # set to true to disable manifest file from being created
    disableOutput: false
    # Path to custom file with JS function for additional post processing
    postProcess: ./my-file-to-process-manifest-data.js
    # Set plugin log output to silent. Default false
    silent: false

plugins:
 - serverless-manifest-plugin

Programatic usage

Using the json flag will pipe the service manifest to stdout. You can use this with a tool like jq to do something programatic with the data.

serverless manifest --json

Example:

serverless manifest --json | jq '.dev.functions'
# Outputs service function info

Generating a manifest file

The plugin will automatically create the manifest when you run serverless deploy

You can also manually generate the manifest at anytime with

serverless manifest

Example

Outputs urls, functions, outputs etc.

.serverless/manifest.json

{
  "dev": {
    "urls": {
      "apiGateway": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev",
      "apiGatewayBaseURL": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev",
      "httpApi": "https://qwertyxyz.execute-api.us-east-1.amazonaws.com",
      "httpApiBaseURL": "https://qwertyxyz.execute-api.us-east-1.amazonaws.com",
      "byPath": {
        "/user/profile": {
          "url": "https://qwertyxyz.execute-api.us-east-1.amazonaws.com/user/profile",
          "methods": [
            "POST",
            "GET"
          ]
        },
        "/tester": {
          "url": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev/tester",
          "methods": [
            "POST"
          ]
        },
        "/wow-cool": {
          "url": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev/wow-cool",
          "methods": [
            "POST"
          ]
        }
      },
      "byFunction": {
        "getProfileInfo": {
          "url": "https://qwertyxyz.execute-api.us-east-1.amazonaws.com/user/profile",
          "methods": [
            "GET"
          ]
        },
        "createProfileInfo": {
          "url": "https://qwertyxyz.execute-api.us-east-1.amazonaws.com/user/profile",
          "methods": [
            "POST"
          ]
        },
        "other": {
          "url": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev/tester",
          "methods": [
            "POST"
          ]
        },
        "forth": {
          "url": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev/wow-cool",
          "methods": [
            "POST"
          ]
        }
      },
      "byMethod": {
        "GET": [
          "https://qwertyxyz.execute-api.us-east-1.amazonaws.com/user/profile"
        ],
        "POST": [
          "https://qwertyxyz.execute-api.us-east-1.amazonaws.com/user/profile",
          "https://abc1234.execute-api.us-east-1.amazonaws.com/dev/tester",
          "https://abc1234.execute-api.us-east-1.amazonaws.com/dev/wow-cool"
        ]
      }
    },
    "functions": {
      "getProfileInfo": {
        "name": "http-api-node-dev-getProfileInfo",
        "arn": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-getProfileInfo:4",
        "runtime": "nodejs12.x",
        "triggers": [
          "httpApi"
        ],
        "dependancies": {
          "direct": [
            "faker@^4.1.0",
            "analytics@^0.3.4"
          ],
          "nested": [
            "analytics-utils@^0.2.0",
            "dlv@^1.1.3",
            "@analytics/storage-utils@^0.2.3",
            "@analytics/cookie-utils@^0.2.3"
          ]
        }
      },
      "createProfileInfo": {
        "name": "http-api-node-dev-createProfileInfo",
        "arn": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-createProfileInfo:4",
        "runtime": "nodejs12.x",
        "triggers": [
          "httpApi"
        ],
        "dependancies": {
          "direct": [
            "faker@^4.1.0",
            "analytics@^0.3.4"
          ],
          "nested": [
            "analytics-utils@^0.2.0",
            "dlv@^1.1.3",
            "@analytics/storage-utils@^0.2.3",
            "@analytics/cookie-utils@^0.2.3"
          ]
        }
      },
      "other": {
        "name": "http-api-node-dev-other",
        "arn": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-other:3",
        "runtime": "nodejs12.x",
        "triggers": [
          "http"
        ],
        "dependancies": {
          "direct": [
            "faker@^4.1.0"
          ],
          "nested": []
        }
      },
      "forth": {
        "name": "http-api-node-dev-forth",
        "arn": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-forth:2",
        "runtime": "nodejs12.x",
        "triggers": [
          "http"
        ],
        "dependancies": {
          "direct": [
            "[email protected]"
          ],
          "nested": []
        }
      }
    },
    "outputs": [
      {
        "OutputKey": "OtherLambdaFunctionQualifiedArn",
        "OutputValue": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-other:3",
        "Description": "Current Lambda function version"
      },
      {
        "OutputKey": "GetProfileInfoLambdaFunctionQualifiedArn",
        "OutputValue": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-getProfileInfo:4",
        "Description": "Current Lambda function version"
      },
      {
        "OutputKey": "ForthLambdaFunctionQualifiedArn",
        "OutputValue": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-forth:2",
        "Description": "Current Lambda function version"
      },
      {
        "OutputKey": "ServiceEndpoint",
        "OutputValue": "https://abc1234.execute-api.us-east-1.amazonaws.com/dev",
        "Description": "URL of the service endpoint"
      },
      {
        "OutputKey": "ServerlessDeploymentBucketName",
        "OutputValue": "http-api-node-dev-serverlessdeploymentbucket-12eu0mj9zoo0s"
      },
      {
        "OutputKey": "CreateProfileInfoLambdaFunctionQualifiedArn",
        "OutputValue": "arn:aws:lambda:us-east-1:xxxxxxxxxxxx:function:http-api-node-dev-createProfileInfo:4",
        "Description": "Current Lambda function version"
      },
      {
        "OutputKey": "HttpApiUrl",
        "OutputValue": "https://qwertyxyz.execute-api.us-east-1.amazonaws.com",
        "Description": "URL of the HTTP API"
      }
    ]
  }
}

serverless-manifest-plugin's People

Contributors

davidwells avatar dependabot[bot] avatar medifle avatar manchuck avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.