Skip to main content

environments

Creates, updates, deletes or gets an environment resource or lists environments in a region

Overview

Nameenvironments
TypeResource
DescriptionRepresents a runtime environment that can run migrated mainframe applications.
Idaws.m2.environments

Fields

NameDatatypeDescription
descriptionstringThe description of the environment.
engine_typestringThe target platform for the environment.
engine_versionstringThe version of the runtime engine for the environment.
environment_arnstringThe Amazon Resource Name (ARN) of the runtime environment.
environment_idstringThe unique identifier of the environment.
high_availability_configobjectDefines the details of a high availability configuration.
instance_typestringThe type of instance underlying the environment.
kms_key_idstringThe ID or the Amazon Resource Name (ARN) of the customer managed KMS Key used for encrypting environment-related resources.
namestringThe name of the environment.
preferred_maintenance_windowstringConfigures a desired maintenance window for the environment. If you do not provide a value, a random system-generated value will be assigned.
publicly_accessiblebooleanSpecifies whether the environment is publicly accessible.
security_group_idsarrayThe list of security groups for the VPC associated with this environment.
storage_configurationsarrayThe storage configurations defined for the runtime environment.
subnet_idsarrayThe unique identifiers of the subnets assigned to this runtime environment.
tagsobjectTags associated to this environment.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTEngineType, InstanceType, Name, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all environments in a region.

SELECT
region,
description,
engine_type,
engine_version,
environment_arn,
environment_id,
high_availability_config,
instance_type,
kms_key_id,
name,
preferred_maintenance_window,
publicly_accessible,
security_group_ids,
storage_configurations,
subnet_ids,
tags
FROM aws.m2.environments
WHERE region = 'us-east-1';

Gets all properties from an individual environment.

SELECT
region,
description,
engine_type,
engine_version,
environment_arn,
environment_id,
high_availability_config,
instance_type,
kms_key_id,
name,
preferred_maintenance_window,
publicly_accessible,
security_group_ids,
storage_configurations,
subnet_ids,
tags
FROM aws.m2.environments
WHERE region = 'us-east-1' AND data__Identifier = '<EnvironmentArn>';

INSERT example

Use the following StackQL query and manifest file to create a new environment resource, using stack-deploy.

/*+ create */
INSERT INTO aws.m2.environments (
EngineType,
InstanceType,
Name,
region
)
SELECT
'{{ EngineType }}',
'{{ InstanceType }}',
'{{ Name }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.m2.environments
WHERE data__Identifier = '<EnvironmentArn>'
AND region = 'us-east-1';

Permissions

To operate on the environments resource, the following permissions are required:

Create

ec2:CreateNetworkInterface,
ec2:CreateNetworkInterfacePermission,
ec2:DescribeNetworkInterfaces,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcAttribute,
ec2:DescribeVpcs,
ec2:ModifyNetworkInterfaceAttribute,
elasticfilesystem:DescribeMountTargets,
elasticloadbalancing:CreateLoadBalancer,
elasticloadbalancing:DeleteLoadBalancer,
elasticloadbalancing:AddTags,
fsx:DescribeFileSystems,
iam:CreateServiceLinkedRole,
kms:DescribeKey,
kms:CreateGrant,
m2:CreateEnvironment,
m2:GetEnvironment,
m2:ListTagsForResource,
m2:TagResource

Read

m2:ListTagsForResource,
m2:GetEnvironment

Update

m2:TagResource,
m2:UntagResource,
m2:ListTagsForResource,
m2:GetEnvironment,
m2:UpdateEnvironment,
kms:DescribeKey

Delete

elasticloadbalancing:DeleteLoadBalancer,
m2:DeleteEnvironment,
m2:GetEnvironment

List

m2:ListEnvironments