routes
Creates, updates, deletes, gets or lists a routes resource.
Overview
| Name | routes |
| Type | Resource |
| Id | aws.migration_hub_refactor_spaces.routes |
Fields
The following fields are returned by SELECT queries:
- get_route
- list_routes
| Name | Datatype | Description |
|---|---|---|
append_source_path | boolean | If set to true, this option appends the source path to the service URL endpoint. |
application_id | string | The ID of the application that the route belongs to. (pattern: <code>^app-[0-9A-Za-z]{10}$</code>) |
arn | string | The 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_id | string | The Amazon Web Services account ID of the route creator. (pattern: <code>^\d{12}$</code>) |
created_time | string (date-time) | The timestamp of when the route is created. |
environment_id | string | Unique identifier of the environment. (pattern: <code>^env-[0-9A-Za-z]{10}$</code>) |
error | object | Any error associated with the route resource. |
include_child_paths | boolean | Indicates 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_time | string (date-time) | A timestamp that indicates when the route was last updated. |
methods | array | A 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_id | string | The Amazon Web Services account ID of the route owner. (pattern: <code>^\d{12}$</code>) |
path_resource_to_id | object | A mapping of Amazon API Gateway path resources to resource IDs. |
route_id | string | The 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_type | string | The type of route. (DEFAULT, URI_PATH) |
service_id | string | The unique identifier of the service. (pattern: <code>^svc-[0-9A-Za-z]{10}$</code>) |
source_path | string | This 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.:-]+|{[a-zA-Z0-9.:-]+}))+$</code>) |
state | string | The current state of the route. (CREATING, ACTIVE, DELETING, FAILED, UPDATING, INACTIVE) |
tags | object | The 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. |
| Name | Datatype | Description |
|---|---|---|
append_source_path | boolean | If set to true, this option appends the source path to the service URL endpoint. |
application_id | string | The unique identifier of the application. (pattern: <code>^app-[0-9A-Za-z]{10}$</code>) |
arn | string | The 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_id | string | The Amazon Web Services account ID of the route creator. (pattern: <code>^\d{12}$</code>) |
created_time | string (date-time) | A timestamp that indicates when the route is created. |
environment_id | string | The unique identifier of the environment. (pattern: <code>^env-[0-9A-Za-z]{10}$</code>) |
error | object | Any error associated with the route resource. |
include_child_paths | boolean | Indicates 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_time | string (date-time) | A timestamp that indicates when the route was last updated. |
methods | array | A 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_id | string | The Amazon Web Services account ID of the route owner. (pattern: <code>^\d{12}$</code>) |
path_resource_to_id | object | A mapping of Amazon API Gateway path resources to resource IDs. |
route_id | string | The unique identifier of the route. (pattern: <code>^rte-[0-9A-Za-z]{10}$</code>) |
route_type | string | The route type of the route. (DEFAULT, URI_PATH) |
service_id | string | The unique identifier of the service. (pattern: <code>^svc-[0-9A-Za-z]{10}$</code>) |
source_path | string | This 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.:-]+|{[a-zA-Z0-9.:-]+}))+$</code>) |
state | string | The current state of the route. (CREATING, ACTIVE, DELETING, FAILED, UPDATING, INACTIVE) |
tags | object | The tags assigned to the route. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_route | select | application_identifier, environment_identifier, route_identifier, region | Gets an Amazon Web Services Migration Hub Refactor Spaces route. | |
list_routes | select | application_identifier, environment_identifier, region | maxResults, nextToken | Lists all the Amazon Web Services Migration Hub Refactor Spaces routes within an application. |
create_route | insert | application_identifier, environment_identifier, region, RouteType, ServiceIdentifier | 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. | |
update_route | update | application_identifier, environment_identifier, route_identifier, region, ActivationState | Updates an Amazon Web Services Migration Hub Refactor Spaces route. | |
delete_route | delete | application_identifier, environment_identifier, route_identifier, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
application_identifier | string | The ID of the application to delete the route from. |
environment_identifier | string | The ID of the environment to delete the route from. |
region | string | AWS region (default: us-east-1) |
route_identifier | string | The ID of the route to delete. |
maxResults | integer | The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. |
nextToken | string | The token for the next page of results. |
SELECT examples
- get_route
- list_routes
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
;
Lists all the Amazon Web Services Migration Hub Refactor Spaces routes within an application.
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 region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_route
- Manifest
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
;
# Description fields are for documentation purposes
- name: routes
props:
- name: application_identifier
value: "{{ application_identifier }}"
description: Required parameter for the routes resource.
- name: environment_identifier
value: "{{ environment_identifier }}"
description: Required parameter for the routes resource.
- name: region
value: "{{ region }}"
description: Required parameter for the routes resource.
- name: ClientToken
value: "{{ ClientToken }}"
- name: DefaultRoute
description: |
The configuration for the default route type.
value:
ActivationState: "{{ ActivationState }}"
- name: RouteType
value: "{{ RouteType }}"
valid_values: ['DEFAULT', 'URI_PATH']
- name: ServiceIdentifier
value: "{{ ServiceIdentifier }}"
- name: Tags
value: "{{ Tags }}"
description: |
A collection of up to 50 unique tags
- name: UriPathRoute
description: |
The configuration for the URI path route type.
value:
ActivationState: "{{ ActivationState }}"
AppendSourcePath: {{ AppendSourcePath }}
IncludeChildPaths: {{ IncludeChildPaths }}
Methods:
- "{{ Methods }}"
SourcePath: "{{ SourcePath }}"
UPDATE examples
- update_route
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
- delete_route
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
;