@aws-cdk_aws-apigatewayv2-alpha.WebSocketAuthorizer

class WebSocketAuthorizer (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.WebSocketAuthorizer
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#WebSocketAuthorizer
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.WebSocketAuthorizer
Pythonaws_cdk.aws_apigatewayv2_alpha.WebSocketAuthorizer
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป WebSocketAuthorizer

Implements IConstruct, IDependable, IResource, IWebSocketAuthorizer, IAuthorizer

An authorizer for WebSocket Apis.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as apigatewayv2_alpha from '@aws-cdk/aws-apigatewayv2-alpha';

declare const webSocketApi: apigatewayv2_alpha.WebSocketApi;
const webSocketAuthorizer = new apigatewayv2_alpha.WebSocketAuthorizer(this, 'MyWebSocketAuthorizer', {
  identitySource: ['identitySource'],
  type: apigatewayv2_alpha.WebSocketAuthorizerType.LAMBDA,
  webSocketApi: webSocketApi,

  // the properties below are optional
  authorizerName: 'authorizerName',
  authorizerUri: 'authorizerUri',
});

Initializer

new WebSocketAuthorizer(scope: Construct, id: string, props: WebSocketAuthorizerProps)

Parameters

  • scope Construct
  • id string
  • props WebSocketAuthorizerProps

Construct Props

NameTypeDescription
identitySource๐Ÿ”นstring[]The identity source for which authorization is requested.
type๐Ÿ”นWebSocketAuthorizerTypeThe type of authorizer.
webSocketApi๐Ÿ”นIWebSocketApiWebSocket Api to attach the authorizer to.
authorizerName?๐Ÿ”นstringName of the authorizer.
authorizerUri?๐Ÿ”นstringThe authorizer's Uniform Resource Identifier (URI).

identitySource๐Ÿ”น

Type: string[]

The identity source for which authorization is requested.

See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-authorizer.html#cfn-apigatewayv2-authorizer-identitysource


type๐Ÿ”น

Type: WebSocketAuthorizerType

The type of authorizer.


webSocketApi๐Ÿ”น

Type: IWebSocketApi

WebSocket Api to attach the authorizer to.


authorizerName?๐Ÿ”น

Type: string (optional, default: id of the WebSocketAuthorizer construct.)

Name of the authorizer.


authorizerUri?๐Ÿ”น

Type: string (optional, default: required for Request authorizer types)

The authorizer's Uniform Resource Identifier (URI).

For REQUEST authorizers, this must be a well-formed Lambda function URI.

Properties

NameTypeDescription
authorizerId๐Ÿ”นstringId of the Authorizer.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.

authorizerId๐Ÿ”น

Type: string

Id of the Authorizer.


env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromWebSocketAuthorizerAttributes(scope, id, attrs)๐Ÿ”นImport an existing WebSocket Authorizer into this CDK app.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromWebSocketAuthorizerAttributes(scope, id, attrs)๐Ÿ”น

public static fromWebSocketAuthorizerAttributes(scope: Construct, id: string, attrs: WebSocketAuthorizerAttributes): IWebSocketRouteAuthorizer

Parameters

  • scope Construct
  • id string
  • attrs WebSocketAuthorizerAttributes

Returns

  • IWebSocketRouteAuthorizer

Import an existing WebSocket Authorizer into this CDK app.