Created
January 14, 2021 15:41
-
-
Save leantorres73/a14e7a589a6f270fb44190a05594d15b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// connect route | |
const apigatewayroutesocketconnect = new apigateway.CfnRoute(this, "apigatewayroutesocketconnect", { | |
apiId:apigatewaysocket.ref, | |
routeKey: "$connect", | |
authorizationType: "AWS_IAM", | |
apiKeyRequired: false, | |
operationName: "ConnectRoute", | |
target: "integrations/"+new apigateway.CfnIntegration(this, "apigatewayintegrationsocketconnect", { | |
apiId: apigatewaysocket.ref, | |
integrationType: "AWS_PROXY", | |
integrationUri: "arn:aws:apigateway:" + Stack.of(this).region + ":lambda:path/2015-03-31/functions/" + lambdaAPIsocket.functionArn+"/invocations", | |
credentialsArn: roleapigatewaysocketapi.roleArn | |
}).ref | |
}); | |
// disconnect route | |
const apigatewayroutesocketdisconnect = new apigateway.CfnRoute(this, "apigatewayroutesocketdisconnect", { | |
apiId:apigatewaysocket.ref, | |
routeKey: "$disconnect", | |
apiKeyRequired: false, | |
authorizationType: "NONE", | |
operationName: "DisconnectRoute", | |
target: "integrations/"+new apigateway.CfnIntegration(this, "apigatewayintegrationsocketdisconnect", { | |
apiId:apigatewaysocket.ref, | |
integrationType: "AWS_PROXY", | |
integrationUri: "arn:aws:apigateway:"+Stack.of(this).region+":lambda:path/2015-03-31/functions/" + lambdaAPIsocket.functionArn + "/invocations", | |
credentialsArn: roleapigatewaysocketapi.roleArn | |
}).ref | |
}); | |
// message route | |
const apigatewayroutesocketdefault = new apigateway.CfnRoute(this, "apigatewayroutesocketdefault", { | |
apiId:apigatewaysocket.ref, | |
routeKey: "$default", | |
apiKeyRequired: false, | |
authorizationType: "NONE", | |
operationName: "SendRoute", | |
target: "integrations/"+new apigateway.CfnIntegration(this, "apigatewayintegrationsocketdefault", { | |
apiId:apigatewaysocket.ref, | |
integrationType: "AWS_PROXY", | |
integrationUri: "arn:aws:apigateway:"+Stack.of(this).region+":lambda:path/2015-03-31/functions/"+lambdaAPIsocket.functionArn+"/invocations", | |
credentialsArn: roleapigatewaysocketapi.roleArn | |
}).ref | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment