Class CfnGatewayRoute
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.CfnGatewayRoute
- All Implemented Interfaces:
IInspectable,IGatewayRouteRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-12-01T16:02:14.008Z")
@Stability(Stable)
public class CfnGatewayRoute
extends CfnResource
implements IInspectable, IGatewayRouteRef, ITaggable
Creates a gateway route.
A gateway route is attached to a virtual gateway and routes traffic to an existing virtual service. If a route matches a request, it can distribute traffic to a target virtual service.
For more information about gateway routes, see Gateway 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.*;
CfnGatewayRoute cfnGatewayRoute = CfnGatewayRoute.Builder.create(this, "MyCfnGatewayRoute")
.meshName("meshName")
.spec(GatewayRouteSpecProperty.builder()
.grpcRoute(GrpcGatewayRouteProperty.builder()
.action(GrpcGatewayRouteActionProperty.builder()
.target(GatewayRouteTargetProperty.builder()
.virtualService(GatewayRouteVirtualServiceProperty.builder()
.virtualServiceName("virtualServiceName")
.build())
// the properties below are optional
.port(123)
.build())
// the properties below are optional
.rewrite(GrpcGatewayRouteRewriteProperty.builder()
.hostname(GatewayRouteHostnameRewriteProperty.builder()
.defaultTargetHostname("defaultTargetHostname")
.build())
.build())
.build())
.match(GrpcGatewayRouteMatchProperty.builder()
.hostname(GatewayRouteHostnameMatchProperty.builder()
.exact("exact")
.suffix("suffix")
.build())
.metadata(List.of(GrpcGatewayRouteMetadataProperty.builder()
.name("name")
// the properties below are optional
.invert(false)
.match(GatewayRouteMetadataMatchProperty.builder()
.exact("exact")
.prefix("prefix")
.range(GatewayRouteRangeMatchProperty.builder()
.end(123)
.start(123)
.build())
.regex("regex")
.suffix("suffix")
.build())
.build()))
.port(123)
.serviceName("serviceName")
.build())
.build())
.http2Route(HttpGatewayRouteProperty.builder()
.action(HttpGatewayRouteActionProperty.builder()
.target(GatewayRouteTargetProperty.builder()
.virtualService(GatewayRouteVirtualServiceProperty.builder()
.virtualServiceName("virtualServiceName")
.build())
// the properties below are optional
.port(123)
.build())
// the properties below are optional
.rewrite(HttpGatewayRouteRewriteProperty.builder()
.hostname(GatewayRouteHostnameRewriteProperty.builder()
.defaultTargetHostname("defaultTargetHostname")
.build())
.path(HttpGatewayRoutePathRewriteProperty.builder()
.exact("exact")
.build())
.prefix(HttpGatewayRoutePrefixRewriteProperty.builder()
.defaultPrefix("defaultPrefix")
.value("value")
.build())
.build())
.build())
.match(HttpGatewayRouteMatchProperty.builder()
.headers(List.of(HttpGatewayRouteHeaderProperty.builder()
.name("name")
// the properties below are optional
.invert(false)
.match(HttpGatewayRouteHeaderMatchProperty.builder()
.exact("exact")
.prefix("prefix")
.range(GatewayRouteRangeMatchProperty.builder()
.end(123)
.start(123)
.build())
.regex("regex")
.suffix("suffix")
.build())
.build()))
.hostname(GatewayRouteHostnameMatchProperty.builder()
.exact("exact")
.suffix("suffix")
.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()))
.build())
.build())
.httpRoute(HttpGatewayRouteProperty.builder()
.action(HttpGatewayRouteActionProperty.builder()
.target(GatewayRouteTargetProperty.builder()
.virtualService(GatewayRouteVirtualServiceProperty.builder()
.virtualServiceName("virtualServiceName")
.build())
// the properties below are optional
.port(123)
.build())
// the properties below are optional
.rewrite(HttpGatewayRouteRewriteProperty.builder()
.hostname(GatewayRouteHostnameRewriteProperty.builder()
.defaultTargetHostname("defaultTargetHostname")
.build())
.path(HttpGatewayRoutePathRewriteProperty.builder()
.exact("exact")
.build())
.prefix(HttpGatewayRoutePrefixRewriteProperty.builder()
.defaultPrefix("defaultPrefix")
.value("value")
.build())
.build())
.build())
.match(HttpGatewayRouteMatchProperty.builder()
.headers(List.of(HttpGatewayRouteHeaderProperty.builder()
.name("name")
// the properties below are optional
.invert(false)
.match(HttpGatewayRouteHeaderMatchProperty.builder()
.exact("exact")
.prefix("prefix")
.range(GatewayRouteRangeMatchProperty.builder()
.end(123)
.start(123)
.build())
.regex("regex")
.suffix("suffix")
.build())
.build()))
.hostname(GatewayRouteHostnameMatchProperty.builder()
.exact("exact")
.suffix("suffix")
.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()))
.build())
.build())
.priority(123)
.build())
.virtualGatewayName("virtualGatewayName")
// the properties below are optional
.gatewayRouteName("gatewayRouteName")
.meshOwner("meshOwner")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnGatewayRoute.static interfaceAn object representing the gateway route host name to match.static interfaceAn object representing the gateway route host name to rewrite.static interfaceAn object representing the method header to be matched.static interfaceAn object that represents the range of values to match on.static interfaceAn object that represents a gateway route specification.static interfaceAn object that represents a gateway route target.static interfaceAn object that represents the virtual service that traffic is routed to.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 representing the metadata of the gateway route.static interfaceAn object that represents a gRPC gateway route.static interfaceAn object that represents the gateway route to rewrite.static interfaceAn object that represents the action to take if a match is determined.static interfaceAn object that represents the method and value to match with the header value sent in a request.static interfaceAn object that represents the HTTP header in the gateway route.static interfaceAn object that represents the criteria for determining a request match.static interfaceAn object that represents the path to rewrite.static interfaceAn object representing the beginning characters of the route to rewrite.static interfaceAn object that represents an HTTP gateway route.static interfaceAn object representing the gateway route to rewrite.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 the query parameter in the request.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.interfaces.appmesh.IGatewayRouteRef
IGatewayRouteRef.Jsii$Default, IGatewayRouteRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.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
ConstructorsModifierConstructorDescriptionprotectedCfnGatewayRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnGatewayRoute(software.amazon.jsii.JsiiObjectRef objRef) CfnGatewayRoute(software.constructs.Construct scope, String id, CfnGatewayRouteProps props) Create a newAWS::AppMesh::GatewayRoute. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForGatewayRoute(IGatewayRouteRef resource) The full Amazon Resource Name (ARN) for the gateway route.The name of the gateway route.The name of the service mesh that the gateway route resides in.The AWS IAM account ID of the service mesh owner.The IAM account ID of the resource owner.The unique identifier for the gateway route.The name of the virtual gateway that the gateway route is associated with.The name of the gateway route.A reference to a GatewayRoute resource.The name of the service mesh that the resource resides in.The AWS IAM account ID of the service mesh owner.getSpec()The specifications of the gateway route.getTags()Tag Manager which manages the tags for this resource.Optional metadata that you can apply to the gateway route to assist with categorization and organization.The virtual gateway that the gateway route is associated with.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnGatewayRoute.renderProperties(Map<String, Object> props) voidsetGatewayRouteName(String value) The name of the gateway route.voidsetMeshName(String value) The name of the service mesh that the resource resides in.voidsetMeshOwner(String value) The AWS IAM account ID of the service mesh owner.voidsetSpec(IResolvable value) The specifications of the gateway route.voidThe specifications of the gateway route.voidsetTagsRaw(List<CfnTag> value) Optional metadata that you can apply to the gateway route to assist with categorization and organization.voidsetVirtualGatewayName(String value) The virtual gateway that the gateway route is associated with.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
-
CfnGatewayRoute
protected CfnGatewayRoute(software.amazon.jsii.JsiiObjectRef objRef) -
CfnGatewayRoute
protected CfnGatewayRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnGatewayRoute
@Stability(Stable) public CfnGatewayRoute(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnGatewayRouteProps props) Create a newAWS::AppMesh::GatewayRoute.- 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
-
arnForGatewayRoute
@Stability(Stable) @NotNull public static String arnForGatewayRoute(@NotNull IGatewayRouteRef resource) - Parameters:
resource- This parameter is required.
-
isCfnGatewayRoute
Checks whether the given object is a CfnGatewayRoute.- Parameters:
x- This parameter is required.
-
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 gateway route. -
getAttrGatewayRouteName
The name of the gateway route. -
getAttrId
-
getAttrMeshName
The name of the service mesh that the gateway 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 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 .
-
getAttrUid
The unique identifier for the gateway route. -
getAttrVirtualGatewayName
The name of the virtual gateway that the gateway route is associated with. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getGatewayRouteRef
A reference to a GatewayRoute resource.- Specified by:
getGatewayRouteRefin interfaceIGatewayRouteRef
-
getTags
Tag Manager which manages the tags for this resource. -
getMeshName
The name of the service mesh that the resource resides in. -
setMeshName
The name of the service mesh that the resource resides in. -
getSpec
The specifications of the gateway route.Returns union: either
IResolvableorCfnGatewayRoute.GatewayRouteSpecProperty -
setSpec
The specifications of the gateway route. -
setSpec
The specifications of the gateway route. -
getVirtualGatewayName
The virtual gateway that the gateway route is associated with. -
setVirtualGatewayName
The virtual gateway that the gateway route is associated with. -
getGatewayRouteName
The name of the gateway route. -
setGatewayRouteName
The name of the gateway route. -
getMeshOwner
The AWS IAM account ID of the service mesh owner. -
setMeshOwner
The AWS IAM account ID of the service mesh owner. -
getTagsRaw
Optional metadata that you can apply to the gateway route to assist with categorization and organization. -
setTagsRaw
Optional metadata that you can apply to the gateway route to assist with categorization and organization.
-