Class CfnRoute
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.appmesh.CfnRoute
- All Implemented Interfaces:
IInspectable,IRouteRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:45.051Z")
@Stability(Stable)
public class CfnRoute
extends CfnResource
implements IInspectable, IRouteRef, ITaggable
Creates a route that is associated with a virtual router.
You can route several different protocols and define a retry policy for a route. Traffic can be routed to one or more virtual nodes.
For more information about routes, see Routes .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appmesh.*;
CfnRoute cfnRoute = CfnRoute.Builder.create(this, "MyCfnRoute")
.meshName("meshName")
.spec(RouteSpecProperty.builder()
.grpcRoute(GrpcRouteProperty.builder()
.action(GrpcRouteActionProperty.builder()
.weightedTargets(List.of(WeightedTargetProperty.builder()
.virtualNode("virtualNode")
.weight(123)
// the properties below are optional
.port(123)
.build()))
.build())
.match(GrpcRouteMatchProperty.builder()
.metadata(List.of(GrpcRouteMetadataProperty.builder()
.name("name")
// the properties below are optional
.invert(false)
.match(GrpcRouteMetadataMatchMethodProperty.builder()
.exact("exact")
.prefix("prefix")
.range(MatchRangeProperty.builder()
.end(123)
.start(123)
.build())
.regex("regex")
.suffix("suffix")
.build())
.build()))
.methodName("methodName")
.port(123)
.serviceName("serviceName")
.build())
// the properties below are optional
.retryPolicy(GrpcRetryPolicyProperty.builder()
.maxRetries(123)
.perRetryTimeout(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
// the properties below are optional
.grpcRetryEvents(List.of("grpcRetryEvents"))
.httpRetryEvents(List.of("httpRetryEvents"))
.tcpRetryEvents(List.of("tcpRetryEvents"))
.build())
.timeout(GrpcTimeoutProperty.builder()
.idle(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.perRequest(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.build())
.build())
.http2Route(HttpRouteProperty.builder()
.action(HttpRouteActionProperty.builder()
.weightedTargets(List.of(WeightedTargetProperty.builder()
.virtualNode("virtualNode")
.weight(123)
// the properties below are optional
.port(123)
.build()))
.build())
.match(HttpRouteMatchProperty.builder()
.headers(List.of(HttpRouteHeaderProperty.builder()
.name("name")
// the properties below are optional
.invert(false)
.match(HeaderMatchMethodProperty.builder()
.exact("exact")
.prefix("prefix")
.range(MatchRangeProperty.builder()
.end(123)
.start(123)
.build())
.regex("regex")
.suffix("suffix")
.build())
.build()))
.method("method")
.path(HttpPathMatchProperty.builder()
.exact("exact")
.regex("regex")
.build())
.port(123)
.prefix("prefix")
.queryParameters(List.of(QueryParameterProperty.builder()
.name("name")
// the properties below are optional
.match(HttpQueryParameterMatchProperty.builder()
.exact("exact")
.build())
.build()))
.scheme("scheme")
.build())
// the properties below are optional
.retryPolicy(HttpRetryPolicyProperty.builder()
.maxRetries(123)
.perRetryTimeout(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
// the properties below are optional
.httpRetryEvents(List.of("httpRetryEvents"))
.tcpRetryEvents(List.of("tcpRetryEvents"))
.build())
.timeout(HttpTimeoutProperty.builder()
.idle(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.perRequest(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.build())
.build())
.httpRoute(HttpRouteProperty.builder()
.action(HttpRouteActionProperty.builder()
.weightedTargets(List.of(WeightedTargetProperty.builder()
.virtualNode("virtualNode")
.weight(123)
// the properties below are optional
.port(123)
.build()))
.build())
.match(HttpRouteMatchProperty.builder()
.headers(List.of(HttpRouteHeaderProperty.builder()
.name("name")
// the properties below are optional
.invert(false)
.match(HeaderMatchMethodProperty.builder()
.exact("exact")
.prefix("prefix")
.range(MatchRangeProperty.builder()
.end(123)
.start(123)
.build())
.regex("regex")
.suffix("suffix")
.build())
.build()))
.method("method")
.path(HttpPathMatchProperty.builder()
.exact("exact")
.regex("regex")
.build())
.port(123)
.prefix("prefix")
.queryParameters(List.of(QueryParameterProperty.builder()
.name("name")
// the properties below are optional
.match(HttpQueryParameterMatchProperty.builder()
.exact("exact")
.build())
.build()))
.scheme("scheme")
.build())
// the properties below are optional
.retryPolicy(HttpRetryPolicyProperty.builder()
.maxRetries(123)
.perRetryTimeout(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
// the properties below are optional
.httpRetryEvents(List.of("httpRetryEvents"))
.tcpRetryEvents(List.of("tcpRetryEvents"))
.build())
.timeout(HttpTimeoutProperty.builder()
.idle(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.perRequest(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.build())
.build())
.priority(123)
.tcpRoute(TcpRouteProperty.builder()
.action(TcpRouteActionProperty.builder()
.weightedTargets(List.of(WeightedTargetProperty.builder()
.virtualNode("virtualNode")
.weight(123)
// the properties below are optional
.port(123)
.build()))
.build())
// the properties below are optional
.match(TcpRouteMatchProperty.builder()
.port(123)
.build())
.timeout(TcpTimeoutProperty.builder()
.idle(DurationProperty.builder()
.unit("unit")
.value(123)
.build())
.build())
.build())
.build())
.virtualRouterName("virtualRouterName")
// the properties below are optional
.meshOwner("meshOwner")
.routeName("routeName")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnRoute.static interfaceAn object that represents a duration of time.static interfaceAn object that represents a retry policy.static interfaceAn object that represents the action to take if a match is determined.static interfaceAn object that represents the criteria for determining a request match.static interfaceAn object that represents the match method.static interfaceAn object that represents the match metadata for the route.static interfaceAn object that represents a gRPC route type.static interfaceAn object that represents types of timeouts.static interfaceAn object that represents the method and value to match with the header value sent in a request.static interfaceAn object representing the path to match in the request.static interfaceAn object representing the query parameter to match.static interfaceAn object that represents a retry policy.static interfaceAn object that represents the action to take if a match is determined.static interfaceAn object that represents the HTTP header in the request.static interfaceAn object that represents the requirements for a route to match HTTP requests for a virtual router.static interfaceAn object that represents an HTTP or HTTP/2 route type.static interfaceAn object that represents types of timeouts.static interfaceAn object that represents the range of values to match on.static interfaceAn object that represents the query parameter in the request.static interfaceAn object that represents a route specification.static interfaceAn object that represents the action to take if a match is determined.static interfaceAn object representing the TCP route to match.static interfaceAn object that represents a TCP route type.static interfaceAn object that represents types of timeouts.static interfaceAn object that represents a target and its relative weight.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.appmesh.IRouteRef
IRouteRef.Jsii$Default, IRouteRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRoute(software.amazon.jsii.JsiiObjectRef objRef) CfnRoute(software.constructs.Construct scope, String id, CfnRouteProps props) Create a newAWS::AppMesh::Route. -
Method Summary
Modifier and TypeMethodDescriptionThe full Amazon Resource Name (ARN) for the route.The name of the service mesh that the route resides in.The AWS IAM account ID of the service mesh owner.The AWS IAM account ID of the resource owner.The name of the route.The unique identifier for the route.The name of the virtual router that the route is associated with.The name of the service mesh to create the route in.The AWS IAM account ID of the service mesh owner.The name to use for the route.A reference to a Route resource.getSpec()The route specification to apply.getTags()Tag Manager which manages the tags for this resource.Optional metadata that you can apply to the route to assist with categorization and organization.The name of the virtual router in which to create the route.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetMeshName(String value) The name of the service mesh to create the route in.voidsetMeshOwner(String value) The AWS IAM account ID of the service mesh owner.voidsetRouteName(String value) The name to use for the route.voidsetSpec(IResolvable value) The route specification to apply.voidThe route specification to apply.voidsetTagsRaw(List<CfnTag> value) Optional metadata that you can apply to the route to assist with categorization and organization.voidsetVirtualRouterName(String value) The name of the virtual router in which to create the route.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRoute
protected CfnRoute(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRoute
protected CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRoute
@Stability(Stable) public CfnRoute(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnRouteProps props) Create a newAWS::AppMesh::Route.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The full Amazon Resource Name (ARN) for the route. -
getAttrId
-
getAttrMeshName
The name of the service mesh that the route resides in. -
getAttrMeshOwner
The AWS IAM account ID of the service mesh owner.If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with Shared Meshes .
-
getAttrResourceOwner
The AWS IAM account ID of the resource owner.If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see Working with Shared Meshes .
-
getAttrRouteName
The name of the route. -
getAttrUid
The unique identifier for the route. -
getAttrVirtualRouterName
The name of the virtual router that the route is associated with. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getRouteRef
A reference to a Route resource.- Specified by:
getRouteRefin interfaceIRouteRef
-
getTags
Tag Manager which manages the tags for this resource. -
getMeshName
The name of the service mesh to create the route in. -
setMeshName
The name of the service mesh to create the route in. -
getSpec
The route specification to apply.Returns union: either
IResolvableorCfnRoute.RouteSpecProperty -
setSpec
The route specification to apply. -
setSpec
The route specification to apply. -
getVirtualRouterName
The name of the virtual router in which to create the route. -
setVirtualRouterName
The name of the virtual router in which to create the route. -
getMeshOwner
The AWS IAM account ID of the service mesh owner. -
setMeshOwner
The AWS IAM account ID of the service mesh owner. -
getRouteName
The name to use for the route. -
setRouteName
The name to use for the route. -
getTagsRaw
Optional metadata that you can apply to the route to assist with categorization and organization. -
setTagsRaw
Optional metadata that you can apply to the route to assist with categorization and organization.
-