Class WebSocketAwsIntegration
AWS WebSocket AWS Type Integration.
Namespace: Amazon.CDK.AwsApigatewayv2Integrations
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class WebSocketAwsIntegration : WebSocketRouteIntegration
Syntax (vb)
Public Class WebSocketAwsIntegration
Inherits WebSocketRouteIntegration
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.WebSocketAwsIntegration;
using Amazon.CDK.AWS.DynamoDB;
using Amazon.CDK.AWS.IAM;
Role apiRole;
Table table;
var webSocketApi = new WebSocketApi(this, "mywsapi");
new WebSocketStage(this, "mystage", new WebSocketStageProps {
WebSocketApi = webSocketApi,
StageName = "dev",
AutoDeploy = true
});
webSocketApi.AddRoute("$connect", new WebSocketRouteOptions {
Integration = new WebSocketAwsIntegration("DynamodbPutItem", new WebSocketAwsIntegrationProps {
IntegrationUri = $"arn:aws:apigateway:{this.region}:dynamodb:action/PutItem",
IntegrationMethod = HttpMethod.POST,
CredentialsRole = apiRole,
RequestTemplates = new Dictionary<string, string> {
{ "application/json", JSON.Stringify(new Dictionary<string, object> {
{ "TableName", table.TableName },
{ "Item", new Struct {
Id = new Struct {
S = "$context.requestId"
}
} }
}) }
}
})
});
Synopsis
Constructors
WebSocketAwsIntegration(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
WebSocketAwsIntegration(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
WebSocketAwsIntegration(String, IWebSocketAwsIntegrationProps) |
Methods
Bind(IWebSocketRouteIntegrationBindOptions) | Bind this integration to the route. |
Constructors
WebSocketAwsIntegration(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected WebSocketAwsIntegration(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
WebSocketAwsIntegration(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected WebSocketAwsIntegration(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
WebSocketAwsIntegration(String, IWebSocketAwsIntegrationProps)
public WebSocketAwsIntegration(string id, IWebSocketAwsIntegrationProps props)
Parameters
- id System.String
id of the underlying integration construct.
- props IWebSocketAwsIntegrationProps
id of the underlying integration construct.
Methods
Bind(IWebSocketRouteIntegrationBindOptions)
Bind this integration to the route.
public override IWebSocketRouteIntegrationConfig Bind(IWebSocketRouteIntegrationBindOptions options)
Parameters
Returns
IWebSocketRouteIntegrationConfig