amazonka-migration-hub-refactor-spaces-2.0: Amazon Migration Hub Refactor Spaces SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.MigrationHubReFactorSpaces.CreateRoute

Description

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:

  • 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 the service has a URL endpoint, and the endpoint resolves to a public IP address, Refactor Spaces routes traffic over the public internet.
  • 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.

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 Lambda functions, 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.

For Lambda endpoints, 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.

Refactor Spaces automatically resolves the public Domain Name System (DNS) names that are set in CreateServiceRequest$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.

For private URLS, a target group is created on the Elastic Load Balancing and the target group health check is run. The HealthCheckProtocol, HealthCheckPort, and HealthCheckPath are the same protocol, port, and path specified in the URL or health URL, if used. All other settings use the default values, as described in Health checks for your target groups. The health check is considered successful if at least one target within the target group transitions to a healthy state.

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.

Synopsis

Creating a Request

data CreateRoute Source #

See: newCreateRoute smart constructor.

Constructors

CreateRoute' 

Fields

  • clientToken :: Maybe Text

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

  • defaultRoute :: Maybe DefaultRouteInput

    Configuration for the default route type.

  • tags :: Maybe (Sensitive (HashMap Text Text))

    The tags to assign 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..

  • uriPathRoute :: Maybe UriPathRouteInput

    The configuration for the URI path route type.

  • applicationIdentifier :: Text

    The ID of the application within which the route is being created.

  • environmentIdentifier :: Text

    The ID of the environment in which the route is created.

  • routeType :: RouteType

    The route type of the route. DEFAULT indicates that 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 indicates a route that is based on a URI path.

  • serviceIdentifier :: Text

    The ID of the service in which the route is created. Traffic that matches this route is forwarded to this service.

Instances

Instances details
ToJSON CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

ToHeaders CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Methods

toHeaders :: CreateRoute -> [Header] #

ToPath CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

ToQuery CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

AWSRequest CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Associated Types

type AWSResponse CreateRoute #

Generic CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Associated Types

type Rep CreateRoute :: Type -> Type #

Show CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

NFData CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Methods

rnf :: CreateRoute -> () #

Eq CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Hashable CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

type AWSResponse CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

type Rep CreateRoute Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

type Rep CreateRoute = D1 ('MetaData "CreateRoute" "Amazonka.MigrationHubReFactorSpaces.CreateRoute" "amazonka-migration-hub-refactor-spaces-2.0-IgAA0SWWxlS8R7imIzpgpS" 'False) (C1 ('MetaCons "CreateRoute'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "clientToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "defaultRoute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DefaultRouteInput))) :*: (S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive (HashMap Text Text)))) :*: S1 ('MetaSel ('Just "uriPathRoute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe UriPathRouteInput)))) :*: ((S1 ('MetaSel ('Just "applicationIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "environmentIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "routeType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RouteType) :*: S1 ('MetaSel ('Just "serviceIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newCreateRoute Source #

Create a value of CreateRoute with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:clientToken:CreateRoute', createRoute_clientToken - A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

$sel:defaultRoute:CreateRoute', createRoute_defaultRoute - Configuration for the default route type.

CreateRoute, createRoute_tags - The tags to assign 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..

CreateRoute, createRoute_uriPathRoute - The configuration for the URI path route type.

$sel:applicationIdentifier:CreateRoute', createRoute_applicationIdentifier - The ID of the application within which the route is being created.

$sel:environmentIdentifier:CreateRoute', createRoute_environmentIdentifier - The ID of the environment in which the route is created.

CreateRoute, createRoute_routeType - The route type of the route. DEFAULT indicates that 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 indicates a route that is based on a URI path.

$sel:serviceIdentifier:CreateRoute', createRoute_serviceIdentifier - The ID of the service in which the route is created. Traffic that matches this route is forwarded to this service.

Request Lenses

createRoute_clientToken :: Lens' CreateRoute (Maybe Text) Source #

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

createRoute_defaultRoute :: Lens' CreateRoute (Maybe DefaultRouteInput) Source #

Configuration for the default route type.

createRoute_tags :: Lens' CreateRoute (Maybe (HashMap Text Text)) Source #

The tags to assign 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..

createRoute_uriPathRoute :: Lens' CreateRoute (Maybe UriPathRouteInput) Source #

The configuration for the URI path route type.

createRoute_applicationIdentifier :: Lens' CreateRoute Text Source #

The ID of the application within which the route is being created.

createRoute_environmentIdentifier :: Lens' CreateRoute Text Source #

The ID of the environment in which the route is created.

createRoute_routeType :: Lens' CreateRoute RouteType Source #

The route type of the route. DEFAULT indicates that 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 indicates a route that is based on a URI path.

createRoute_serviceIdentifier :: Lens' CreateRoute Text Source #

The ID of the service in which the route is created. Traffic that matches this route is forwarded to this service.

Destructuring the Response

data CreateRouteResponse Source #

See: newCreateRouteResponse smart constructor.

Constructors

CreateRouteResponse' 

Fields

Instances

Instances details
Generic CreateRouteResponse Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Associated Types

type Rep CreateRouteResponse :: Type -> Type #

Show CreateRouteResponse Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

NFData CreateRouteResponse Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

Methods

rnf :: CreateRouteResponse -> () #

Eq CreateRouteResponse Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

type Rep CreateRouteResponse Source # 
Instance details

Defined in Amazonka.MigrationHubReFactorSpaces.CreateRoute

type Rep CreateRouteResponse = D1 ('MetaData "CreateRouteResponse" "Amazonka.MigrationHubReFactorSpaces.CreateRoute" "amazonka-migration-hub-refactor-spaces-2.0-IgAA0SWWxlS8R7imIzpgpS" 'False) (C1 ('MetaCons "CreateRouteResponse'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "applicationId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "arn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "createdByAccountId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "createdTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: (S1 ('MetaSel ('Just "lastUpdatedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: S1 ('MetaSel ('Just "ownerAccountId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) :*: ((S1 ('MetaSel ('Just "routeId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "routeType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RouteType)) :*: S1 ('MetaSel ('Just "serviceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RouteState)) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive (HashMap Text Text))))) :*: (S1 ('MetaSel ('Just "uriPathRoute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe UriPathRouteInput)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))))

newCreateRouteResponse Source #

Create a value of CreateRouteResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateRouteResponse, createRouteResponse_applicationId - The ID of the application in which the route is created.

CreateRouteResponse, createRouteResponse_arn - The Amazon Resource Name (ARN) of the route. The format for this ARN is arn:aws:refactor-spaces:region:account-id:resource-type/resource-id . For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

CreateRouteResponse, createRouteResponse_createdByAccountId - The Amazon Web Services account ID of the route creator.

CreateRouteResponse, createRouteResponse_createdTime - A timestamp that indicates when the route is created.

CreateRouteResponse, createRouteResponse_lastUpdatedTime - A timestamp that indicates when the route was last updated.

CreateRouteResponse, createRouteResponse_ownerAccountId - The Amazon Web Services account ID of the route owner.

CreateRouteResponse, createRouteResponse_routeId - The unique identifier of the route.

CreateRoute, createRouteResponse_routeType - The route type of the route.

CreateRouteResponse, createRouteResponse_serviceId - The ID of service in which the route is created. Traffic that matches this route is forwarded to this service.

CreateRouteResponse, createRouteResponse_state - The current state of the route. Activation state only allows ACTIVE or INACTIVE as user inputs. FAILED is a route state that is system generated.

CreateRoute, createRouteResponse_tags - The tags assigned to the created route. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair.

CreateRoute, createRouteResponse_uriPathRoute - Configuration for the URI path route type.

$sel:httpStatus:CreateRouteResponse', createRouteResponse_httpStatus - The response's http status code.

Response Lenses

createRouteResponse_applicationId :: Lens' CreateRouteResponse (Maybe Text) Source #

The ID of the application in which the route is created.

createRouteResponse_arn :: Lens' CreateRouteResponse (Maybe Text) Source #

The Amazon Resource Name (ARN) of the route. The format for this ARN is arn:aws:refactor-spaces:region:account-id:resource-type/resource-id . For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

createRouteResponse_createdByAccountId :: Lens' CreateRouteResponse (Maybe Text) Source #

The Amazon Web Services account ID of the route creator.

createRouteResponse_createdTime :: Lens' CreateRouteResponse (Maybe UTCTime) Source #

A timestamp that indicates when the route is created.

createRouteResponse_lastUpdatedTime :: Lens' CreateRouteResponse (Maybe UTCTime) Source #

A timestamp that indicates when the route was last updated.

createRouteResponse_ownerAccountId :: Lens' CreateRouteResponse (Maybe Text) Source #

The Amazon Web Services account ID of the route owner.

createRouteResponse_routeId :: Lens' CreateRouteResponse (Maybe Text) Source #

The unique identifier of the route.

createRouteResponse_serviceId :: Lens' CreateRouteResponse (Maybe Text) Source #

The ID of service in which the route is created. Traffic that matches this route is forwarded to this service.

createRouteResponse_state :: Lens' CreateRouteResponse (Maybe RouteState) Source #

The current state of the route. Activation state only allows ACTIVE or INACTIVE as user inputs. FAILED is a route state that is system generated.

createRouteResponse_tags :: Lens' CreateRouteResponse (Maybe (HashMap Text Text)) Source #

The tags assigned to the created route. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair.