class GatewayRoute (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppMesh.GatewayRoute |
Java | software.amazon.awscdk.services.appmesh.GatewayRoute |
Python | aws_cdk.aws_appmesh.GatewayRoute |
TypeScript (source) | @aws-cdk/aws-appmesh » GatewayRoute |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IGateway
GatewayRoute represents a new or existing gateway route attached to a VirtualGateway and Mesh.
See also: https://docs.aws.amazon.com/app-mesh/latest/userguide/gateway-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 gatewayRouteSpec: appmesh.GatewayRouteSpec;
declare const virtualGateway: appmesh.VirtualGateway;
const gatewayRoute = new appmesh.GatewayRoute(this, 'MyGatewayRoute', {
routeSpec: gatewayRouteSpec,
virtualGateway: virtualGateway,
// the properties below are optional
gatewayRouteName: 'gatewayRouteName',
});
Initializer
new GatewayRoute(scope: Construct, id: string, props: GatewayRouteProps)
Parameters
- scope
Construct
- id
string
- props
Gateway
Route Props
Construct Props
Name | Type | Description |
---|---|---|
route | Gateway | What protocol the route uses. |
virtual | IVirtual | The VirtualGateway this GatewayRoute is associated with. |
gateway | string | The name of the GatewayRoute. |
routeSpec
Type:
Gateway
What protocol the route uses.
virtualGateway
Type:
IVirtual
The VirtualGateway this GatewayRoute is associated with.
gatewayRouteName?
Type:
string
(optional, default: an automatically generated name)
The name of the GatewayRoute.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
gateway | string | The Amazon Resource Name (ARN) for the GatewayRoute. |
gateway | string | The name of the GatewayRoute. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
virtual | IVirtual | The VirtualGateway this GatewayRoute is a part of. |
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.
gatewayRouteArn
Type:
string
The Amazon Resource Name (ARN) for the GatewayRoute.
gatewayRouteName
Type:
string
The name of the GatewayRoute.
node
Type:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
virtualGateway
Type:
IVirtual
The VirtualGateway this GatewayRoute is a part of.
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 GatewayRoute given an ARN. |
static from | Import an existing GatewayRoute 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.
GatewayRouteArn(scope, id, gatewayRouteArn)
static frompublic static fromGatewayRouteArn(scope: Construct, id: string, gatewayRouteArn: string): IGatewayRoute
Parameters
- scope
Construct
- id
string
- gatewayRouteArn
string
Returns
Import an existing GatewayRoute given an ARN.
GatewayRouteAttributes(scope, id, attrs)
static frompublic static fromGatewayRouteAttributes(scope: Construct, id: string, attrs: GatewayRouteAttributes): IGatewayRoute
Parameters
- scope
Construct
- id
string
- attrs
Gateway
Route Attributes
Returns
Import an existing GatewayRoute given attributes.