serverless-step-functions | AWS Step Functions plugin for Serverless Framework ⚡️ | Serverless library
kandi X-RAY | serverless-step-functions Summary
kandi X-RAY | serverless-step-functions Summary
This is the Serverless Framework plugin for AWS Step Functions.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the permissions for a lambda access
- Get CloudWatch alarms .
- Convenience function to get the permissions granted to all tasks in the stream .
- Apply a given resource
- Returns the DynamoDB name for the given table .
- Creates the target target .
- Convert a Lambda function to a function name .
- Compile the permissions for a target .
- Creates an IAM role for a role
- Validates the stateless config .
serverless-step-functions Key Features
serverless-step-functions Examples and Code Snippets
Community Discussions
Trending Discussions on serverless-step-functions
QUESTION
I have the following serverless yaml that I'm using to try to deploy my first step function:
...ANSWER
Answered 2022-Feb-11 at 12:31Problem was due to yaml formatting. Line 192
Fn::GetAtt: [PullSqlSvr, Arn]
This needed an extra tab to indent below "Resource:"
QUESTION
I'm trying to use serverless framework to deploy a step function that calls a couple of lambdas. Here's my serverless.yml:
...ANSWER
Answered 2022-Feb-08 at 14:41In my experience serverless-step-functions
fails to deploy properly if any keys in the Steps
block begin with a lowercase letter. Changing it to the seemingly case-sensitive equivalents, like the following, and redeploying may do the trick:
QUESTION
I have the following serverless.yml file:
...ANSWER
Answered 2022-Feb-08 at 12:55Thanks to @eli6 for the tip about serverless print. I don't know the root cause of the problem but after restarting vscode serverless print and serverless deploy then worked
QUESTION
We are using serverless framewotk (AWS) to create :
ApiGateway
which connects to astep function
via a plugin called: serverless-step-functions
This is the current code which uses the serverless-step-functions
plugin :
ANSWER
Answered 2021-Nov-16 at 12:43To Configure AWS API Gateway integration to step function you have to follow these steps:
- Configure Api gateway resource
QUESTION
I have an AWS steps function defined using this Serverless plugin with 3 steps (FirstStep -> Worker -> EndStep -> Done):
...ANSWER
Answered 2021-May-07 at 12:47Given that you invoke the step function with an object (let's call that A
), then a task's...
- ...
InputPath
specifies what part ofA
is handed to your task - ...
ResultPath
specifies where inA
to put the result of the task - ...
OutputPath
specifies what part ofA
to hand over to the next state
Source: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-example.html
So you are currently overwriting all content in A
with the result of your Worker
state (implicitly). If you want to discard the result of your Worker state, you have to specify:
QUESTION
Error: Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: The value for the field 'Date.$' must be a valid JSONPath at /States/Insert Data Dynamodb/Parameters' (Service: AWSStepFunctions; Status Code: 400; Error Code: InvalidDefinition;
below is the corresponding serverless.yaml code.
I tried wrapping the two parameters into encoded json string and passed it as single payload field and it resulted in the same error but when there is only one plain field in the payload this code deployed successfully
Any suggestions on how to pass two parameters?
...ANSWER
Answered 2021-Mar-22 at 18:21Your Date.$
property has value of ${self:custom.dates.year}${self:custom.dates.month}${self:custom.dates.day}
. Let's assume that:
QUESTION
I have a query with hardcoded dates used in the parameters section.Instead I want to pass them as environment variables.Any suggestions on how to parameterize the QueryString
parameter?
ANSWER
Answered 2021-Mar-18 at 05:27you can replace any value in your serverless.yml
enclosed in ${}
brackets,
Serverless Framework Guide to Variables: https://www.serverless.com/framework/docs/providers/aws/guide/variables/
for example, you can create a custom:
section looking for environment variables, and if they are not present, you can have default values:
QUESTION
i am using serverless framework with serverless-step-functions
plugin. I want to check any errors in my stepfunction workflow and send this error to sqs queue.
Currently I want to pass all input as message to the queue(MessageBody: $
). But if I get the data from the queue, message is $
(dollar sign) and not actual input. How can I send to queue the error message from the previous step?
ANSWER
Answered 2021-Jan-08 at 02:48I have got the same when connecting SNS. As per the AWS doc, we have to follow the below structure to send the parameters
"MessageBody.$": "$"
Reference: https://docs.aws.amazon.com/step-functions/latest/dg/connect-sqs.html
QUESTION
Testing, learning serverless framework. I'm trying to deploy simple/basic state machine with two simple lambda functions. Serverless definition as follows:
...ANSWER
Answered 2020-Dec-10 at 13:37Looks like you are referencing something called CustomIamRole in your state machine creation but I cannot see it being created anywhere in the yaml file. Either create the role and use it in creation or remove the depends on part.
QUESTION
Currently learning serverless and state machines. When I'm trying to do deployment I'm getting error: TypeError: Cannot read property ‘startsWith’ of undefined
.
Below you can find serverless.yml definition which I'm trying to deploy. I can't spot the error I did.
State machine I want is really basic and simple. I want to start it with decision, which will direct to correct lambda, depends on input (all of this manual, semi-manual for now). After lambda completion (no matter which one) will be end.
...ANSWER
Answered 2020-Dec-02 at 18:06Line 77 in my serverless.yml has typo... should be Resource
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install serverless-step-functions
Specify your state machine definition using Amazon States Language in a definition statement in serverless.yml. You can use CloudFormation intrinsic functions such as Ref and Fn::GetAtt to reference Lambda functions, SNS topics, SQS queues and DynamoDB tables declared in the same serverless.yml. Since Ref returns different things (ARN, ID, resource name, etc.) depending on the type of CloudFormation resource, please refer to this page to see whether you need to use Ref or Fn::GetAtt. Alternatively, you can also provide the raw ARN, or SQS queue URL, or DynamoDB table name as a string. If you need to construct the ARN by hand, then we recommend to use the serverless-pseudo-parameters plugin together to make your life easier. In addition, if you want to reference a DynamoDB table managed by an external CloudFormation Stack, as long as that table name is exported as an output from that stack, it can be referenced by importing it using Fn::ImportValue. See the ddbtablestepfunc Step Function definition below for an example. In the example above, notice that we used Fn::GetAtt: [hello, Arn] to get the ARN for the hello function defined earlier. This means you don't have to know how the Serverless framework converts these local names to CloudFormation logical IDs (e.g. hello-world becomes HelloDashworldLambdaFunction). However, if you prefer to work with logical IDs, you can. You can also express the above Fn::GetAtt function as Fn::GetAtt: [HelloLambdaFunction, Arn]. If you're unfamiliar with the convention the Serverless framework uses, then the easiest thing to do is to first run sls package then look in the .serverless folder for the generated CloudFormation template. Here you can find the logical resource names for the functions you want to reference.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page