question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stream event has incorrect DependsOn value when role passed as logical id string value

See original GitHub issue

This is a Bug Report

Description

Given a function with a custom role (MyRole) and a kinesis event stream, deployment fails with an error

Template format error: Unresolved resource dependencies [IamRoleLambdaExecution] in the Resources block of the template

Examining the CloudFormation template reveals the dependency in the EventSourceMapping:

"PopEventSourceMappingKinesisKinesis": {
      "Type": "AWS::Lambda::EventSourceMapping",
      "DependsOn": "IamRoleLambdaExecution",

The IamRoleLambdaExecution Resource does not exist as no functions reference it.

Expected the Depends On to equal the value of the specified role MyRole and deployment to work.

  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       6.10.1
     Serverless Version: 1.9.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pmuenscommented, Apr 21, 2017

Hey @tobyhede thanks for reporting.

I tried to reproduce this locally with the recent master. Seems to be fine on my end.

Here’s my serverless.yml:

service: service

provider:
  name: aws
  runtime: nodejs6.10

functions:
  hello:
    handler: handler.hello
    role: testKinesisStream
    events:
      - stream:
          arn: arn:aws:kinesis:us-east-1:XXXX:stream/test
          startingPosition: LATEST
          enabled: false

resources:
  Resources:
    testKinesisStream:
      Type: AWS::IAM::Role
      Properties:
        RoleName: test-kinesis-stream-dev-role
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: "Allow"
              Principal:
                Service:
                  - "lambda.amazonaws.com"
              Action: "sts:AssumeRole"
        Policies:
          - PolicyName: test-kinesis-stream-dev-policy
            PolicyDocument:
              Version: '2012-10-17'
              Statement:
                - Effect: "Allow"
                  Action:
                    - "kinesis:DescribeStream"
                    - "kinesis:GetShardIterator"
                    - "kinesis:GetRecords"
                    - "kinesis:ListStreams"
                  Resource: arn:aws:kinesis:us-east-1:XXXX:stream/test

Could you try the latest master (your version was Serverless v1.9.0) and see if this problem was already fixed?

Otherwise could you please paste a serverless.yml which show how to reproduce the bug.

Thanks

0reactions
pmuenscommented, Aug 14, 2017

Yep, same error, different issue.

Alright. Thanks for opening #4083 and PRing a fix! 💯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve template validation or template format errors in ... - AWS
Confirm that resource logical IDs and parameters are defined in your template. In the following JSON and YAML templates, test is referenced ...
Read more >
Error while creating changeset - "DependsOn must be a string ...
not sure what I am doing wrong. DependsOn , as the error says, must be a string, or list of strings. Not an...
Read more >
Serverless Step Functions - Serverless Framework: Plugins
32.0 or later is required. TOC. Install; Setup. Adding a custom name for a state machine; Adding a custom logical id for a...
Read more >
Template structure and syntax - Azure Resource Manager
Must be a valid JavaScript identifier. type, Yes, Type of the parameter value. The allowed types and values are string, securestring, int, bool, ......
Read more >
Spark Streaming Programming Guide
Spark Streaming is an extension of the core Spark API that enables scalable, high-throughput, fault-tolerant stream processing of live data streams. Data can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found