Class CfnGatewayRoute

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:53.074Z") @Stability(Stable) public class CfnGatewayRoute extends CfnResource implements IInspectable, 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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The full Amazon Resource Name (ARN) for the gateway route.
    • getAttrGatewayRouteName

      @Stability(Stable) @NotNull public String getAttrGatewayRouteName()
      The name of the gateway route.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getAttrMeshName

      @Stability(Stable) @NotNull public String getAttrMeshName()
      The name of the service mesh that the gateway route resides in.
    • getAttrMeshOwner

      @Stability(Stable) @NotNull public String 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

      @Stability(Stable) @NotNull public String 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

      @Stability(Stable) @NotNull public String getAttrUid()
      The unique identifier for the gateway route.
    • getAttrVirtualGatewayName

      @Stability(Stable) @NotNull public String getAttrVirtualGatewayName()
      The name of the virtual gateway that the gateway route is associated with.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getMeshName

      @Stability(Stable) @NotNull public String getMeshName()
      The name of the service mesh that the resource resides in.
    • setMeshName

      @Stability(Stable) public void setMeshName(@NotNull String value)
      The name of the service mesh that the resource resides in.
    • getSpec

      @Stability(Stable) @NotNull public Object getSpec()
      The specifications of the gateway route.
    • setSpec

      @Stability(Stable) public void setSpec(@NotNull IResolvable value)
      The specifications of the gateway route.
    • setSpec

      @Stability(Stable) public void setSpec(@NotNull CfnGatewayRoute.GatewayRouteSpecProperty value)
      The specifications of the gateway route.
    • getVirtualGatewayName

      @Stability(Stable) @NotNull public String getVirtualGatewayName()
      The virtual gateway that the gateway route is associated with.
    • setVirtualGatewayName

      @Stability(Stable) public void setVirtualGatewayName(@NotNull String value)
      The virtual gateway that the gateway route is associated with.
    • getGatewayRouteName

      @Stability(Stable) @Nullable public String getGatewayRouteName()
      The name of the gateway route.
    • setGatewayRouteName

      @Stability(Stable) public void setGatewayRouteName(@Nullable String value)
      The name of the gateway route.
    • getMeshOwner

      @Stability(Stable) @Nullable public String getMeshOwner()
      The AWS IAM account ID of the service mesh owner.
    • setMeshOwner

      @Stability(Stable) public void setMeshOwner(@Nullable String value)
      The AWS IAM account ID of the service mesh owner.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Optional metadata that you can apply to the gateway route to assist with categorization and organization.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      Optional metadata that you can apply to the gateway route to assist with categorization and organization.