class Route (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppMesh.Route |
Java | software.amazon.awscdk.services.appmesh.Route |
Python | aws_cdk.aws_appmesh.Route |
TypeScript (source) | @aws-cdk/aws-appmesh » Route |
Implements
IConstruct
, 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 * as appmesh from '@aws-cdk/aws-appmesh';
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
Route
Props
Construct Props
Name | Type | Description |
---|---|---|
mesh | IMesh | The service mesh to define the route in. |
route | Route | Protocol specific spec. |
virtual | IVirtual | The VirtualRouter the Route belongs to. |
route | string | The name of the route. |
mesh
Type:
IMesh
The service mesh to define the route in.
routeSpec
Type:
Route
Protocol specific spec.
virtualRouter
Type:
IVirtual
The VirtualRouter the Route belongs to.
routeName?
Type:
string
(optional, default: An automatically generated name)
The name of the route.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
route | string | The Amazon Resource Name (ARN) for the route. |
route | string | The name of the Route. |
stack | Stack | The stack in which this resource is defined. |
virtual | IVirtual | The VirtualRouter the Route belongs to. |
env
Type:
Resource
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:
Construct
The construct tree node associated with this construct.
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:
IVirtual
The VirtualRouter the Route belongs to.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Import an existing Route given an ARN. |
static from | Import an existing Route given attributes. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
RouteArn(scope, id, routeArn)
static frompublic static fromRouteArn(scope: Construct, id: string, routeArn: string): IRoute
Parameters
- scope
Construct
- id
string
- routeArn
string
Returns
Import an existing Route given an ARN.
RouteAttributes(scope, id, attrs)
static frompublic static fromRouteAttributes(scope: Construct, id: string, attrs: RouteAttributes): IRoute
Parameters
- scope
Construct
- id
string
- attrs
Route
Attributes
Returns
Import an existing Route given attributes.