Skip to main content

environments

Creates, updates, deletes, gets or lists an environments resource.

Overview

Nameenvironments
TypeResource
Idaws.migration_hub_refactor_spaces.environments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the environment. (pattern: <code>^arn:aws:refactor-spaces:[a-zA-Z0-9-]+:\w{12}:[a-zA-Z_0-9+=,.@-_/]+$</code>)
created_timestring (date-time)A timestamp that indicates when the environment is created.
descriptionstringThe description of the environment. (pattern: <code>^[a-zA-Z0-9-_\s.!*#@']+$</code>)
environment_idstringThe unique identifier of the environment. (pattern: <code>^env-[0-9A-Za-z]{10}$</code>)
errorobjectAny error associated with the environment resource.
last_updated_timestring (date-time)A timestamp that indicates when the environment was last updated.
namestringThe name of the environment. (pattern: <code>^(?!env-)[a-zA-Z0-9]+[a-zA-Z0-9-_ ]+$</code>)
network_fabric_typestringThe network fabric type of the environment. (TRANSIT_GATEWAY, NONE)
owner_account_idstringThe Amazon Web Services account ID of the environment owner. (pattern: <code>^\d{12}$</code>)
statestringThe current state of the environment. (CREATING, ACTIVE, DELETING, FAILED)
tagsobjectThe tags to assign to the environment. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair.
transit_gateway_idstringThe ID of the Transit Gateway set up by the environment, if applicable. (pattern: <code>^tgw-[-a-f0-9]{17}$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_environmentselectenvironment_identifier, regionGets an Amazon Web Services Migration Hub Refactor Spaces environment.
list_environmentsselectregionmaxResults, nextTokenLists Amazon Web Services Migration Hub Refactor Spaces environments owned by a caller account or shared with the caller account.
create_environmentinsertregion, NetworkFabricTypeCreates an Amazon Web Services Migration Hub Refactor Spaces environment. The caller owns the environment resource, and all Refactor Spaces applications, services, and routes created within the environment. They are referred to as the environment owner. The environment owner has cross-account visibility and control of Refactor Spaces resources that are added to the environment by other accounts that the environment is shared with. When creating an environment with a CreateEnvironment:NetworkFabricType of TRANSIT_GATEWAY, Refactor Spaces provisions a transit gateway to enable services in VPCs to communicate directly across accounts. If CreateEnvironment:NetworkFabricType is NONE, Refactor Spaces does not create a transit gateway and you must use your network infrastructure to route traffic to services with private URL endpoints.
delete_environmentdeleteenvironment_identifier, regionDeletes an Amazon Web Services Migration Hub Refactor Spaces environment. Before you can delete an environment, you must first delete any applications and services within the environment.

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
environment_identifierstringThe ID of the environment.
regionstringAWS region (default: us-east-1)
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 environment.

SELECT
arn,
created_time,
description,
environment_id,
error,
last_updated_time,
name,
network_fabric_type,
owner_account_id,
state,
tags,
transit_gateway_id
FROM aws.migration_hub_refactor_spaces.environments
WHERE environment_identifier = '{{ environment_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an Amazon Web Services Migration Hub Refactor Spaces environment. The caller owns the environment resource, and all Refactor Spaces applications, services, and routes created within the environment. They are referred to as the environment owner. The environment owner has cross-account visibility and control of Refactor Spaces resources that are added to the environment by other accounts that the environment is shared with. When creating an environment with a CreateEnvironment:NetworkFabricType of TRANSIT_GATEWAY, Refactor Spaces provisions a transit gateway to enable services in VPCs to communicate directly across accounts. If CreateEnvironment:NetworkFabricType is NONE, Refactor Spaces does not create a transit gateway and you must use your network infrastructure to route traffic to services with private URL endpoints.

INSERT INTO aws.migration_hub_refactor_spaces.environments (
ClientToken,
Description,
Name,
NetworkFabricType,
Tags,
region
)
SELECT
'{{ ClientToken }}',
'{{ Description }}',
'{{ Name }}',
'{{ NetworkFabricType }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
arn,
created_time,
description,
environment_id,
last_updated_time,
name,
network_fabric_type,
owner_account_id,
state,
tags
;

DELETE examples

Deletes an Amazon Web Services Migration Hub Refactor Spaces environment. Before you can delete an environment, you must first delete any applications and services within the environment.

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