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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.m2.environments
WHERE
Identifier = '{{ environment_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

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