Skip to content

Error creating IAM Role for Step Functions #1

@knakayama

Description

@knakayama

It looks like there are some bugs when creating IAM Role for Step Functions. This plugin try to create IAM Role when it can't find statesExecutionRole-us-east-1 role, but always fail because of some reasons.

  1. this.iamRoleName is not defined.

When createRole is invoked, this.iamRoleName variable is not set, so failing with this error message.

$ sls deploy stepf -t hellostepfunc -v
Serverless: Start to deploy hellostepfunc step function...

  Serverless Error ---------------------------------------

     Missing required key 'RoleName' in params

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues

  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       7.1.0
     Serverless Version: 1.4.0
  1. Invalid Policy Document

Also assumeRolePolicyDocument, passed to createRole as a param, is not valid policy document. It's value must be assume role policy, not policy for invoking Lambda function. Here is a error message with passing string to this.iamRoleName.

$ sls deploy stepf -t hellostepfunc -v
Serverless: Start to deploy hellostepfunc step function...

  Serverless Error ---------------------------------------

     Has prohibited field Resource

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues

  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       7.1.0
     Serverless Version: 1.4.0

I think it's JSON object should be looks like this.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "states.<region-defined-in-provider>.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

And I don't know how to implement, but you have to define poliicy for invoking Lambda function somewhere in code.

Thanks for very useful plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions