Created
March 2, 2023 01:20
-
-
Save metaskills/45a5f09bb097fdd7ae7c8c8f5805236a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WS: | |
Type: AWS::ApiGatewayV2::Api | |
Properties: | |
Name: MyappWebsocketStaging | |
ProtocolType: WEBSOCKET | |
RouteSelectionExpression: "$request.body.message" | |
WebsocketDeployment: | |
Type: AWS::ApiGatewayV2::Deployment | |
DependsOn: | |
- ConnectWSRoute | |
- DefaultWSRoute | |
- DisconnectWSRoute | |
Properties: | |
ApiId: | |
Ref: WS | |
WebsocketStage: | |
Type: AWS::ApiGatewayV2::Stage | |
Properties: | |
StageName: staging | |
DeploymentId: | |
Ref: WebsocketDeployment | |
ApiId: | |
Ref: WS | |
WebSocketPolicy: | |
Type: AWS::IAM::Policy | |
DependsOn: Role | |
Properties: | |
PolicyName: ArcWebSocketPolicy | |
PolicyDocument: | |
Statement: | |
- Effect: Allow | |
Action: | |
- execute-api:Invoke | |
- execute-api:ManageConnections | |
Resource: | |
- Fn::Sub: | |
- arn:aws:execute-api:${AWS::Region}:*:${api}/* | |
- api: | |
Ref: WS | |
Roles: | |
- Ref: Role |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment