You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using AWS Websocket API with serverless framework 1.38.0 and I want to deploy both http and websocket event lamda with single serverless.yml and all lambda would share same existing IAM role. Hence for this I have declared role arn in provider tab but when I run sls deploy -v it says error - cannot read properties undefined.
My understanding is we can only define role arn at function level only either for event type http or wss or vice versa but if we defined role at both places it says same error as above.
Please help me how to define EXISTING role for both API’s either at global level or function level, sample YAML configuration will really help.
hello:
handler: CsharpHandlers::AwsDotnetCsharp.Handler::Hello
name: APITypeHello
#role: cant define role here hence it is being deployed with default role.
events:
- http:
path: api/shipments
method: post
cors: true
onConnect:
handler: CsharpHandlers::AwsDotnetCsharp.WSSConnectHandler::WSSConnect
role: arn:aws:iam::019095984934:role/lambdarolenew
name: onConnect
events:
- websocket:
route: $connect
- websocket:
route: $disconnect
chatMessage:
handler: CsharpHandlers::AwsDotnetCsharp.WebsocketHandler::GetWSSRequest
role: arn:aws:iam::019095984934:role/lambdarolenew
name: chatMessage
events:
- websocket:
route: chatMessage
Thanks
Ankur
The text was updated successfully, but these errors were encountered:
+1
I'm trying to do the same (defining an https event and a websocket).
In my case, the error i get is this:
..................................
Serverless: Stack update finished...
Serverless: Uploading CloudFormation alias file to S3...
Serverless: Updating alias stack...
Serverless Error ---------------------------------------
[/Resources/DefaultHandlerLambdaPermissionWebsockets/DependsOn/0] 'null' values are not allowed in templates
@castellanprime I'm not sure what you mean with same route. I've defined them as different functions... the websocket with a $default route and the https with its own path. Each of them invoke a method in the handler file.
Hi Team,
I am using AWS Websocket API with serverless framework 1.38.0 and I want to deploy both http and websocket event lamda with single serverless.yml and all lambda would share same existing IAM role. Hence for this I have declared role arn in provider tab but when I run sls deploy -v it says error - cannot read properties undefined.
My understanding is we can only define role arn at function level only either for event type http or wss or vice versa but if we defined role at both places it says same error as above.
Please help me how to define EXISTING role for both API’s either at global level or function level, sample YAML configuration will really help.
hello:
handler: CsharpHandlers::AwsDotnetCsharp.Handler::Hello
name: APITypeHello
#role: cant define role here hence it is being deployed with default role.
events:
- http:
path: api/shipments
method: post
cors: true
onConnect:
handler: CsharpHandlers::AwsDotnetCsharp.WSSConnectHandler::WSSConnect
role: arn:aws:iam::019095984934:role/lambdarolenew
name: onConnect
events:
- websocket:
route: $connect
- websocket:
route: $disconnect
chatMessage:
handler: CsharpHandlers::AwsDotnetCsharp.WebsocketHandler::GetWSSRequest
role: arn:aws:iam::019095984934:role/lambdarolenew
name: chatMessage
events:
- websocket:
route: chatMessage
Thanks
Ankur
The text was updated successfully, but these errors were encountered: