Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-step-functions

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-step-functions - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

44

lib/deploy.js

@@ -10,2 +10,3 @@ 'use strict';

this.functionArns = {};
const region = this.options.region || 'us-east-1';

@@ -26,2 +27,19 @@ this.iamPolicyStatement = `{

this.assumeRolePolicyDocument = `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "states.${region}.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
`;
this.iamRoleName = `serverless-step-functions-executerole-${region}`;
this.iamPolicyName = `serverless-step-functions-executepolicy-${region}`;
this.serverless.cli.log(`Start to deploy ${this.options.state} step function...`);

@@ -44,3 +62,3 @@ BbPromise.bind(this)

{
RoleName: 'StatesExecutionRole-us-east-1',
RoleName: this.iamRoleName,
},

@@ -80,3 +98,3 @@ this.options.stage,

{
AssumeRolePolicyDocument: this.iamPolicyStatement,
AssumeRolePolicyDocument: this.assumeRolePolicyDocument,
RoleName: this.iamRoleName,

@@ -88,4 +106,22 @@ },

this.iamRoleArn = result.Role.Arn;
return BbPromise.resolve();
});
return this.provider.request('IAM',
'createPolicy',
{
PolicyDocument: this.iamPolicyStatement,
PolicyName: this.iamPolicyName,
},
this.options.stage,
this.options.region)
})
.then((result) => {
return this.provider.request('IAM',
'attachRolePolicy',
{
PolicyArn: result.Policy.Arn,
RoleName: this.iamRoleName,
},
this.options.stage,
this.options.region)
})
.then(() => BbPromise.resolve());
},

@@ -92,0 +128,0 @@

2

package.json
{
"name": "serverless-step-functions",
"version": "0.1.1",
"version": "0.1.2",
"description": "The module is AWS Step Functions plugin for Serverless Framework",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -37,4 +37,7 @@ [![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) [![Build Status](https://travis-ci.org/horike37/serverless-step-functions.svg?branch=master)](https://travis-ci.org/horike37/serverless-step-functions)

## Usage
## Command
### deploy
- --state or -t The name of the step function in your service that you want to deploy. Required.
- --stage or -s The stage in your service you want to deploy your step function.
- --region or -r The region in your stage that you want to deploy your step function.
```

@@ -45,2 +48,6 @@ $ sls deploy stepf --state <stepfunctionname>

### invoke
- --state or -t The name of the step function in your service that you want to invoke. Required.
- --stage or -s The stage in your service you want to invoke your step function.
- --region or -r The region in your stage that you want to invoke your step function.
- --data or -d String data to be passed as an event to your step function.
```

@@ -51,4 +58,7 @@ $ sls invoke stepf --state <stepfunctionname> --data '{"foo":"bar"}'

### remove
- --state or -t The name of the step function in your service that you want to remove. Required.
- --stage or -s The stage in your service you want to invoke your step remove.
- --region or -r The region in your stage that you want to invoke your step remove.
```
$ sls remove stepf --state <stepfunctionname>
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc