environments
Creates, updates, deletes or gets an environment resource or lists environments in a region
Overview
| Name | environments |
| Type | Resource |
| Description | Represents a runtime environment that can run migrated mainframe applications. |
| Id | awscc.m2.environments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
description | string | The description of the environment. |
engine_type | string | The target platform for the environment. |
engine_version | string | The version of the runtime engine for the environment. |
environment_arn | string | The Amazon Resource Name (ARN) of the runtime environment. |
environment_id | string | The unique identifier of the environment. |
high_availability_config | object | Defines the details of a high availability configuration. |
instance_type | string | The type of instance underlying the environment. |
kms_key_id | string | The ID or the Amazon Resource Name (ARN) of the customer managed KMS Key used for encrypting environment-related resources. |
name | string | The name of the environment. |
network_type | string | |
preferred_maintenance_window | string | Configures a desired maintenance window for the environment. If you do not provide a value, a random system-generated value will be assigned. |
publicly_accessible | boolean | Specifies whether the environment is publicly accessible. |
security_group_ids | array | The list of security groups for the VPC associated with this environment. |
storage_configurations | array | The storage configurations defined for the runtime environment. |
subnet_ids | array | The unique identifiers of the subnets assigned to this runtime environment. |
tags | object | Tags associated to this environment. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
environment_arn | string | The Amazon Resource Name (ARN) of the runtime environment. |
region | string | AWS region. |
For more information, see AWS::M2::Environment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | environments | INSERT | EngineType, InstanceType, Name, region |
delete_resource | environments | DELETE | Identifier, region |
update_resource | environments | UPDATE | Identifier, PatchDocument, region |
list_resources | environments_list_only | SELECT | region |
get_resource | environments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all environments in a region.
SELECT
region,
environment_arn
FROM awscc.m2.environments_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new environment resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.m2.environments (
EngineType,
InstanceType,
Name,
region
)
SELECT
'{{ engine_type }}',
'{{ instance_type }}',
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.m2.environments (
Description,
EngineType,
EngineVersion,
HighAvailabilityConfig,
InstanceType,
KmsKeyId,
Name,
NetworkType,
PreferredMaintenanceWindow,
PubliclyAccessible,
SecurityGroupIds,
StorageConfigurations,
SubnetIds,
Tags,
region
)
SELECT
'{{ description }}',
'{{ engine_type }}',
'{{ engine_version }}',
'{{ high_availability_config }}',
'{{ instance_type }}',
'{{ kms_key_id }}',
'{{ name }}',
'{{ network_type }}',
'{{ preferred_maintenance_window }}',
'{{ publicly_accessible }}',
'{{ security_group_ids }}',
'{{ storage_configurations }}',
'{{ subnet_ids }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: environment
props:
- name: description
value: '{{ description }}'
- name: engine_type
value: '{{ engine_type }}'
- name: engine_version
value: '{{ engine_version }}'
- name: high_availability_config
value:
desired_capacity: '{{ desired_capacity }}'
- name: instance_type
value: '{{ instance_type }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: name
value: '{{ name }}'
- name: network_type
value: '{{ network_type }}'
- name: preferred_maintenance_window
value: '{{ preferred_maintenance_window }}'
- name: publicly_accessible
value: '{{ publicly_accessible }}'
- name: security_group_ids
value:
- '{{ security_group_ids[0] }}'
- name: storage_configurations
value:
- {}
- name: subnet_ids
value:
- '{{ subnet_ids[0] }}'
- name: tags
value: {}
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:
- Create
- Read
- Update
- Delete
- List
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
m2:ListTagsForResource,
m2:GetEnvironment
m2:TagResource,
m2:UntagResource,
m2:ListTagsForResource,
m2:GetEnvironment,
m2:UpdateEnvironment,
kms:DescribeKey
elasticloadbalancing:DeleteLoadBalancer,
m2:DeleteEnvironment,
m2:GetEnvironment
m2:ListEnvironments