environments
Creates, updates, deletes, gets or lists an environments resource.
Overview
| Name | environments |
| Type | Resource |
| Id | aws.migration_hub_refactor_spaces.environments |
Fields
The following fields are returned by SELECT queries:
- get_environment
- list_environments
| Name | Datatype | Description |
|---|---|---|
arn | string | The 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_time | string (date-time) | A timestamp that indicates when the environment is created. |
description | string | The description of the environment. (pattern: <code>^[a-zA-Z0-9-_\s.!*#@']+$</code>) |
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 environment resource. |
last_updated_time | string (date-time) | A timestamp that indicates when the environment was last updated. |
name | string | The name of the environment. (pattern: <code>^(?!env-)[a-zA-Z0-9]+[a-zA-Z0-9-_ ]+$</code>) |
network_fabric_type | string | The network fabric type of the environment. (TRANSIT_GATEWAY, NONE) |
owner_account_id | string | The Amazon Web Services account ID of the environment owner. (pattern: <code>^\d{12}$</code>) |
state | string | The current state of the environment. (CREATING, ACTIVE, DELETING, FAILED) |
tags | object | The 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_id | string | The ID of the Transit Gateway set up by the environment, if applicable. (pattern: <code>^tgw-[-a-f0-9]{17}$</code>) |
| Name | Datatype | Description |
|---|---|---|
arn | string | The 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_time | string (date-time) | A timestamp that indicates when the environment is created. |
description | string | A description of the environment. (pattern: <code>^[a-zA-Z0-9-_\s.!*#@']+$</code>) |
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 environment resource. |
last_updated_time | string (date-time) | A timestamp that indicates when the environment was last updated. |
name | string | The name of the environment. (pattern: <code>^(?!env-)[a-zA-Z0-9]+[a-zA-Z0-9-_ ]+$</code>) |
network_fabric_type | string | The network fabric type of the environment. (TRANSIT_GATEWAY, NONE) |
owner_account_id | string | The Amazon Web Services account ID of the environment owner. (pattern: <code>^\d{12}$</code>) |
state | string | The current state of the environment. (CREATING, ACTIVE, DELETING, FAILED) |
tags | object | The tags assigned to the environment. |
transit_gateway_id | string | The ID of the Transit Gateway set up by the environment. (pattern: <code>^tgw-[-a-f0-9]{17}$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_environment | select | environment_identifier, region | Gets an Amazon Web Services Migration Hub Refactor Spaces environment. | |
list_environments | select | region | maxResults, nextToken | Lists Amazon Web Services Migration Hub Refactor Spaces environments owned by a caller account or shared with the caller account. |
create_environment | insert | region, NetworkFabricType | 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. | |
delete_environment | delete | environment_identifier, region | 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. |
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 |
|---|---|---|
environment_identifier | string | The ID of the environment. |
region | string | AWS region (default: us-east-1) |
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_environment
- list_environments
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
;
Lists Amazon Web Services Migration Hub Refactor Spaces environments owned by a caller account or shared with the caller account.
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 region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_environment
- Manifest
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
;
# Description fields are for documentation purposes
- name: environments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the environments resource.
- name: ClientToken
value: "{{ ClientToken }}"
- name: Description
value: "{{ Description }}"
- name: Name
value: "{{ Name }}"
- name: NetworkFabricType
value: "{{ NetworkFabricType }}"
valid_values: ['TRANSIT_GATEWAY', 'NONE']
- name: Tags
value: "{{ Tags }}"
description: |
A collection of up to 50 unique tags
DELETE examples
- delete_environment
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
;