aws-cdk-lib.aws_appmesh.Route

class Route (construct)

LanguageType name
.NETAmazon.CDK.AWS.AppMesh.Route
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#Route
Javasoftware.amazon.awscdk.services.appmesh.Route
Pythonaws_cdk.aws_appmesh.Route
TypeScript (source)aws-cdk-lib » aws_appmesh » Route

Implements IConstruct, IDependable, IResource, IRoute

Route represents a new or existing route attached to a VirtualRouter and Mesh.

See also: https://docs.aws.amazon.com/app-mesh/latest/userguide/routes.html

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appmesh as appmesh } from 'aws-cdk-lib';

declare const mesh: appmesh.Mesh;
declare const routeSpec: appmesh.RouteSpec;
declare const virtualRouter: appmesh.VirtualRouter;
const route = new appmesh.Route(this, 'MyRoute', {
  mesh: mesh,
  routeSpec: routeSpec,
  virtualRouter: virtualRouter,

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

Initializer

new Route(scope: Construct, id: string, props: RouteProps)

Parameters

  • scope Construct
  • id string
  • props RouteProps

Construct Props

NameTypeDescription
meshIMeshThe service mesh to define the route in.
routeSpecRouteSpecProtocol specific spec.
virtualRouterIVirtualRouterThe VirtualRouter the Route belongs to.
routeName?stringThe name of the route.

mesh

Type: IMesh

The service mesh to define the route in.


routeSpec

Type: RouteSpec

Protocol specific spec.


virtualRouter

Type: IVirtualRouter

The VirtualRouter the Route belongs to.


routeName?

Type: string (optional, default: An automatically generated name)

The name of the route.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
routeArnstringThe Amazon Resource Name (ARN) for the route.
routeNamestringThe name of the Route.
stackStackThe stack in which this resource is defined.
virtualRouterIVirtualRouterThe VirtualRouter the Route belongs to.

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.


routeArn

Type: string

The Amazon Resource Name (ARN) for the route.


routeName

Type: string

The name of the Route.


stack

Type: Stack

The stack in which this resource is defined.


virtualRouter

Type: IVirtualRouter

The VirtualRouter the Route belongs to.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromRouteArn(scope, id, routeArn)Import an existing Route given an ARN.
static fromRouteAttributes(scope, id, attrs)Import an existing Route given attributes.

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 fromRouteArn(scope, id, routeArn)

public static fromRouteArn(scope: Construct, id: string, routeArn: string): IRoute

Parameters

  • scope Construct
  • id string
  • routeArn string

Returns

  • IRoute

Import an existing Route given an ARN.


static fromRouteAttributes(scope, id, attrs)

public static fromRouteAttributes(scope: Construct, id: string, attrs: RouteAttributes): IRoute

Parameters

  • scope Construct
  • id string
  • attrs RouteAttributes

Returns

  • IRoute

Import an existing Route given attributes.