@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)", date="2022-06-22T23:28:00.306Z") public class CfnRoute extends CfnResource implements IInspectable
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) .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") .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) .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()) .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) .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()) .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) .build())) .build()) // the properties below are optional .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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnRoute.Builder
A fluent builder for
CfnRoute . |
static interface |
CfnRoute.DurationProperty
An object that represents a duration of time.
|
static interface |
CfnRoute.GrpcRetryPolicyProperty
An object that represents a retry policy.
|
static interface |
CfnRoute.GrpcRouteActionProperty
An object that represents the action to take if a match is determined.
|
static interface |
CfnRoute.GrpcRouteMatchProperty
An object that represents the criteria for determining a request match.
|
static interface |
CfnRoute.GrpcRouteMetadataMatchMethodProperty
An object that represents the match method.
|
static interface |
CfnRoute.GrpcRouteMetadataProperty
An object that represents the match metadata for the route.
|
static interface |
CfnRoute.GrpcRouteProperty
An object that represents a gRPC route type.
|
static interface |
CfnRoute.GrpcTimeoutProperty
An object that represents types of timeouts.
|
static interface |
CfnRoute.HeaderMatchMethodProperty
An object that represents the method and value to match with the header value sent in a request.
|
static interface |
CfnRoute.HttpPathMatchProperty
An object representing the path to match in the request.
|
static interface |
CfnRoute.HttpQueryParameterMatchProperty
An object representing the query parameter to match.
|
static interface |
CfnRoute.HttpRetryPolicyProperty
An object that represents a retry policy.
|
static interface |
CfnRoute.HttpRouteActionProperty
An object that represents the action to take if a match is determined.
|
static interface |
CfnRoute.HttpRouteHeaderProperty
An object that represents the HTTP header in the request.
|
static interface |
CfnRoute.HttpRouteMatchProperty
An object that represents the requirements for a route to match HTTP requests for a virtual router.
|
static interface |
CfnRoute.HttpRouteProperty
An object that represents an HTTP or HTTP/2 route type.
|
static interface |
CfnRoute.HttpTimeoutProperty
An object that represents types of timeouts.
|
static interface |
CfnRoute.MatchRangeProperty
An object that represents the range of values to match on.
|
static interface |
CfnRoute.QueryParameterProperty
An object that represents the query parameter in the request.
|
static interface |
CfnRoute.RouteSpecProperty
An object that represents a route specification.
|
static interface |
CfnRoute.TcpRouteActionProperty
An object that represents the action to take if a match is determined.
|
static interface |
CfnRoute.TcpRouteProperty
An object that represents a TCP route type.
|
static interface |
CfnRoute.TcpTimeoutProperty
An object that represents types of timeouts.
|
static interface |
CfnRoute.WeightedTargetProperty
An object that represents a target and its relative weight.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnRoute(Construct scope,
java.lang.String id,
CfnRouteProps props)
Create a new `AWS::AppMesh::Route`.
|
protected |
CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnRoute(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
The full Amazon Resource Name (ARN) for the route.
|
java.lang.String |
getAttrMeshName()
The name of the service mesh that the route resides in.
|
java.lang.String |
getAttrMeshOwner()
The AWS IAM account ID of the service mesh owner.
|
java.lang.String |
getAttrResourceOwner()
The AWS IAM account ID of the resource owner.
|
java.lang.String |
getAttrRouteName()
The name of the route.
|
java.lang.String |
getAttrUid()
The unique identifier for the route.
|
java.lang.String |
getAttrVirtualRouterName()
The name of the virtual router that the route is associated with.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getMeshName()
The name of the service mesh to create the route in.
|
java.lang.String |
getMeshOwner()
The AWS IAM account ID of the service mesh owner.
|
java.lang.String |
getRouteName()
The name to use for the route.
|
java.lang.Object |
getSpec()
The route specification to apply.
|
TagManager |
getTags()
Optional metadata that you can apply to the route to assist with categorization and organization.
|
java.lang.String |
getVirtualRouterName()
The name of the virtual router in which to create the route.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setMeshName(java.lang.String value)
The name of the service mesh to create the route in.
|
void |
setMeshOwner(java.lang.String value)
The AWS IAM account ID of the service mesh owner.
|
void |
setRouteName(java.lang.String value)
The name to use for the route.
|
void |
setSpec(CfnRoute.RouteSpecProperty value)
The route specification to apply.
|
void |
setSpec(IResolvable value)
The route specification to apply.
|
void |
setVirtualRouterName(java.lang.String value)
The name of the virtual router in which to create the route.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnRoute(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnRoute(Construct scope, java.lang.String id, CfnRouteProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
public java.lang.String getAttrMeshName()
public java.lang.String getAttrMeshOwner()
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 .
public java.lang.String getAttrResourceOwner()
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 .
public java.lang.String getAttrRouteName()
public java.lang.String getAttrUid()
public java.lang.String getAttrVirtualRouterName()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
public java.lang.String getMeshName()
public void setMeshName(java.lang.String value)
public java.lang.Object getSpec()
public void setSpec(IResolvable value)
public void setSpec(CfnRoute.RouteSpecProperty value)
public java.lang.String getVirtualRouterName()
If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.
public void setVirtualRouterName(java.lang.String value)
If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.
public java.lang.String getMeshOwner()
If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see Working with shared meshes .
public void setMeshOwner(java.lang.String value)
If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see Working with shared meshes .
public java.lang.String getRouteName()
public void setRouteName(java.lang.String value)