@serverless/enterprise-plugin
Advanced tools
Comparing version 0.1.4 to 0.2.0-2-ge229844
@@ -36,2 +36,4 @@ "use strict"; | ||
var _variables = require("./variables"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -113,5 +115,6 @@ | ||
enterprise: true | ||
} // Set Plugin hooks for all Enteprise Plugin features here | ||
} | ||
}; | ||
(0, _variables.hookIntoVariableGetter)(sls); // Set Plugin hooks for all Enteprise Plugin features here | ||
}; | ||
this.hooks = { | ||
@@ -118,0 +121,0 @@ 'before:package:createDeploymentArtifacts': this.route('before:package:createDeploymentArtifacts').bind(this), |
@@ -26,3 +26,3 @@ "use strict"; | ||
regeneratorRuntime.mark(function _callee(ctx) { | ||
var accessKey, cfResources, accountId, cfnStack, apiId, deploymentData, serviceUrlData, serviceUrl; | ||
var accessKey, cfResources, accountId, cfnStack, serviceEndpoint, apiId, deploymentData, serviceUrlData, serviceUrl; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -63,6 +63,7 @@ while (1) { | ||
cfnStack = _context.sent; | ||
apiId = _lodash.default.find(cfnStack.Stacks[0].Outputs, function (_ref2) { | ||
serviceEndpoint = _lodash.default.find(cfnStack.Stacks[0].Outputs, function (_ref2) { | ||
var OutputKey = _ref2.OutputKey; | ||
return OutputKey.match(ctx.provider.naming.getServiceEndpointRegex()); | ||
}).OutputValue.split('https://')[1].split('.')[0]; | ||
}); | ||
apiId = serviceEndpoint && serviceEndpoint.OutputValue.split('https://')[1].split('.')[0]; | ||
deploymentData = { | ||
@@ -86,6 +87,6 @@ accessKey, | ||
}; | ||
_context.next = 19; | ||
_context.next = 20; | ||
return (0, _platformSdk.updateDeployment)(deploymentData); | ||
case 19: | ||
case 20: | ||
// TODO: Track Stat | ||
@@ -103,3 +104,3 @@ serviceUrlData = { | ||
case 23: | ||
case 24: | ||
case "end": | ||
@@ -106,0 +107,0 @@ return _context.stop(); |
@@ -12,2 +12,4 @@ "use strict"; | ||
var _lodash = _interopRequireDefault(require("lodash")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -77,3 +79,3 @@ | ||
return _context.abrupt("return"); | ||
return _context.abrupt("continue", 4); | ||
@@ -130,3 +132,3 @@ case 9: | ||
if ((_context.t3 = _context.t2()).done) { | ||
_context.next = 32; | ||
_context.next = 33; | ||
break; | ||
@@ -150,6 +152,24 @@ } | ||
ctx.sls.service.functions[fn].handler = `${_func.entryNew}.${_func.handlerNew}`; | ||
if (_lodash.default.get(ctx.sls.service.functions[fn], 'package.individually', _lodash.default.get(ctx.sls.service, 'package.individually', false))) { | ||
// add include directives for handler file & sdk lib | ||
_lodash.default.set(ctx.sls.service.functions[fn], 'package.include', []); | ||
ctx.sls.service.functions[fn].package.include.push(`${_func.entryNew}.js`); | ||
ctx.sls.service.functions[fn].package.include.push('serverless-sdk'); | ||
} | ||
_context.next = 23; | ||
break; | ||
case 32: | ||
case 33: | ||
// add include directives for handler file & sdk lib | ||
if (!_lodash.default.get(ctx.sls.service, 'package.individually', false)) { | ||
_lodash.default.set(ctx.sls.service, 'package.include', []); | ||
ctx.sls.service.package.include.push('s-*.js'); | ||
ctx.sls.service.package.include.push('serverless-sdk'); | ||
} | ||
case 34: | ||
case "end": | ||
@@ -156,0 +176,0 @@ return _context.stop(); |
{ | ||
"name": "@serverless/enterprise-plugin", | ||
"version": "0.1.4", | ||
"version": "0.2.0-2-ge229844", | ||
"description": "The Serverless Enterprise plugin", | ||
@@ -15,3 +15,3 @@ "main": "dist/index.js", | ||
"@babel/polyfill": "^7.2.5", | ||
"@serverless/platform-sdk": "^0.5.0", | ||
"@serverless/platform-sdk": "next", | ||
"flat": "^4.1.0", | ||
@@ -43,3 +43,3 @@ "fs-extra": "^7.0.1", | ||
"author": "", | ||
"license": "ISC" | ||
"license": "Apache-2.0" | ||
} |
@@ -1,51 +0,12 @@ | ||
# Serverless Enterprise Plugin | ||
# Serverless Framework Enterprise Plugin | ||
[![Build Status](https://travis-ci.com/serverless/enterprise-plugin.svg)](https://travis-ci.com/serverless/enterprise-plugin) | ||
[![license](https://img.shields.io/npm/l/@serverless/enterprise-plugin.svg)](https://www.npmjs.com/package/@serverless/enterprise-plugin) | ||
[![coverage](https://img.shields.io/codecov/c/github/serverless/enterprise-plugin.svg)](https://codecov.io/gh/serverless/enterprise-plugin) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/serverless/enterprise-plugin/badge.svg)](https://snyk.io/test/github/enterprise-plugin) | ||
This is a Serverless Framework plugin which helps you use advanced monitoring, tracing and governance features via Serverless Enterprise. | ||
To enable the various features of the [Serverless Framework Enterprise](https://github.com/serverless/enterprise) for a particular Service you must deploy or redeploy that Service, using Serverless Framework open-source CLI version 1.36.3 or later, with this Enterprise Plugin installed. | ||
The Plugin automatically wraps your functions and instruments them with Serverless Enterprise's monitoring, alerting, logging and tracing features. | ||
- If you are an existing Serverless Framework Enterprise dashboard user and have a previously deployed Service that you now want to configure to use Serverless Insights, Safeguards, Secrets or other Enteprise features, follow these steps to [update an existing Service](./update.md) | ||
- If you are new to the Serverless Framework open source CLI or Serverless Framework Enterprise simply follow the steps in this [new user getting started guide](./getting-started.md#install-the-enterprise-plugin) to get up and running | ||
## Quick-Start | ||
Install the plugin & log into the Serverless Enterprise | ||
``` | ||
sls plugin install -n @serverless/enterprise-plugin | ||
sls login | ||
``` | ||
### Safeguards | ||
Serverless Enterprise ships with the following safeguards by default: | ||
* no wildcard IAM role statments | ||
* All functions with async events must be configured with a Dead Letter Queue | ||
* Environment variables can not contain secrets | ||
To disable Serverless Safeguards, add this to your configuration: | ||
```yaml | ||
custom: | ||
safeguards: false | ||
``` | ||
### Log Collection | ||
Serverless Enterprise automatically aggregates logs. To disable them, set the following options: | ||
```yaml | ||
custom: | ||
enterprise: | ||
collectLambdaLogs: false | ||
``` | ||
## Development Notes | ||
You can install the latest versions from the master branch by installing the `next` tag: | ||
``` | ||
npm install @serverless/enterprise-plugin@next | ||
``` | ||
The project is transpiled with babel, so run `npm run build` before installing it | ||
Currently, the `serverless-sdk` is within this project. On deployment, this plugin copies a | ||
bundled and compressed version of the `serverless-sdk` into your Service package before it's | ||
uploaded. | ||
If you are updating the `serverless-sdk`, ensure you run `npm run build` to rebuild it too | ||
On the next deployment, the new `sdk` will be included. | ||
Upon deployment, the Serverless Framwork Enteprise Plugin will automatically wrap and instrument your functions to work with the Serverless Framework Enterprise dashboard. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
360697
73
2927
1
13
+ Added@serverless/platform-sdk@2.3.1-5-g0004013(transitive)
+ Addedagent-base@5.1.1(transitive)
+ Addedasync-limiter@1.0.1(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedhttps-proxy-agent@4.0.0(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedws@6.2.3(transitive)
- Removed@serverless/platform-sdk@0.5.0(transitive)
- Removedaccepts@1.3.8(transitive)
- Removedarray-flatten@1.1.1(transitive)
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookie@0.7.1(transitive)
- Removedcookie-signature@1.0.6(transitive)
- Removedcors@2.8.5(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.22.0.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedetag@1.8.1(transitive)
- Removedexpress@4.21.2(transitive)
- Removedfinalhandler@1.3.1(transitive)
- Removedforwarded@0.2.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removediconv-lite@0.4.240.6.3(transitive)
- Removedipaddr.js@1.9.1(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmerge-descriptors@1.0.3(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.0.0(transitive)
- Removednegotiator@0.6.3(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-to-regexp@0.1.12(transitive)
- Removedproxy-addr@2.0.7(transitive)
- Removedqs@6.13.0(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedregenerator-runtime@0.10.50.11.1(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsend@0.19.0(transitive)
- Removedserve-static@1.16.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)