-
Notifications
You must be signed in to change notification settings - Fork 4.4k
(apigatewayv2): grant permissions for sending messages to a WebSocket #14828
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayv2Related to Amazon API Gateway v2Related to Amazon API Gateway v2effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayv2Related to Amazon API Gateway v2Related to Amazon API Gateway v2effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2