Class WebSocketAwsIntegration

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.apigatewayv2.WebSocketRouteIntegration
software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketAwsIntegration
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-02T15:58:20.926Z") @Stability(Stable) public class WebSocketAwsIntegration extends WebSocketRouteIntegration
AWS WebSocket AWS Type Integration.

Example:

 import software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketAwsIntegration;
 import software.amazon.awscdk.services.dynamodb.*;
 import software.amazon.awscdk.services.iam.*;
 Role apiRole;
 Table table;
 WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi");
 WebSocketStage.Builder.create(this, "mystage")
         .webSocketApi(webSocketApi)
         .stageName("dev")
         .autoDeploy(true)
         .build();
 webSocketApi.addRoute("$connect", WebSocketRouteOptions.builder()
         .integration(WebSocketAwsIntegration.Builder.create("DynamodbPutItem")
                 .integrationUri(String.format("arn:aws:apigateway:%s:dynamodb:action/PutItem", this.region))
                 .integrationMethod(HttpMethod.POST)
                 .credentialsRole(apiRole)
                 .requestTemplates(Map.of(
                         "application/json", JSON.stringify(Map.of(
                                 "TableName", table.getTableName(),
                                 "Item", Map.of(
                                         "id", Map.of(
                                                 "S", "$context.requestId"))))))
                 .build())
         .build());
 
  • Constructor Details

    • WebSocketAwsIntegration

      protected WebSocketAwsIntegration(software.amazon.jsii.JsiiObjectRef objRef)
    • WebSocketAwsIntegration

      protected WebSocketAwsIntegration(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • WebSocketAwsIntegration

      @Stability(Stable) public WebSocketAwsIntegration(@NotNull String id, @NotNull WebSocketAwsIntegrationProps props)
      Parameters:
      id - id of the underlying integration construct. This parameter is required.
      props - This parameter is required.
  • Method Details