How to deploy refactored mainframe applications on AWS
Tags: aws, cloud, mainframe, application
Published: 2024-07-12 22:20:38

>**Note:** ✋ This post was originally published on my blog [wiki-cloud.co](https://wiki-cloud.co/en/2024/07/how-to-deploy-refactored-mainframe-applications-aws/)

## **Introduction**

Application modernization has become a priority for many companies seeking to improve their operational efficiency, their ability to quickly adapt to market changes and remain competitive in an increasingly digital and dynamic business environment. For many companies, it becomes a challenge to migrate and modernize legacy applications, such as mainframe applications to agile and flexible environments such as the AWS cloud. However, with the tools and solutions that AWS provides, this process becomes much easier.

In this article, I will explain a step-by-step on how to deploy a mainframe application that has already been analyzed and refactored. This implies that the original COBOL code has been transformed into a modern language such as JAVA. We will carry out the deployment in an runtime environment in AWS using the service of **AWS Mainframe Modernization**.

## **AWS Mainframe Modernization**

In a previously [article](https://dev.to/aws-builders/say-goodbay-to-the-past-and-modernize-your-mainframe-with-aws-587b) I gave an introduction to the AWS Mainframe Modernization service, which is basically a set of services and tools designed to facilitate the migration and modernization of applications and workloads running on mainframes to the AWS cloud.

Within this set of tools we have **AWS Blu Insights** which is a SaaS type tool and helps us not only analyze mainframe applications but also carry out the transformation and/or refactoring of these legacy applications that are developed with the COBOL language to more modern languages ​​such as JAVA, preserving their original logic and functionalities.

When we carry out the transformation and/or refactoring process of these mainframe applications with AWS Blu Insights, we must take into account that the result of this process is the generation of a JAVA application mainly with two layers (Frontend and Backend) and open to a additional layer of persistence where we can make use of other services that AWS provides us such as databases, file storage and queue management services.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkdg8nq6iralhqjzczvc.png)

## **Deploying refactored mainframe applications**

For this demo we download the example application that AWS has called [Planets Demo](https://d3lkpej5ajcpac.cloudfront.net/demo/bluage/PlanetsDemo-v1.zip), this application has already gone through the refactoring process so it is ready to be deployed in the AWS Mainframe Modernization service.

To deploy the application we must follow the following steps:

- **<u>Step 1 – Create an S3 bucket and upload the application</u>**

As a first step, must create a bucket in S3 where upload the already refactored application that is in ZIP format so that the AWS Mainframe Modernization service is able to take it and process it within its execution engine.

Something to take into account is that the bucket must be created in the same region where the application deployment in the AWS Mainframe Modernization service will be created and the ZIP file must be stored within a folder.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ifsucyl5wjp4zbbtqdi.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdqs67s0iklnk418ukza.png)

- **<u>Step 2 – Defining the application</u>**

As a requirement to deploy a refactored mainframe application to the AWS Mainframe Modernization service, a JSON file must be configured where the location and configuration of the application is defined, so that the AWS Migration Modernization service takes these parameters and the deployment process runs correctly on the service execution engine.

The configuration is very simple and for this example in the following JSON code we configure the name of the bucket, the path where the ZIP file is located within this bucket and the port where the application will be listened to when the URL is entered in a browser.

```
{
    "template-version": "2.0",
    "source-locations": [{
        "source-id": "s3-source",
        "source-type": "s3",
        "properties": {
            "s3-bucket": "demo-aws-mainframe-modernization", 
            "s3-key-prefix": "PlanetsDemo/v1"
        }
    }],
    "definition": {
        "listeners": [{
            "port": 8194,
            "type": "http"
        }],
        "ba-application": {
            "app-location": "${s3-source}/PlanetsDemo-v1.zip"
        }
    }
}
```
Once the configurations have been made in the JSON file, it is important to upload it to the same folder within the Bucket where the ZIP file has already been uploaded with the refactored application.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vth38nn0kjlf5gtfieln.png)

- **<u>Step 3 – Creating the runtime environment in AWS Mainframe Modernization</u>**

A runtime environment is a comprehensive set of infrastructure resources that includes a runtime engine, specifically designed to host and manage one or more migrated mainframe applications.

To create the runtime environment, the first thing we do is look for the AWS Mainframe Modernization service within the AWS console and there we select the “Refactor with Blu Age” option.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04nz0vzw5xeezwyncq2u.png)

In this demo, the application has already gone through the refactoring process with the solution of [Blue Age](https://www.bluage.com/), what we're going to do now is perform the deployment of the mainframe application in the execution engine. For this we select the deployment option and after the select the runtime environment option.  

Now we ask ourselves, what is refactoring? As the service page says “It is the automatic transformation of legacy language applications (e.g. COBOL) into agile services based on Java with AWS Blu Age, taking advantage of the most advanced web frameworks and best practices of DevOps in the cloud.”

We select the deployment option, then “create runtime environment” and finally click on the continue button.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kir5gypraev5xg8nccrs.png)

Another way to access the creation of this runtime environment is by entering through the menu on the left, selecting the "Environments" option.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c658mgikmivzv8x6wpco.png)

Regardless of the path by which we access to the creation of the runtime environment, the first step is is to specify the basic information, where we give a name and a description to the runtime environment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fh1zaf7e8gf8g83obq3s.png)

Now it asks us to select the engine, as this is an application that has already gone through the refactoring process with the Blu Age tool, we must select this engine and the version, for the purposes of this demonstration we will select the one that appears by default which is version 3.70, however it is recommended to work with the latest versions that come with many improvements and updates.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4cn4jntafbljp5ttptgy.png)

At the end of this basic information specification, the same service page indicates that once the runtime environment is created, metrics will automatically be created and logs stored in Amazon CloudWatch. If desired, you can also apply tags.

Now we move on to step 2, which is the configuration specification, in this section we configure the availability of the runtime environment, where the AWS Mainframe Modernization service offers two options: the standalone runtime environment and the high availability cluster. In the standalone runtime environment, a single instance is configured in an availability zone, a perfect scenario for demos like this and to test mainframe applications already transformed and refactored, in the case of the high availability cluster it is recommended for production environment scenarios where we will have redundant instances in two availability zones, of course this scenario is more expensive.

For this demo we will select the standalone runtime environment option.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xkqsabd6hio1chaxpk1i.png)

Another section is the resources part where we select the type of instance we want to be deployed for our runtime environment. AWS Mainframe Modernization offers a series of instance types that we can use depending on the type of workload or application that we are going to process in the runtime engine. For this demo we will use the smaller one, which is the M2.m5.large instance.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hl8z7w6ix60qhc7zt0h.png)

Finally, we move on to the security and networking section, where we select the VPC, subnets, and security groups we want to use to deploy these instances. For this demo we selected the option "Allow applications deployed in this environment to be publicly accessible", this option assigns a public IP address to the application so that it can be accessed from a web browser.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cuzyviplc4relf4o8n32.png)

The next step is to select the storage. If our mainframe application requires storage such as EFS or FSx, we can configure it in this option. For this demo these types of storage will not be necessary.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ilj9myoc3prcuqdhvzm.png)

Now we move on to scheduling maintenance, as AWS Mainframe Modernization is a managed service, AWS is responsible for performing maintenance and applying updates, however we must select when these maintenance windows should be scheduled so as not to affect the operation of the mainframe applications that are already deployed. For this demo we will select the no preference option.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltzf7xhydvzll76943cr.png)

To finish the creation of our runtime environment, a summary of the selected configuration is displayed to make a final check before creating the environment. In this demo the creation of the runtime environment took approximately 4 to 5 minutes.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6u46uw49wmlz7dlxg3qc.png)

- **<u>Step 4 – Create the mainframe application</u>**

In this step what we do is configure the mainframe application that we want to deploy.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pyevvrdqo8qxgv7lg6zn.png)

Step 1 of this section is the specify basic information, where we give our application a name, a description and select the type of engine which in this case is Blu Age.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4zjzlzgzagzh9j73deu9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7o7h137q6mky3a2zk4te.png)

Additionally, other configuration options are offered, such as adding a KMS key, adding an IAM role and tags to assign to these resources.

Step 2 of this section refers to the specify resources and configurations, this step is key to configure properly, because the correct configuration will depend largely the sucess execution of the application. Here we simply copy the JSON code we set up previously where we defined the bucket and the path where the ZIP file is located with the refactored mainframe application or we simply select the path of the bucket where this JSON file is located.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0uukaebkhtlldn245ba.png)

The last step in this section is reviewing and creating the mainframe application configuration. For this demo this process took approximately 30 seconds.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ezgcljdredx84n47eo9.png)

- **<u>Step 5 – Deploy the mainframe application</u>**

Having already created the runtime environment and the configuration of the application, we would only need to deploy the application refactored with Blue Age in this runtime environment that we have created and configured.

To access the deployment configuration we simply click on the name of the application configuration that we have just defined for this demo "app_planetsdemo" and click on the Deploy button.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cshiwluf837vxcx0quxg.png)

In this step all we do is select the version of our mainframe application and the runtime environment where we want to deploy it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hdjw5tkdb98cowll6g5.png)

For this demo, this process took approximately 15 minutes to deploy the mainframe application.

- **<u>Step 6 – Run and test the application</u>**

After having completed all these steps and their respective configuration, we proceed to run and test the AWS Planets Demo example application. We are going to notice something interesting and that is that since the mainframe application has been refactored, modernizing the code from COBOL to JAVA, we will enter to the application in web mode through a browser. But before running the live application, we must start it and once started we go to the information section of the application, where we can see that a DNS Hostname has been configured and assigned, which is the address that we must enter in the web browser.

> _[View animated GIF](https://wiki-cloud.co/wp-content/uploads/2024/07/article_image_aws_deploy_refactored_mainframe_applications_23.gif)_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68ow0c3u3twyjnucatu0.png)

For many, this application will remind them of times of the past, but now they are a reality to have them in the AWS cloud and in its AWS Mainframe Modernization service. This application is very simple, we simply type in a name of a planet of the solar system and it immediately brings us information about the planet we have searched. As the application runs in a web environment we can change the appearance of the screen.

In the browser we enter the following URL: http://{DNS hostname}:{port}/PlanetsDemo-web-1.0.0/

Now let's get to the action!!

> _[View animated GIF](https://wiki-cloud.co/wp-content/uploads/2024/07/article_image_aws_deploy_refactored_mainframe_applications_24.gif)_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9de1cqlng65xx59qxtz.png)

- **<u>Step 7 – Mainframe Application Monitoring</u>**

Within the application section, several tabs appear with certain information and one of them is the monitoring tab. When we enter this, different graphs are shown with metrics that measure the performance of the infrastructure and the mainframe application.

> _[View animated GIF](https://wiki-cloud.co/wp-content/uploads/2024/07/article_image_aws_deploy_refactored_mainframe_applications_25.gif)_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/18bnnnsjyj3y8yrrybrh.png)

## **Conclusions**

Adopting AWS specific tools and services, such as AWS Mainframe Modernization, eases the transition process, ensuring that refactored mainframe applications retain their optimal functionality and performance. Modernizing mainframe applications on AWS not only is a technological evolution, but also an opportunity for companies to innovate and improve their operations, while maintaining their relevance and competitiveness in a constantly changing business environment. AWS provides a wide range of resources and tools that not only simplify this process, but also empower business transformation through mainframe application modernization.

## **Resources**

Review the following resources for learn more about the AWS Mainframe Modernization service:

- [AWS Mainframe Modernization](https://aws.amazon.com/mainframe-modernization/)
- [YouTube – Introduction AWS Mainframe Modernization](https://youtu.be/Qpz1QmwiHpQ)
- [Blog – AWS Mainframe Modernization](https://aws.amazon.com/blogs/apn/tag/mainframe/)
- [AWS Mainframe Modernization User Guide](https://docs.aws.amazon.com/m2/latest/userguide/what-is-m2.html)
- [AWS Mainframe Modernization Refactoring with AWS Blu Age](https://aws.amazon.com/es/mainframe-modernization/capabilities/refactor)
- [AWS MAP for Mainframe](https://aws.amazon.com/migration-acceleration-program/mainframe/?nc1=h_ls)

I hope this information is useful.

Best Regards,

**Follow me:**

> 👉[Wiki Cloud](http://wiki-cloud.co/) | 👉[X](https://x.com/johnbulla) | 👉[LinkedIn](https://www.linkedin.com/in/johnbulla) | 👉[Github](https://github.com/johnbulla) | 👉[Youtube](https://www.youtube.com/user/johnbulla)