WebSocketAuthorizerProps Struct
Properties to initialize an instance of WebSocketAuthorizer.
| Source | aws-apigatewayv2/lib/websocket/authorizer.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';
declare const webSocketApi: apigatewayv2.WebSocketApi;
const webSocketAuthorizerProps: apigatewayv2.WebSocketAuthorizerProps = {
identitySource: ['identitySource'],
type: apigatewayv2.WebSocketAuthorizerType.LAMBDA,
webSocketApi: webSocketApi,
// the properties below are optional
authorizerName: 'authorizerName',
authorizerUri: 'authorizerUri',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigatewayv2 as apigatewayv2
# web_socket_api: apigatewayv2.WebSocketApi
web_socket_authorizer_props = apigatewayv2.WebSocketAuthorizerProps(
identity_source=["identitySource"],
type=apigatewayv2.WebSocketAuthorizerType.LAMBDA,
web_socket_api=web_socket_api,
# the properties below are optional
authorizer_name="authorizerName",
authorizer_uri="authorizerUri"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigatewayv2.*;
WebSocketApi webSocketApi;
WebSocketAuthorizerProps webSocketAuthorizerProps = WebSocketAuthorizerProps.builder()
.identitySource(List.of("identitySource"))
.type(WebSocketAuthorizerType.LAMBDA)
.webSocketApi(webSocketApi)
// the properties below are optional
.authorizerName("authorizerName")
.authorizerUri("authorizerUri")
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Apigatewayv2;
WebSocketApi webSocketApi;
var webSocketAuthorizerProps = new WebSocketAuthorizerProps {
IdentitySource = new [] { "identitySource" },
Type = WebSocketAuthorizerType.LAMBDA,
WebSocketApi = webSocketApi,
// the properties below are optional
AuthorizerName = "authorizerName",
AuthorizerUri = "authorizerUri"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var webSocketApi WebSocketApi
webSocketAuthorizerProps := &WebSocketAuthorizerProps{
IdentitySource: []*string{
jsii.String("identitySource"),
},
Type: awscdk.Aws_apigatewayv2.WebSocketAuthorizerType_LAMBDA,
WebSocketApi: webSocketApi,
// the properties below are optional
AuthorizerName: jsii.String("authorizerName"),
AuthorizerUri: jsii.String("authorizerUri"),
}
Properties
authorizerNameoptionalstringauthorizer_nameoptionalstrauthorizerNameoptionalStringAuthorizerNameoptionalstringAuthorizerNameoptional*string #Name of the authorizer.
Default: id of the WebSocketAuthorizer construct.
authorizerUrioptionalstringauthorizer_urioptionalstrauthorizerUrioptionalStringAuthorizerUrioptionalstringAuthorizerUrioptional*string #The authorizer's Uniform Resource Identifier (URI).
Default: required for Request authorizer types
For REQUEST authorizers, this must be a well-formed Lambda function URI.
identitySourcestring[]identity_sourcetyping.List[str]identitySourceList<String>IdentitySourcestring[]IdentitySource*[]*string required #The identity source for which authorization is requested.
typeWebSocketAuthorizerTypetypeWebSocketAuthorizerTypetypeWebSocketAuthorizerTypeTypeWebSocketAuthorizerTypeTypeWebSocketAuthorizerType required #The type of authorizer.
webSocketApiIWebSocketApiweb_socket_apiIWebSocketApiwebSocketApiIWebSocketApiWebSocketApiIWebSocketApiWebSocketApiIWebSocketApi required #WebSocket Api to attach the authorizer to.