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.

(apigatewayv2): grant permissions for sending messages to a WebSocket

See original GitHub issue

I have a Lambda function and I want it to be able to post messages to a WebSocket. There doesn’t seem to be a websocket.grantPost(lambda.role) or equivalent like there is for other resources like S3 buckets, so my Lambda always fails with 403 Forbidden when I try to send messages to the WebSocket.

Use Case

I have a Lambda that is invoked via other means not related to the WebSocket, but I want to grant it permission to send messages to clients connected to the WebSocket.

Proposed Solution

Add a grantPost() or similar function to the WebSocketApi class, to provide functionality equivalent to S3.Bucket.grantPut(), DynamoDB.Table.grantReadWriteData(), etc. but for granting permission to post messages to WebSockets.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
douglasnaphascommented, Jul 18, 2021

I’m working on a PR to implement this feature.

0reactions
github-actions[bot]commented, Nov 9, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controlling and managing access to a WebSocket API in API ...
Learn how to control access to a WebSocket API. ... Standard AWS IAM roles and policies offer flexible and robust access controls. You...
Read more >
aws-cdk.aws-apigatewayv2 - PyPI
Grant permission to use API Gateway Management API of a WebSocket API by calling the grantManageConnections API. You can use Management API to...
Read more >
API Gateway WebSocket API to SQS to AWS Lambda
This pattern creates an Amazon API Gateway WebSocket API which sends inbound messages to an Amazon SQS FIFO queue. The queue is processed...
Read more >
Intro to AWS WebSockets - Ready, Set, Cloud!
Starting With AWS WebSockets. In AWS, a WebSocket is an API Gateway v2 resource. ... To add a subscription, send a message in...
Read more >
AWS API Gateway Websocket Tutorial With Lambda - YouTube
In this step by step tutorial video, I show you how to set up a WebSocket API with a Lambda Function backend. This...
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