Tutorial: Managed Runtime for Micro Focus
This tutorial shows how to deploy and run the BankDemo sample application in a AWS Mainframe Modernization managed runtime environment with the Micro Focus runtime engine.
Topics
Prerequisites
Before you start the tutorial, make sure you complete the following prerequisites:
-
Create an Amazon Relational Database Service PostgreSQL or Amazon Aurora PostgreSQL DB instance by following the instructions in Creating a PostgreSQL DB instance and connecting to a database on a PostgreSQL DB instance in the Amazon RDS User Guide. Make sure that the database application user has the CREATEDB permission.
-
Upload the BankDemo sample application
to Amazon S3. Make sure that the bucket is in the same Region as Mainframe Modernization. For more information, see the Tutorial: Setting up the build for the BankDemo sample application. -
Download the catalog files
for use with the BankDemo sample application, then upload them to an Amazon S3 bucket, such as s3://m2-tutorial
. -
(Optional) Create file storage of type Amazon Elastic File System or Amazon FSx for Lustre.
Create and configure an AWS Key Management Service key and AWS Secrets Manager secret
An AWS KMS key is required in order to create a secret in Secrets Manager. Follow these steps to securely store the credentials for the Amazon RDS database instance you created for this tutorial. For more information, see Prerequisites.
-
To create the key, follow the steps in Creating keys in the AWS Key Management Service Developer Guide. You will need to update the key policy to grant Mainframe Modernization decrypt permissions. To add these permissions, add the following policy statements:
{ "Effect" : "Allow", "Principal" : { "Service" : "m2.amazonaws.com" }, "Action" : "kms:Decrypt", "Resource" : "*" }
-
To store the database credentials as a secret in Secrets Manager, follow the steps in Create a secret in the AWS Secrets Manager User Guide. You will specify the key you created in the previous steps for the encryption key.
-
During the key creation process, choose Resource permissions - optional, then choose Edit permissions. In the editor, add a resource-based policy, such as the following, to retrieve the content of the encrypted fields.
{ "Effect" : "Allow", "Principal" : { "Service" : "m2.amazonaws.com" }, "Action" : "secretsmanager:GetSecretValue", "Resource" : "*" }
-
Choose Save.
Step 1: Create a runtime environment
-
Open the Mainframe Modernization console
. -
In Modernize mainframe applications, choose Replatform with Micro Focus, then choose Get started.
-
On the Get started page, under How would you like to start with AWS Mainframe Modernization?, choose Deploy and Create runtime environment, and then choose Continue.
-
Specify a name and optional description for the runtime environment. You can also specify tags, which are optional, and choose Next.
-
Under Availability, choose High availability cluster. Under Resources, choose either
M2.c5.large
orM2.m5.large
for the instance type and the number of instances (up to two) that you want. Make sure you choose at least two subnets, and choose Allow applications deployed to this environment to be publicly accessible. Then choose Next. -
On the Attach storage page, optionally specify either an Amazon EFS or Amazon FSx file system. You can specify one file system of each type. Then choose Next.
-
On the Review and create page, review all the configurations you provided for the runtime environment and choose Create Environment.
-
Wait until environment creation succeeds and the status changes to Available. It might take up to two minutes.
Step 2: Create an application
-
In the navigation pane, choose Applications. Then choose Create application.
-
On the Specify basic information page, specify the application name and an optional description. You can also provide optional tagging information. Then choose Next.
-
On the Specify resources and configurations page, choose whether you want to specify the application definition using the inline editor or provide an Amazon S3 bucket where the application definition file is stored. Either type the application definition or provide the Amazon S3 location. Then choose Next.
You can use the following sample application definition file. Make sure to replace
$SECRET_ARN
,$S3_BUCKET
, and$S3_PREFIX
with the correct values for you.{ "resources": [ { "resource-type": "vsam-config", "resource-id": "vsam-1", "properties": { "secret-manager-arn": "$SECRET_ARN" } }, { "resource-type": "cics-resource-definition", "resource-id": "resource-definition-1", "properties": { "file-location": "${s3-source}/RDEF", "system-initialization-table": "BNKCICV" } }, { "resource-type": "cics-transaction", "resource-id": "transaction-1", "properties": { "file-location": "${s3-source}/transaction" } }, { "resource-type": "mf-listener", "resource-id": "listener-1", "properties": { "port": 6000, "conversation-type": "tn3270" } }, { "resource-type": "xa-resource", "resource-id": "xa-resource-1", "properties": { "name": "XASQL", "module": "${s3-source}/xa/ESPGSQLXA64.so", "secret-manager-arn": "$SECRET_ARN" } }, { "resource-type": "jes-initiator", "resource-id": "jes-initiator-1", "properties": { "initiator-class": "A", "description": "initiator...." } }, { "resource-type": "jcl-job", "resource-id": "jcl-job-1", "properties": { "file-location": "${s3-source}/jcl" } } ], "source-locations": [ { "source-id": "s3-source", "source-type": "s3", "properties": { "s3-bucket": "$S3_BUCKET", "s3-key-prefix": "$S3_PREFIX" } } ] }
Note This file is subject to change.
-
On the Review and create page, review the information you provided and choose Create application.
-
Wait until the application creation operation succeeds and the status changes to Available.
Step 3: Deploy an application
-
In the navigation pane, choose Applications, then choose BankDemo. Choose Actions, then choose Deploy application.
-
Choose the Tutorial environment and then choose Deploy.
-
Wait until the BankDemo application deployment succeeds and the status changes to Ready.
Step 4: Import data sets
-
In the navigation pane, choose Applications, then choose BankDemo. Choose the Data sets tab. Then choose Import. You can either specify the data set configuration values individually using the console, or provide the location of an Amazon S3 bucket that contains a data set configuration JSON file.
-
Choose Add new item to add each data set and choose Submit after you provide the information for each data set.
The following table lists the data sets that you need to import. Replace
$S3_DATASET_PREFIX
with your Amazon S3 bucket that contains the catalog data. For example,S3_DATASET_PREFIX=s3://m2-tutorial/catalog
.Name Location External Amazon S3 location MFI01V.MFIDEMO.BNKACC
sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKACC.DAT?folder=/DATA
$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKACC.DAT
MFI01V.MFIDEMO.BNKATYPE
sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKATYPE.DAT?folder=/DATA
$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKATYPE.DAT
MFI01V.MFIDEMO.BNKCUST
sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKCUST.DAT?folder=/DATA
$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKCUST.DAT
MFI01V.MFIDEMO.BNKHELP
sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKHELP.DAT?folder=/DATA
$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKHELP.DAT
MFI01V.MFIDEMO.BNKTXN
sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKTXN.DAT?folder=/DATA
$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKTXN.DAT
Alternatively, you can specify the data set configuration in a JSON file, such as the following. This file shows all the required data sets. Replace
$S3_DATASET_PREFIX
with your Amazon S3 bucket that contains the catalog data. For example,m2-tutorial/catalog
.{ "dataSets": [{ "dataSet": { "location": "sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKACC.DAT?folder=/DATA", "name": "MFI01V.MFIDEMO.BNKACC" }, "externalLocation": { "s3Location": "$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKACC.DAT" } }, { "dataSet": { "location": "sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKATYPE.DAT?folder=/DATA", "name": "MFI01V.MFIDEMO.BNKATYPE" }, "externalLocation": { "s3Location": "$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKATYPE.DAT" } }, { "dataSet": { "location": "sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKCUST.DAT?folder=/DATA", "name": "MFI01V.MFIDEMO.BNKCUST" }, "externalLocation": { "s3Location": "$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKCUST.DAT" } }, { "dataSet": { "location": "sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKHELP.DAT?folder=/DATA", "name": "MFI01V.MFIDEMO.BNKHELP" }, "externalLocation": { "s3Location": "$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKHELP.DAT" } }, { "dataSet": { "location": "sql://ESPACDatabase/VSAM/MFI01V.MFIDEMO.BNKTXN.DAT?folder=/DATA", "name": "MFI01V.MFIDEMO.BNKTXN" }, "externalLocation": { "s3Location": "$S3_DATASET_PREFIX/data/MFI01V.MFIDEMO.BNKTXN.DAT" } } ] }
-
Wait until the data set import process completes, the status changes to Completed, and there are zero failed records.
Step 5: Start an application
-
In the navigation pane, choose Applications, then choose BankDemo. Choose Actions, then choose Start application.
-
Wait until the BankDemo application starts successfully and the status changes to Running.
Step 6: Connect to the BankDemo sample application
Before you connect, make sure that the VPC and security group specified are the same as the ones applied to your network interface. Also, you will need to get the DNS hostname of the network interface to configure the TN3270 connection.
To locate the DNS hostname for configuration, complete the following steps:
-
Open the Mainframe Modernization console and choose Applications.
-
Choose the application you are using and display the details page.
-
Note the string of characters under DNS Hostname.
To ensure that your connection is not silently dropped by the Network Load Balancer, configure the
keepalive
setting on your TN3270 terminal to at least 180
seconds.
Continue with connecting to the BankDemo sample application, as follows:
-
Start the terminal emulator you want. This tutorial uses Micro Focus Rumba+.
-
Choose Connection, then Configure, then TN3270.
Choose Insert to add the DNS hostname address you noted earlier, and specify
6000
for the Telnet Port. -
Enter the BANK transaction name.
-
Type
B0001
for the username andA
for the password. -
After you log in successfully, you can navigate through the BankDemo application.
Clean up resources
If you no longer need the resources you created for this tutorial, delete them so that you won't continue to be charged for them. Complete the following steps:
-
If the BankDemo application is still running, stop it.
-
Delete the application. For more information, see Delete a Mainframe Modernization application.
-
Delete the runtime environment. For more information, see Delete a Mainframe Modernization runtime environment.
-
Delete the Amazon S3 buckets you created for this tutorial. For more information, see Deleting a bucket in the Amazon S3 User Guide.
-
Delete the AWS KMS key and Secrets Manager secret you created for this tutorial. For more information, see Deleting AWS KMS keys and Delete a secret.
-
Delete the database you created for this tutorial. For more information, see Deleting a DB instance.
Next steps
If you would like to continue learning, you can explore the following tutorials: