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.
Idawscc.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.
network_typestring
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.

For more information, see AWS::M2::Environment.

Methods

NameResourceAccessible byRequired Params
create_resourceenvironmentsINSERTEngineType, InstanceType, Name, region
delete_resourceenvironmentsDELETEIdentifier, region
update_resourceenvironmentsUPDATEIdentifier, PatchDocument, region
list_resourcesenvironments_list_onlySELECTregion
get_resourceenvironmentsSELECTIdentifier, region

SELECT examples

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,
network_type,
preferred_maintenance_window,
publicly_accessible,
security_group_ids,
storage_configurations,
subnet_ids,
tags
FROM awscc.m2.environments
WHERE
region = 'us-east-1' AND
Identifier = '{{ environment_arn }}';

INSERT example

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

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

UPDATE example

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

/*+ update */
UPDATE awscc.m2.environments
SET PatchDocument = string('{{ {
"EngineVersion": engine_version,
"HighAvailabilityConfig": high_availability_config,
"InstanceType": instance_type,
"PreferredMaintenanceWindow": preferred_maintenance_window,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ environment_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.m2.environments
WHERE
Identifier = '{{ environment_arn }}' AND
region = 'us-east-1';

Permissions

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

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