@aws-cdk_aws-apigatewayv2-alpha.HttpRoute

class HttpRoute (construct) ๐Ÿ”น

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

Implements IConstruct, IDependable, IResource, IHttpRoute, IRoute

Route class that creates the Route for API Gateway HTTP API.

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 httpApi: apigatewayv2_alpha.HttpApi;
declare const httpRouteAuthorizer: apigatewayv2_alpha.IHttpRouteAuthorizer;
declare const httpRouteIntegration: apigatewayv2_alpha.HttpRouteIntegration;
declare const httpRouteKey: apigatewayv2_alpha.HttpRouteKey;
const httpRoute = new apigatewayv2_alpha.HttpRoute(this, 'MyHttpRoute', {
  httpApi: httpApi,
  integration: httpRouteIntegration,
  routeKey: httpRouteKey,

  // the properties below are optional
  authorizationScopes: ['authorizationScopes'],
  authorizer: httpRouteAuthorizer,
});

Initializer

new HttpRoute(scope: Construct, id: string, props: HttpRouteProps)

Parameters

  • scope Construct
  • id string
  • props HttpRouteProps

Construct Props

NameTypeDescription
httpApi๐Ÿ”นIHttpApithe API the route is associated with.
integration๐Ÿ”นHttpRouteIntegrationThe integration to be configured on this route.
routeKey๐Ÿ”นHttpRouteKeyThe key to this route.
authorizationScopes?๐Ÿ”นstring[]The list of OIDC scopes to include in the authorization.
authorizer?๐Ÿ”นIHttpRouteAuthorizerAuthorizer for a WebSocket API or an HTTP API.

httpApi๐Ÿ”น

Type: IHttpApi

the API the route is associated with.


integration๐Ÿ”น

Type: HttpRouteIntegration

The integration to be configured on this route.


routeKey๐Ÿ”น

Type: HttpRouteKey

The key to this route.

This is a combination of an HTTP method and an HTTP path.


authorizationScopes?๐Ÿ”น

Type: string[] (optional, default: no additional authorization scopes)

The list of OIDC scopes to include in the authorization.

These scopes will be merged with the scopes from the attached authorizer


authorizer?๐Ÿ”น

Type: IHttpRouteAuthorizer (optional, default: No authorizer)

Authorizer for a WebSocket API or an HTTP API.

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
httpApi๐Ÿ”นIHttpApiThe HTTP API associated with this route.
node๐Ÿ”นNodeThe tree node.
routeArn๐Ÿ”นstringReturns the arn of the route.
routeId๐Ÿ”นstringId of the Route.
stack๐Ÿ”นStackThe stack in which this resource is defined.
path?๐Ÿ”นstringReturns the path component of this HTTP route, undefined if the path is the catch-all route.

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.


httpApi๐Ÿ”น

Type: IHttpApi

The HTTP API associated with this route.


node๐Ÿ”น

Type: Node

The tree node.


routeArn๐Ÿ”น

Type: string

Returns the arn of the route.


routeId๐Ÿ”น

Type: string

Id of the Route.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


path?๐Ÿ”น

Type: string (optional)

Returns the path component of this HTTP route, undefined if the path is the catch-all route.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
grantInvoke(grantee, options?)๐Ÿ”นGrant access to invoke the route.
toString()๐Ÿ”นReturns a string representation of this construct.

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).


grantInvoke(grantee, options?)๐Ÿ”น

public grantInvoke(grantee: IGrantable, options?: GrantInvokeOptions): Grant

Parameters

  • grantee IGrantable
  • options GrantInvokeOptions

Returns

  • Grant

Grant access to invoke the route.

This method requires that the authorizer of the route is undefined or is an HttpIamAuthorizer.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.