Skip to main content

environments

Creates, updates, deletes, gets or lists an environments resource.

Overview

Nameenvironments
TypeResource
Idaws.m2.environments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the runtime environment. Must be unique within the account. (pattern: <code>^[A-Za-z0-9][A-Za-z0-9_-]{1,59}$</code>)
actual_capacityintegerThe number of instances included in the runtime environment. A standalone runtime environment has a maximum of one instance. Currently, a high availability runtime environment has a maximum of two instances.
creation_timestring (date-time)The timestamp when the runtime environment was created.
descriptionstringThe description of the runtime environment.
engine_typestringThe target platform for the runtime environment. (microfocus, bluage)
engine_versionstringThe version of the runtime engine. (pattern: <code>^\S{1,10}$</code>)
environment_arnstringThe Amazon Resource Name (ARN) of the runtime environment. (pattern: <code>^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]|):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+=,@.-]{0,1023}$</code>)
environment_idstringThe unique identifier of the runtime environment. (pattern: <code>^\S{1,80}$</code>)
high_availability_configobjectDefines the details of a high availability configuration.
instance_typestringThe type of instance underlying the runtime environment. (pattern: <code>^\S{1,20}$</code>)
kms_key_idstringThe identifier of a customer managed key.
load_balancer_arnstringThe Amazon Resource Name (ARN) for the load balancer used with the runtime environment.
network_typestringThe network type supported by the runtime environment. (ipv4, dual)
pending_maintenanceobjectIndicates the pending maintenance scheduled on this environment.
preferred_maintenance_windowstringThe maintenance window for the runtime environment. If you don't provide a value for the maintenance window, the service assigns a random value. (pattern: <code>^\S{1,50}$</code>)
publicly_accessiblebooleanWhether applications running in this runtime environment are publicly accessible.
security_group_idsarrayThe unique identifiers of the security groups assigned to this runtime environment.
statusstringThe status of the runtime environment. If the Amazon Web Services Mainframe Modernization environment is missing a connection to the customer owned dependent resource, the status will be Unhealthy. (Creating, Available, Updating, Deleting, Failed, UnHealthy)
status_reasonstringThe reason for the reported status.
storage_configurationsarrayThe storage configurations defined for the runtime environment.
subnet_idsarrayThe unique identifiers of the subnets assigned to this runtime environment.
tagsobjectThe tags defined for this runtime environment.
vpc_idstringThe unique identifier for the VPC used with this runtime environment. (pattern: <code>^\S{1,50}$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_environmentselectenvironment_id, regionDescribes a specific runtime environment.
list_environmentsselectregionengineType, maxResults, names, nextTokenLists the runtime environments.
create_environmentinsertregion, engineType, instanceType, nameCreates a runtime environment for a given runtime engine.
update_environmentupdateenvironment_id, regionUpdates the configuration details for a specific runtime environment.
delete_application_from_environmentdeleteapplication_id, environment_id, regionDeletes a specific application from the specific runtime environment where it was previously deployed. You cannot delete a runtime environment using DeleteEnvironment if any application has ever been deployed to it. This API removes the association of the application with the runtime environment so you can delete the environment smoothly.
delete_environmentdeleteenvironment_id, regionDeletes a specific runtime environment. The environment cannot contain deployed applications. If it does, you must delete those applications before you delete the environment.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
application_idstringThe unique identifier of the application you want to delete.
environment_idstringThe unique identifier of the runtime environment you want to delete.
regionstringAWS region (default: us-east-1)
engineTypestringThe engine type for the runtime environment.
maxResultsintegerThe maximum number of runtime environments to return.
namesarrayThe names of the runtime environments. Must be unique within the account.
nextTokenstringA pagination token to control the number of runtime environments displayed in the list.

SELECT examples

Describes a specific runtime environment.

SELECT
name,
actual_capacity,
creation_time,
description,
engine_type,
engine_version,
environment_arn,
environment_id,
high_availability_config,
instance_type,
kms_key_id,
load_balancer_arn,
network_type,
pending_maintenance,
preferred_maintenance_window,
publicly_accessible,
security_group_ids,
status,
status_reason,
storage_configurations,
subnet_ids,
tags,
vpc_id
FROM aws.m2.environments
WHERE environment_id = '{{ environment_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a runtime environment for a given runtime engine.

INSERT INTO aws.m2.environments (
clientToken,
description,
engineType,
engineVersion,
highAvailabilityConfig,
instanceType,
kmsKeyId,
name,
networkType,
preferredMaintenanceWindow,
publiclyAccessible,
securityGroupIds,
storageConfigurations,
subnetIds,
tags,
region
)
SELECT
'{{ clientToken }}',
'{{ description }}',
'{{ engineType }}' /* required */,
'{{ engineVersion }}',
'{{ highAvailabilityConfig }}',
'{{ instanceType }}' /* required */,
'{{ kmsKeyId }}',
'{{ name }}' /* required */,
'{{ networkType }}',
'{{ preferredMaintenanceWindow }}',
{{ publiclyAccessible }},
'{{ securityGroupIds }}',
'{{ storageConfigurations }}',
'{{ subnetIds }}',
'{{ tags }}',
'{{ region }}'
RETURNING
environment_id
;

UPDATE examples

Updates the configuration details for a specific runtime environment.

UPDATE aws.m2.environments
SET
applyDuringMaintenanceWindow = {{ applyDuringMaintenanceWindow }},
desiredCapacity = {{ desiredCapacity }},
engineVersion = '{{ engineVersion }}',
forceUpdate = {{ forceUpdate }},
instanceType = '{{ instanceType }}',
preferredMaintenanceWindow = '{{ preferredMaintenanceWindow }}'
WHERE
environment_id = '{{ environment_id }}' --required
AND region = '{{ region }}' --required
RETURNING
environment_id;

DELETE examples

Deletes a specific application from the specific runtime environment where it was previously deployed. You cannot delete a runtime environment using DeleteEnvironment if any application has ever been deployed to it. This API removes the association of the application with the runtime environment so you can delete the environment smoothly.

DELETE FROM aws.m2.environments
WHERE application_id = '{{ application_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND region = '{{ region }}' --required
;