Skip to main content

routes

Creates, updates, deletes, gets or lists a routes resource.

Overview

Nameroutes
TypeResource
Idaws.migration_hub_refactor_spaces.routes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
append_source_pathbooleanIf set to true, this option appends the source path to the service URL endpoint.
application_idstringThe ID of the application that the route belongs to. (pattern: <code>^app-[0-9A-Za-z]{10}$</code>)
arnstringThe Amazon Resource Name (ARN) of the route. (pattern: <code>^arn:aws:refactor-spaces:[a-zA-Z0-9-]+:\w{12}:[a-zA-Z_0-9+=,.@-_/]+$</code>)
created_by_account_idstringThe Amazon Web Services account ID of the route creator. (pattern: <code>^\d{12}$</code>)
created_timestring (date-time)The timestamp of when the route is created.
environment_idstringUnique identifier of the environment. (pattern: <code>^env-[0-9A-Za-z]{10}$</code>)
errorobjectAny error associated with the route resource.
include_child_pathsbooleanIndicates whether to match all subpaths of the given source path. If this value is false, requests must match the source path exactly before they are forwarded to this route's service.
last_updated_timestring (date-time)A timestamp that indicates when the route was last updated.
methodsarrayA list of HTTP methods to match. An empty list matches all values. If a method is present, only HTTP requests using that method are forwarded to this route’s service.
owner_account_idstringThe Amazon Web Services account ID of the route owner. (pattern: <code>^\d{12}$</code>)
path_resource_to_idobjectA mapping of Amazon API Gateway path resources to resource IDs.
route_idstringThe unique identifier of the route. DEFAULT: All traffic that does not match another route is forwarded to the default route. Applications must have a default route before any other routes can be created. URI_PATH: A route that is based on a URI path. (pattern: <code>^rte-[0-9A-Za-z]{10}$</code>)
route_typestringThe type of route. (DEFAULT, URI_PATH)
service_idstringThe unique identifier of the service. (pattern: <code>^svc-[0-9A-Za-z]{10}$</code>)
source_pathstringThis is the path that Refactor Spaces uses to match traffic. Paths must start with / and are relative to the base of the application. To use path parameters in the source path, add a variable in curly braces. For example, the resource path {user} represents a path parameter called 'user'. (pattern: <code>^(/([a-zA-Z0-9.:-]+|&#123;[a-zA-Z0-9.:-]+&#125;))+$</code>)
statestringThe current state of the route. (CREATING, ACTIVE, DELETING, FAILED, UPDATING, INACTIVE)
tagsobjectThe tags assigned to the route. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_routeselectapplication_identifier, environment_identifier, route_identifier, regionGets an Amazon Web Services Migration Hub Refactor Spaces route.
list_routesselectapplication_identifier, environment_identifier, regionmaxResults, nextTokenLists all the Amazon Web Services Migration Hub Refactor Spaces routes within an application.
create_routeinsertapplication_identifier, environment_identifier, region, RouteType, ServiceIdentifierCreates an Amazon Web Services Migration Hub Refactor Spaces route. The account owner of the service resource is always the environment owner, regardless of which account creates the route. Routes target a service in the application. If an application does not have any routes, then the first route must be created as a DEFAULT RouteType. When created, the default route defaults to an active state so state is not a required input. However, like all other state values the state of the default route can be updated after creation, but only when all other routes are also inactive. Conversely, no route can be active without the default route also being active. When you create a route, Refactor Spaces configures the Amazon API Gateway to send traffic to the target service as follows: URL Endpoints If the service has a URL endpoint, and the endpoint resolves to a private IP address, Refactor Spaces routes traffic using the API Gateway VPC link. If a service endpoint resolves to a public IP address, Refactor Spaces routes traffic over the public internet. Services can have HTTP or HTTPS URL endpoints. For HTTPS URLs, publicly-signed certificates are supported. Private Certificate Authorities (CAs) are permitted only if the CA's domain is also publicly resolvable. Refactor Spaces automatically resolves the public Domain Name System (DNS) names that are set in CreateService:UrlEndpoint when you create a service. The DNS names resolve when the DNS time-to-live (TTL) expires, or every 60 seconds for TTLs less than 60 seconds. This periodic DNS resolution ensures that the route configuration remains up-to-date. One-time health check A one-time health check is performed on the service when either the route is updated from inactive to active, or when it is created with an active state. If the health check fails, the route transitions the route state to FAILED, an error code of SERVICE_ENDPOINT_HEALTH_CHECK_FAILURE is provided, and no traffic is sent to the service. For private URLs, a target group is created on the Network Load Balancer and the load balancer target group runs default target health checks. By default, the health check is run against the service endpoint URL. Optionally, the health check can be performed against a different protocol, port, and/or path using the CreateService:UrlEndpoint parameter. All other health check settings for the load balancer use the default values described in the Health checks for your target groups in the Elastic Load Balancing guide. The health check is considered successful if at least one target within the target group transitions to a healthy state. Lambda function endpoints If the service has an Lambda function endpoint, then Refactor Spaces configures the Lambda function's resource policy to allow the application's API Gateway to invoke the function. The Lambda function state is checked. If the function is not active, the function configuration is updated so that Lambda resources are provisioned. If the Lambda state is Failed, then the route creation fails. For more information, see the GetFunctionConfiguration's State response parameter in the Lambda Developer Guide. A check is performed to determine that a Lambda function with the specified ARN exists. If it does not exist, the health check fails. For public URLs, a connection is opened to the public endpoint. If the URL is not reachable, the health check fails. Environments without a network bridge When you create environments without a network bridge (CreateEnvironment:NetworkFabricType is NONE) and you use your own networking infrastructure, you need to configure VPC to VPC connectivity between your network and the application proxy VPC. Route creation from the application proxy to service endpoints will fail if your network is not configured to connect to the application proxy VPC. For more information, see Create a route in the Refactor Spaces User Guide.
update_routeupdateapplication_identifier, environment_identifier, route_identifier, region, ActivationStateUpdates an Amazon Web Services Migration Hub Refactor Spaces route.
delete_routedeleteapplication_identifier, environment_identifier, route_identifier, regionDeletes an Amazon Web Services Migration Hub Refactor Spaces route.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
application_identifierstringThe ID of the application to delete the route from.
environment_identifierstringThe ID of the environment to delete the route from.
regionstringAWS region (default: us-east-1)
route_identifierstringThe ID of the route to delete.
maxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
nextTokenstringThe token for the next page of results.

SELECT examples

Gets an Amazon Web Services Migration Hub Refactor Spaces route.

SELECT
append_source_path,
application_id,
arn,
created_by_account_id,
created_time,
environment_id,
error,
include_child_paths,
last_updated_time,
methods,
owner_account_id,
path_resource_to_id,
route_id,
route_type,
service_id,
source_path,
state,
tags
FROM aws.migration_hub_refactor_spaces.routes
WHERE application_identifier = '{{ application_identifier }}' -- required
AND environment_identifier = '{{ environment_identifier }}' -- required
AND route_identifier = '{{ route_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an Amazon Web Services Migration Hub Refactor Spaces route. The account owner of the service resource is always the environment owner, regardless of which account creates the route. Routes target a service in the application. If an application does not have any routes, then the first route must be created as a DEFAULT RouteType. When created, the default route defaults to an active state so state is not a required input. However, like all other state values the state of the default route can be updated after creation, but only when all other routes are also inactive. Conversely, no route can be active without the default route also being active. When you create a route, Refactor Spaces configures the Amazon API Gateway to send traffic to the target service as follows: URL Endpoints If the service has a URL endpoint, and the endpoint resolves to a private IP address, Refactor Spaces routes traffic using the API Gateway VPC link. If a service endpoint resolves to a public IP address, Refactor Spaces routes traffic over the public internet. Services can have HTTP or HTTPS URL endpoints. For HTTPS URLs, publicly-signed certificates are supported. Private Certificate Authorities (CAs) are permitted only if the CA's domain is also publicly resolvable. Refactor Spaces automatically resolves the public Domain Name System (DNS) names that are set in CreateService:UrlEndpoint when you create a service. The DNS names resolve when the DNS time-to-live (TTL) expires, or every 60 seconds for TTLs less than 60 seconds. This periodic DNS resolution ensures that the route configuration remains up-to-date. One-time health check A one-time health check is performed on the service when either the route is updated from inactive to active, or when it is created with an active state. If the health check fails, the route transitions the route state to FAILED, an error code of SERVICE_ENDPOINT_HEALTH_CHECK_FAILURE is provided, and no traffic is sent to the service. For private URLs, a target group is created on the Network Load Balancer and the load balancer target group runs default target health checks. By default, the health check is run against the service endpoint URL. Optionally, the health check can be performed against a different protocol, port, and/or path using the CreateService:UrlEndpoint parameter. All other health check settings for the load balancer use the default values described in the Health checks for your target groups in the Elastic Load Balancing guide. The health check is considered successful if at least one target within the target group transitions to a healthy state. Lambda function endpoints If the service has an Lambda function endpoint, then Refactor Spaces configures the Lambda function's resource policy to allow the application's API Gateway to invoke the function. The Lambda function state is checked. If the function is not active, the function configuration is updated so that Lambda resources are provisioned. If the Lambda state is Failed, then the route creation fails. For more information, see the GetFunctionConfiguration's State response parameter in the Lambda Developer Guide. A check is performed to determine that a Lambda function with the specified ARN exists. If it does not exist, the health check fails. For public URLs, a connection is opened to the public endpoint. If the URL is not reachable, the health check fails. Environments without a network bridge When you create environments without a network bridge (CreateEnvironment:NetworkFabricType is NONE) and you use your own networking infrastructure, you need to configure VPC to VPC connectivity between your network and the application proxy VPC. Route creation from the application proxy to service endpoints will fail if your network is not configured to connect to the application proxy VPC. For more information, see Create a route in the Refactor Spaces User Guide.

INSERT INTO aws.migration_hub_refactor_spaces.routes (
ClientToken,
DefaultRoute,
RouteType,
ServiceIdentifier,
Tags,
UriPathRoute,
application_identifier,
environment_identifier,
region
)
SELECT
'{{ ClientToken }}',
'{{ DefaultRoute }}',
'{{ RouteType }}' /* required */,
'{{ ServiceIdentifier }}' /* required */,
'{{ Tags }}',
'{{ UriPathRoute }}',
'{{ application_identifier }}',
'{{ environment_identifier }}',
'{{ region }}'
RETURNING
application_id,
arn,
created_by_account_id,
created_time,
last_updated_time,
owner_account_id,
route_id,
route_type,
service_id,
state,
tags,
uri_path_route
;

UPDATE examples

Updates an Amazon Web Services Migration Hub Refactor Spaces route.

UPDATE aws.migration_hub_refactor_spaces.routes
SET
ActivationState = '{{ ActivationState }}'
WHERE
application_identifier = '{{ application_identifier }}' --required
AND environment_identifier = '{{ environment_identifier }}' --required
AND route_identifier = '{{ route_identifier }}' --required
AND region = '{{ region }}' --required
AND ActivationState = '{{ ActivationState }}' --required
RETURNING
application_id,
arn,
last_updated_time,
route_id,
service_id,
state;

DELETE examples

Deletes an Amazon Web Services Migration Hub Refactor Spaces route.

DELETE FROM aws.migration_hub_refactor_spaces.routes
WHERE application_identifier = '{{ application_identifier }}' --required
AND environment_identifier = '{{ environment_identifier }}' --required
AND route_identifier = '{{ route_identifier }}' --required
AND region = '{{ region }}' --required
;