Problem to deploy app with custom resources

I’m having this error message when try to deploy my serverless app.

this is the content of my serverless.yml file:

service: aws-nodejs

provider:
name: aws
runtime: nodejs4.3
iamRoleStatements:
- Effect: Allow
Resource: “"
Action:
- dynamodb: "

functions:
createMusic:
handler: handler.create
events:
- http:
path: createMusic
method: post

resources:
Resources:
mapping:
Type: AWS::Lambda::EventSourceMapping
Properties:
BatchSize: 100
EventSourceArn: “arn:aws:dynamodb:us-east-1:415862252135:table/Music/stream/2016-08-24T16:55:35.679”
FunctionName:
Fn::GetAtt:
- “createMusic”
- “Arn”
StartingPosition: “TRIM_HORIZON”

Can you try adding a dependsOn configuration to the EventSourceMapping to make sure the function is created first. Or is the function already created and you just want to add something?

1 Like

The function is already created.

Are you on the latest beta, or master? We’ve shipped something recently that could potentially solve this problem, otherwise can you run serverless deploy --noDeploy so we can see the full CF template and maybe you can see an issue there.

What is the error Cloudformation is showing in the webUI (soon we will show those errors on the command line as well)?

1 Like

I’m using the latest beta, i see the cloudformation ang i’m getting this error, stack bellow:

CREATE_FAILED AWS::Lambda::Function hello Template error: IAM role aws-nodejs-dev-IamRoleLambda-24KZ4873YXHE doesn’t exist

Hmm this might be solved with a few recent merges we did, but there is also an issue with a race condition that happens sometimes with Roles. Can you try with the latest master?

1 Like