Class CfnRoute

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.101.0 (build b95fe5d)", date="2024-07-12T19:33:57.369Z") @Stability(Stable) public class CfnRoute extends CfnResource implements IInspectable, 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:
  • 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

    • 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)
      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 route.
    • getAttrId

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

      @Stability(Stable) @NotNull public String getAttrMeshName()
      The name of the service mesh that the 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 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

      @Stability(Stable) @NotNull public String getAttrRouteName()
      The name of the route.
    • getAttrUid

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

      @Stability(Stable) @NotNull public String getAttrVirtualRouterName()
      The name of the virtual router that the 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 to create the route in.
    • setMeshName

      @Stability(Stable) public void setMeshName(@NotNull String value)
      The name of the service mesh to create the route in.
    • getSpec

      @Stability(Stable) @NotNull public Object getSpec()
      The route specification to apply.
    • setSpec

      @Stability(Stable) public void setSpec(@NotNull IResolvable value)
      The route specification to apply.
    • setSpec

      @Stability(Stable) public void setSpec(@NotNull CfnRoute.RouteSpecProperty value)
      The route specification to apply.
    • getVirtualRouterName

      @Stability(Stable) @NotNull public String getVirtualRouterName()
      The name of the virtual router in which to create the route.
    • setVirtualRouterName

      @Stability(Stable) public void setVirtualRouterName(@NotNull String value)
      The name of the virtual router in which to create the 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.
    • getRouteName

      @Stability(Stable) @Nullable public String getRouteName()
      The name to use for the route.
    • setRouteName

      @Stability(Stable) public void setRouteName(@Nullable String value)
      The name to use for the route.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Optional metadata that you can apply to the 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 route to assist with categorization and organization.