AWS Cloud Operations Blog

AWS Mainframe Modernization now available in Terraform

Leveraging Infrastructure as Code for AWS Mainframe Modernization with Terraform

AWS Mainframe Modernization service is a cloud-native platform to modernize, migrate, execute, and operate mainframe applications. In addition to analysis and transformation tools, it provides a fully-managed and resilient runtime environment making it easierto run and operate modernized applications.

Starting today, you can define AWS Mainframe Modernization service resources using HashiCorp Terraform. We recommend that you have a working understanding of both Terraform and AWS Mainframe Modernization before going through this blog post. For more information on Terraform, visit the Introduction to Terraform on AWS Workshop to learn more.

Solution Overview

In this solution, we have taken the Planet Demo application and using the AWS Blu Age Runtime within the Managed Mainframe Runtime Environment engine we will demonstrate how we can create this environment using Terraform. Customers also have the option to select the Micro Focus engine should they intend to deploy this sample application with the Micro Focus run time

Walkthrough

In this section, we will walk through deploying an example application to a Mainframe Modernization Environment in a dedicated VPC.

Prerequisites

To complete the steps described in this post, you will need the following:

  1. To download and setup Terraform, see the article, Install Terraform. See the article, Get Started – AWS, for instructions to get started with Terraform on AWS.
  2. Validate the AWS Provider version is > v5.43.0.
  3. Make sure that your AWS role has the correct permissions to deploy Mainframe Modernization resources.

Deployment Steps

  1. Validate that your AWS CLI profile is configured in your terminal and your Terraform environment.
  2. Clone the aws-m2-example-with-terraform repository.
    $ git clone https://github.com/aws-samples/aws-m2-example-with-terraform   
  3. Change into the downloaded directory.
    $ cd aws-m2-example-with-terraform
  4. Download the PlanetsDemo application.
    $ curl https://d3lkpej5ajcpac.cloudfront.net/demo/bluage/PlanetsDemo-v1.zip -o PlanetsDemo-v1.zip</p><p> </p>
  5. Edit terraform.tfvars and change my_public_ip to your ip.
    my_public_ip = "1.2.3.4"
  6. Initialize the Terraform.
    $ terraform init
  7.  Apply the configuration to create the infrastructure.
    $ terraform apply
    Apply complete! Resources: 20 added, 0 changed, 0 destroyed.
    Outputs: 
    application_url = "http://ux4453jdhrghfbpzqctvy7ooqi-abdcefeedfsdgdgd.elb.us-east-2.amazonaws.com:8196/PlanetsDemo-web-1.0.0/"

    Congratulations! You have deployed your first Mainframe Modernization application.

    Testing Planet Demo

    Open the application_url output in your browser:

The JICS Transaction Display from the Output URL

Figure 1 – JICS transaction runner

Enter PINQ in the input box(Figure 1 ) and click Run.

The output from entering PINQ on the transaction url

Figure 2 – output from JICS transaction

You should get the data from the transaction server (shown in figure 2 with MARS as example). Once done, you may close the browser tab.

Cleaning up

Leaving resources that you no longer need in your AWS account may incur charges. If you would like to remove the resources that were created with this solution, please follow the instructions to delete the infrastructure.

Destroy the infrastructure.

$ terraform destroy

Enter a value: yes

 resources are removed, you will see a Terraform output similar to the following message:

Destroy complete! Resources: 20 destroyed.

Conclusion

In conclusion, this blog post provides a comprehensive guide to leveraging Terraform for deploying AWS Mainframe Modernization. We discussed the importance of a well-structured project, initial code setup, integration between Mainframe Modernization and Terraform, parameter substitution, and remote state management. By following these best practices, developers can create and manage their MicroFocus or BluAge environments more effectively while maintaining clean, modular, and reusable code. Embracing infrastructure as code such as Terraform, will enable you to build scalable and maintainable applications.

Authors:

Ramesh Mathikumar

Ramesh Mathikumar is a Senior Consultant within the Global Financial Services practice. He has been working with Financial services customers over the last 25 years. At AWS, he helps customers succeed in their cloud journey by implementing AWS technologies every day.

Andrew Tulloch

As a Customer Delivery Architect in Global Financial Services, Andrew spends his time helping Financial Services customers achieve their goals and operate successfully at scale on AWS. He is experienced in Cloud Foundations and Terraform and contributes to the Terraform AWS Provider. Outside of work he enjoys cycling and photography.