

AWS Mainframe Modernization Service (Managed Runtime Environment experience) is no longer open to new customers. For capabilities similar to AWS Mainframe Modernization Service (Managed Runtime Environment experience) explore AWS Mainframe Modernization Service (Self-Managed Experience). Existing customers can continue to use the service as normal. For more information, see [AWS Mainframe Modernization availability change](https://docs.aws.amazon.com/m2/latest/userguide/mainframe-modernization-availability-change.html).

# Managed runtime environments in AWS Mainframe Modernization
<a name="environments-m2"></a>

If you're new to AWS Mainframe Modernization see the following topics to get started:
+ [What is AWS Mainframe Modernization?](what-is-m2.md)
+ [Set up for AWS Mainframe Modernization](setting-up.md)
+ [Get started with AWS Mainframe Modernization](getting-started.md)
+ [Tutorial: Set up managed runtime for AWS Transform for mainframe](tutorial-runtime-ba.md)
+ [Tutorial: Set up managed runtime for Rocket Software (formerly Micro Focus)](tutorial-runtime-mf.md)

A runtime environment in AWS Mainframe Modernization is a named combination of AWS compute resources, a runtime engine, and the configuration details that you specify. The runtime environment hosts one or more applications. Applications in AWS Mainframe Modernization contain migrated mainframe workloads. You can choose the runtime engine for the environments that you create. Choose AWS Transform for mainframe if you are using the automated refactoring pattern, and Rocket Software (formerly Micro Focus) if you are using the replatforming pattern. You can also choose the amount of compute resources that are right for your application and optionally attach storage to runtime environments. AWS Mainframe Modernization enables Amazon CloudWatch metrics and logging for you so that you can monitor your runtime environment.

**Topics**
+ [Create an AWS Mainframe Modernization runtime environment](create-environments-m2.md)
+ [Update an AWS Mainframe Modernization runtime environment](update-environments-m2.md)
+ [Stop an AWS Mainframe Modernization runtime environment](stop-environments-m2.md)
+ [Restart an AWS Mainframe Modernization runtime environment](restart-environments-m2.md)
+ [Delete an AWS Mainframe Modernization runtime environment](delete-environments-m2.md)

# Create an AWS Mainframe Modernization runtime environment
<a name="create-environments-m2"></a>

Use the AWS Mainframe Modernization console to create an AWS Mainframe Modernization environment.

These instructions assume that you've completed the steps in [Set up for AWS Mainframe Modernization](setting-up.md).

## Create a runtime environment
<a name="create-environments-m2.console"></a>

**To create a runtime environment**

1. Open the AWS Mainframe Modernization console at [https://console.aws.amazon.com/m2/](https://console.aws.amazon.com/m2/).

1. In the AWS Region selector, choose the Region where you want to create the environment.

1. On the **Environments** page, choose **Create environment**.

1. On the **Specify basic information** page, provide the following information:

   1. In the **Name and description** section, enter a name for the environment.

   1. (Optional). In the **Environment description** field, enter a description for the environment. This description can help you and other users identify the purpose of the runtime environment.

   1. In the **Engine options** section, choose **Blu Age** for automated refactoring, or **Micro Focus (Rocket)** for replatforming.

   1. Choose a version for the engine that you selected.

   1. (Optional). In the **Tags** section, choose **Add new tag** to add one or more environment tags to your environment. An environment tag is a custom attribute label that helps you organize and manage your AWS resources.

   1. Choose **Next**.

1. On the **Specify configurations** page, provide the following information:

   1. In the **Availability** section, choose **Standalone runtime environment** or **High availability cluster**.

      The availability pattern determines how available your application will be when it runs. *Standalone* is fine for development purposes. *High availability* is for applications that must be available at all times.

   1. In **Resources**, choose an instance type and desired capacity.

      These resources are the AWS Mainframe Modernization managed Amazon EC2 instances that will host your runtime environment. Standalone runtime environments offer two choices for instance type and permit only one instance. High availability runtime environments offer two choices for instance type and permit up to two instances.

      For more information, see [Amazon EC2 Instance Types](https://aws.amazon.com/ec2/instance-types/), and contact an AWS mainframe specialist for guidance.

1. In the **Security and network** section, do the following:

   1. If you want the applications to be publicly accessible, choose **Allow applications deployed to this environment to be publicly accessible**.

   1. Choose the network type. If you choose IPv4, AWS Mainframe Modernization environment applications serve only IPv4 requests. In the dual-stack mode, applications will serve both IPv4 and IPv6 requests. If you choose the dual-stack mode, make sure there is at least 1 VPC with IPv6-enabled subnets.

   1. Choose a Virtual Private Cloud (VPC).

   1. If you're using the high availability pattern, choose two or more subnets. If you're using the standalone pattern with the AWS Transform for mainframe engine, choose two or more subnets. If you're using the standalone pattern with the Rocket Software engine, you can specify one subnet.

   1. Choose a security group for the VPC that you selected.
**Note**  
AWS Mainframe Modernization creates a Network Load Balancer for you to distribute connections to your runtime environment. Make sure your security group inbound and outbound rules allow access from an IP address to the port you specified in the `Listener(s) - required` property of the application definition. For more information, see [Update the security groups for your Network Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-security-groups.html) in the *User Guide for Network Load Balancers*.

   1. In the **KMS key** field, choose **Customize encryption settings** if you want to use a customer managed AWS KMS key. For more information, see [Data encryption at rest for AWS Mainframe Modernization service](data-protection.md#encryption-rest).
**Note**  
By default, AWS Mainframe Modernization encrypts your data with a AWS KMS key that AWS Mainframe Modernization owns and manages for you. However, you can choose to use a customer managed AWS KMS key.

   1. (Optional) Choose an AWS KMS key by name or Amazon Resource Name (ARN). Alternately, choose **Create an AWS KMS key** to go to the AWS KMS console and create a new AWS KMS key.

   1. Choose **Next**.

1. (Optional) On the **Attach storage** page, choose one or more Amazon EFS or Amazon FSx file systems.

   The file system mounted to an AWS Mainframe Modernization environment must be owned by a suitable user to be used by your applications that are running in the AWS Mainframe Modernization console.

   To configure these user settings, you can attach the drive to a Linux Amazon EC2 instance. Then create a group with ID `101` and a user with ID `3001`. Also, ensure the desired data folder that will be used by your application(s) must be owned by this user.

   For example, the `myFiles` folder can be used by your AWS Mainframe Modernization applications running in AWS Mainframe Modernization Managed.

   ```
   groupadd -g 101 mygroup
   useradd -M -g mygroup -p mypassword -u 3001 myuser
   mkdir myFiles
   chown myuser:mygroup myFiles
   ```
**Note**  
To enable access to the file system, the following security groups rules should be configured for establishing network connectivity between the EFS and M2 environment instance:  
**M2 environment security group** – Include an outbound rule that allows traffic over the NFS 2049 port.
**File system mount targets security group** – Include an inbound rule that allows traffic over the NFS 2049 port from the instance security group (listed above), and an outbound rule that allows traffic over the NFS 2049 port.

1. Choose **Next**.

1. In the **Maintenance window** section, choose when you want to apply pending changes to the environment.
   + If you choose **No preference**, AWS Mainframe Modernization chooses an optimized maintenance window for you.
   + To specify a particular maintenance window, choose **Select new maintenance window**. Then choose a day of the week, a start time, and a duration for the maintenance window.

   For more information about the maintenance window, see [AWS Mainframe Modernization maintenance window](update-environments-m2.md#update-environments-m2-maintenance).

   Choose **Next**.

1. On the **Review and create** page, review the information that you entered, and then choose **Create environment**.

# Update an AWS Mainframe Modernization runtime environment
<a name="update-environments-m2"></a>

Use the AWS Mainframe Modernization console to update an AWS Mainframe Modernization runtime environment. You can update the minor version of the runtime engine or the instance type that hosts the runtime environment. You can choose whether you want to apply updates immediately or during the preferred maintenance window.

These instructions assume that you have completed the steps in [Set up for AWS Mainframe Modernization](setting-up.md).

## Update a runtime environment
<a name="update-environments-m2.console"></a>

**To update a runtime environment**

1. Open the AWS Mainframe Modernization console at [https://console.aws.amazon.com/m2/](https://console.aws.amazon.com/m2/).

1. In the AWS Region selector, choose the Region where the environment that you want to update was created.

1. On the **Environments** page, choose the environment that you want to update.

1. On the details page for the environment, choose **Actions**, and then choose **Edit environment**.

1. Make any of the following changes: 
   + In the **Engine options** section, choose the engine version that you want.
   + In the **Resources** section, choose the instance type that you want.
   + In the **Maintenance window** section, choose the day, time, and duration that you want.
**Note**  
The only changes that you can choose to apply during the maintenance window are changes to the engine version. You must apply all other changes immediately.

1. Choose **Next**.

1. In **When to apply these changes**, choose **Immediately** or **During the next maintenance window**. Then choose **Update environment**.

If you choose **Immediately**, you see a message when the environment has finished updating.

## AWS Mainframe Modernization maintenance window
<a name="update-environments-m2-maintenance"></a>

Every runtime environment has a weekly two-hour maintenance window. Any system changes are applied during this time. The maintenance window is your chance to control when modifications, and software and security patching occurs. If a maintenance event is scheduled for a given week, it begins during that two-hour maintenance window. Most maintenance events also complete during the two-hour maintenance window, although larger maintenance events might take more than a couple of hours to complete.

The two-hour maintenance window is selected at random from an 8 hour block of time per Region. If you don't specify a maintenance window when you create a runtime environment, AWS Mainframe Modernization assigns a 2 hour maintenance window on a randomly selected day of the week.

AWS Mainframe Modernization consumes some of the resources in your environment instance while maintenance is being applied. You might observe a minimal effect on performance or some disruptions in applications during maintenance.

# Stop an AWS Mainframe Modernization runtime environment
<a name="stop-environments-m2"></a>

Use the AWS Mainframe Modernization console to stop an AWS Mainframe Modernization runtime environment. When you stop an environment the current application deployments are retained and you won't be charged for the environment until the environment is restarted. 

These instructions assume that you have completed the steps in [Set up for AWS Mainframe Modernization](setting-up.md).

## Stop a runtime environment
<a name="stop-environments-m2.console"></a>

If you need to stop an AWS Mainframe Modernization runtime environment, you follow similar steps as the update environment section.

Use the AWS Mainframe Modernization console to stop an AWS Mainframe Modernization runtime environment. When you stop an environment, the current application deployments are retained and you won't be charged for the environment until the environment is restarted. 

**Note**  
You must stop all applications before stopping environment.

**To stop a runtime environment**

1. Open the AWS Mainframe Modernization console at [https://console.aws.amazon.com/m2/](https://console.aws.amazon.com/m2/).

1. In the AWS Region selector, choose the Region where the environment that you want to stop was created.

1. On the **Environments** page, choose the environment that you want to stop.

1. On the details page for the environment, choose **Actions**, and then choose **Edit environment**.

1. On the **Edit environment page**, find **Resources section**, and update the desired capacity to zero.
**Note**  
To stop an environment, you can only choose to stop immediately.

1. Choose **Next**.

1. In **When to apply these changes**, choose **Immediately**. Then choose **Update environment**.

You see a message when the environment capacity is updated.

# Restart an AWS Mainframe Modernization runtime environment
<a name="restart-environments-m2"></a>

Use the AWS Mainframe Modernization console to restart an AWS Mainframe Modernization runtime environment. When you restart a runtime environment, the billing for the environment will be resumed. 

## Restart a runtime environment
<a name="restart-environments-m2.console"></a>

To restart an AWS Mainframe Modernization runtime environment, you follow similar steps as the stop environment section.

**To restart a runtime environment**

1. Open the AWS Mainframe Modernization console at [https://console.aws.amazon.com/m2/](https://console.aws.amazon.com/m2/).

1. In the AWS Region selector, choose the Region where the environment that you want to restart was created.

1. On the **Environments** page, choose the environment that you want to restart.

1. On the details page for the environment, choose **Actions**, and then choose **Edit environment**.
**Note**  
The desired capacity for standalone environment can only be updated to 1. To restart a runtime environment, you can only choose to restart immediately. 

1. On the **Edit environment page**, find **Resources section**, and update the desired capacity from zero to the required capacity.

1. Choose **Next**.

1. In **When to apply these changes**, choose **Immediately**. Then choose **Update environment**.

You see a message when the environment capacity is updated and the environment is restarted.

# Delete an AWS Mainframe Modernization runtime environment
<a name="delete-environments-m2"></a>

Use the AWS Mainframe Modernization console to delete an AWS Mainframe Modernization runtime environment.

These instructions assume that you have completed the steps in [Set up for AWS Mainframe Modernization](setting-up.md).

## Delete a runtime environment
<a name="delete-environments-m2.console"></a>

If you need to delete an AWS Mainframe Modernization runtime environment, make sure that you delete any deployed applications from the environment first. You can't delete a runtime environment where applications are deployed.

**To delete an environment**

1. Open the AWS Mainframe Modernization console at [https://console.aws.amazon.com/m2/](https://console.aws.amazon.com/m2/).

1. In the AWS Region selector, choose the Region where the environment that you want to delete was created.

1. On the **Environments** page, choose the environment that you want to delete, and then choose **Actions** and **Delete environment**.

1. In the **Delete environment** window, enter `delete` to confirm that you want to delete the runtime environment, and then choose **Delete**.