After Version 1.60.2 Serverless fails to deploy with Error "The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [WebsocketsApiParameter] in the Resources block of the template"
See original GitHub issueBug Report
Description
-
What did you do? I updated the serverless to version 1.60.5 from 1.59.3 and tried to deploy.
-
What happened? The deployment failed with the following message:
-
What should’ve happened? The deployment should succeed.
-
What’s the content of your
serverless.yml
file? Most of it is confidential. I can share parts of it.
# region WebSockets
ws-connection-handler:
handler: src/functions/ws/connection-handler.ts
events:
- websocket:
route: $connect
- websocket:
route: message
- websocket:
route: $default
- websocket:
route: $disconnect
# endregion
- What’s the output you get when you use the
SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)
Error --------------------------------------------------
Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [WebsocketsApiParameter] in the Resources block of the template
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:21 (19 by maintainers)
Top Results From Across the Web
Template format error: Unresolved resource dependencies in ...
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template.
Read more >The CloudFormation template is invalid: Template format error
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block ...
Read more >Resolve the "This template does not include any resources to ...
This error can occur when you use the AWS CloudFormation console in scenarios with any of the following: Conditional resources. The resource ......
Read more >failure on serverless deploy Template format error
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ServerlessDeploymentBucket] in the ...
Read more >Top 10 Serverless Deployment Errors (and How to Fix Them)
The CloudFormation stack name is '<stack-name>--'. Please resolve the issue then attempt preparation again. The cause: This situation often ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @gevorggalstyan for thorough investigation, I’ll do my best to look into it shortly
I can tell for sure that it has been the reason as I have tested every single commit and file in the merges from 1.60.1 to 1.60.2 by reverting each of them and trying to redeploy every time. After narrowing down to lib/plugins/aws/package/compile/functions/index.js I applied the same approach for every changed line in that file and again narrowed down to line 436.
So my only reasoning about why switching from _.merge to Object.assign is based on factually testing and seeing that with Object.assign the stack does not deploy, but with _.merge it does.
I do share your confusion about the issue and why would this be a problem, as I have exported the result of each method and compared the files and in fact, the only differences were in the s3 file names, specifically the timestamps and DateTime, even the version numbers were the same.
We do use a lot of plugins but because of the fact that the files were the same and the versions numbers matched, to be honest, I have no idea what is going on here.
Again the only actual difference between Object.assign and _.merge that came to my mind was the deep/shallow copy, so I have decided to test my hypothesis by using parse-stringify approach and that worked.
Unfortunately, I can’t do anything more than that.