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 | aws.m2.environments |
Fields
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. |
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | EngineType, InstanceType, Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.m2.environments (
EngineType,
InstanceType,
Name,
region
)
SELECT
'{{ EngineType }}',
'{{ InstanceType }}',
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.m2.environments (
Description,
EngineType,
EngineVersion,
HighAvailabilityConfig,
InstanceType,
KmsKeyId,
Name,
PreferredMaintenanceWindow,
PubliclyAccessible,
SecurityGroupIds,
StorageConfigurations,
SubnetIds,
Tags,
region
)
SELECT
'{{ Description }}',
'{{ EngineType }}',
'{{ EngineVersion }}',
'{{ HighAvailabilityConfig }}',
'{{ InstanceType }}',
'{{ KmsKeyId }}',
'{{ Name }}',
'{{ PreferredMaintenanceWindow }}',
'{{ PubliclyAccessible }}',
'{{ SecurityGroupIds }}',
'{{ StorageConfigurations }}',
'{{ SubnetIds }}',
'{{ 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: EngineType
value: '{{ EngineType }}'
- name: EngineVersion
value: '{{ EngineVersion }}'
- name: HighAvailabilityConfig
value:
DesiredCapacity: '{{ DesiredCapacity }}'
- name: InstanceType
value: '{{ InstanceType }}'
- name: KmsKeyId
value: '{{ KmsKeyId }}'
- name: Name
value: '{{ Name }}'
- name: PreferredMaintenanceWindow
value: '{{ PreferredMaintenanceWindow }}'
- name: PubliclyAccessible
value: '{{ PubliclyAccessible }}'
- name: SecurityGroupIds
value:
- '{{ SecurityGroupIds[0] }}'
- name: StorageConfigurations
value:
- {}
- name: SubnetIds
value:
- '{{ SubnetIds[0] }}'
- name: Tags
value: {}
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