

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# と Terraform を使用してメインフレームアプリケーションをモダナイズ AWS Transform およびデプロイする
<a name="modernize-mainframe-app-transform-terraform"></a>

*Amazon Web Services、Mason Cahill、Polaris Jhandi、Prachi Khanna、Sivasubramanian Ramani、Santosh Kumar Singh*

## 概要
<a name="modernize-mainframe-app-transform-terraform-summary"></a>

[AWS Transform](https://docs.aws.amazon.com/transform/latest/userguide/what-is-service.html) は、.NET、メインフレーム、VMware ワークロードの大規模モダナイズを加速します。評価、コード分析、リファクタリング、分解、依存関係マッピング、検証、変換計画などの複雑なタスクを自動化する特殊な AI エージェントをデプロイします。このパターンは、 AWS Transform を使用してメインフレームアプリケーションをモダナイズし、[Hashicorp Terraform ](https://developer.hashicorp.com/terraform/intro)を使用して AWS インフラストラクチャにデプロイする方法を示しています。この手順はオープンソースのメインフレームアプリケーションのサンプルである [CardDemo](https://github.com/aws-samples/aws-mainframe-modernization-carddemo) を、COBOL から最新の Java アプリケーションに変換する際に利用できます。

## 前提条件と制限
<a name="modernize-mainframe-app-transform-terraform-prereqs"></a>

**前提条件**
+ アクティブな AWS アカウント
+  AWS リソースを作成してアプリケーションをデプロイするための管理アクセス許可
+ [設定済み](https://developer.hashicorp.com/terraform/tutorials/aws-get-started?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS)の Terraform バージョン 1.5.7 以降
+ AWS Terraform のプロバイダー、[設定](https://registry.terraform.io/providers/hashicorp/aws/2.36.0/docs#authentication)済み
+ [有効な](https://docs.aws.amazon.com/singlesignon/latest/userguide/enable-identity-center.html)AWS IAM アイデンティティセンター
+ [有効な](https://docs.aws.amazon.com/transform/latest/userguide/getting-started.html)AWS Transform
+ 変換ジョブを実行できるコントリビューターロールを持つ AWS Transform ワークスペースに[オンボードされた](https://docs.aws.amazon.com/transform/latest/userguide/transform-user-management.html)ユーザー

**制限事項**
+ AWS Transform は一部の でのみ使用できます AWS リージョン。対応リージョンのリスト全文は「[Supported Regions for AWS Transform](https://docs.aws.amazon.com/transform/latest/userguide/regions.html)」よりご確認ください。
+  AWS Transformのメインフレーム変換機能では Service Quota があります。詳細については、「[AWS Transformのクォータ](https://docs.aws.amazon.com/transform/latest/userguide/transform-limits.html)」を参照してください。
+ 共有ワークスペースでコラボレーションするには、すべてのユーザーが、 AWS Transform ウェブアプリケーションのインスタンス AWS IAM アイデンティティセンター に関連付けられている の同じインスタンスの登録済みユーザーである必要があります。
+ Amazon Simple Storage Service (Amazon S3) バケット と は、同じ AWS アカウント とリージョンにある AWS Transform 必要があります。

## アーキテクチャ
<a name="modernize-mainframe-app-transform-terraform-architecture"></a>

次の図は、レガシーアプリケーションのエンドツーエンドのモダナイズと、 AWS クラウドへのデプロイを示しています。アプリケーションとデータベースの認証情報は に保存され AWS Secrets Manager、Amazon CloudWatch はモニタリングおよびログ記録機能を提供します。

![AWS Transform は、Terraform を使用してメインフレームアプリケーションとデプロイをモダナイズします。](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/images/pattern-img/78bc1e6e-cd3d-4c6d-ae4b-0675a6898fd9/images/332ccf35-f55a-449e-a05d-7e321b3867b7.png)


この図表は、次のワークフローを示しています:

1. を通じて AWS IAM アイデンティティセンター、ユーザーは AWS Transform で認証とアクセスを行います AWS アカウント。

1. ユーザーは COBOL メインフレームコードを Amazon S3 バケットにアップロードし、 AWS Transformで変換を開始します。

1. AWS Transform は COBOL コードをクラウドネイティブの Java コードにモダナイズし、モダナイズされたコードを Amazon S3 バケットに保存します。

1. Terraform は、Application Load Balancer、Amazon Elastic Compute Cloud (Amazon EC2) インスタンス、Amazon Relational Database Service (Amazon RDS) データベースなど、モダナイズされたアプリケーションをデプロイするための AWS インフラストラクチャを作成します。Terraform は、モダナイズされたコードを Amazon EC2 インスタンスにデプロイします。

1. VSAM ファイルは Amazon EC2 にアップロードされ、Amazon EC2 から Amazon RDS データベースに移行されます。

## ツール
<a name="modernize-mainframe-app-transform-terraform-tools"></a>

**AWS のサービス**
+ [Amazon Elastic Compute Cloud (Amazon EC2)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) は、 AWS クラウドでスケーラブルなコンピューティング容量を提供します。仮想サーバーを必要な数だけ起動して、迅速にスケールアップまたはスケールダウンができます。このパターンでは、SQL Server フェイルオーバークラスターインスタンスは Amazon EC2 インスタンスにインストールされます。
+ [AWS IAM アイデンティティセンター](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) を使用すると、 AWS アカウント およびクラウドアプリケーションへのシングルサインオン (SSO) アクセスを一元管理できます。
+ [Amazon Relational Database Service (Amazon RDS)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html) を使用して、 AWS クラウドでリレーショナルデータベース (DB) をセットアップ、運用、スケーリングできます。
+ [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html) を使用すると、コード内のハードコードされた認証情報 (パスワードを含む) を Secrets Manager への API コールで置き換えて、プログラムでシークレットを取得することができます。
+ [Amazon Simple Storage Service (Amazon S3)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) は、あらゆる量のデータを保存、保護、取得できるクラウドベースのオブジェクトストレージサービスです。
+ [AWS Transform](https://docs.aws.amazon.com/transform/latest/userguide/what-is-service.html) はエージェンティック AI を使用して、.NET、メインフレーム、VMware ワークロードなどのレガシーワークロードのモダナイズを加速します。

**その他のツール**
+ [Apache Maven](https://maven.apache.org/) は、Java プロジェクト用のオープンソースのソフトウェアプロジェクト管理およびビルド自動化ツールです。
+ [Apache Tomcat](https://tomcat.apache.org/) は、Java コード用のオープンソースの Servlet コンテナおよびウェブサーバーです。
+ [HashiCorp Terraform](https://www.terraform.io/docs) は、コードを使用してクラウドインフラストラクチャとリソースをプロビジョニングして管理するのに役立つ infrastructure as code (IaC) ツールです。
+ [Spring Boot](https://spring.io/projects/spring-boot) は、Java の Spring Framework 上に構築されたオープンソースフレームワークです。

**コードリポジトリ**

このパターンで使用するコードは、GitHub 内の「[Mainframe Transformation E2E](https://github.com/aws-samples/sample-mainframe-transformation-e2e)」リポジトリから取得できます。このパターンでは、オープンソースの AWS [CardDemo](https://github.com/aws-samples/aws-mainframe-modernization-carddemo) メインフレームアプリケーションをサンプルアプリケーションとして使用します。

## ベストプラクティス
<a name="modernize-mainframe-app-transform-terraform-best-practices"></a>
+ 移行対象となるコードとリソースの完全な所有権を割り当てます。
+ 完全な移行にスケーリングする前に、概念実証を開発してテストします。
+ すべてのステークホルダーからのコミットメントを得てください。
+ 明確なコミュニケーションチャネルを確立します。
+ 実用最小限の製品 (MVP) 要件を定義し文書化します。
+ 明確な成功基準を設定します。

## エピック
<a name="modernize-mainframe-app-transform-terraform-epics"></a>

### メインフレームアプリケーションコードの準備とアップロード
<a name="prepare-and-upload-the-mainframe-application-code"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| バケットを作成します。 |  AWS Transform が有効になっているのと同じ AWS アカウント およびリージョンに Amazon S3 バケットを作成します。このバケットを使用して、アプリケーションのビルドと実行に必要なメインフレームアプリケーションコード、データ、その他のスクリプトを保存します。 は、このバケット AWS Transform を使用して、リファクタリングされたコードと、変換に関連するその他のファイルを保存します。手順については、Amazon S3 ドキュメントの「[バケットの作成](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)」を参照してください。 | 一般的な AWS、AWS 管理者 | 
| バケットの CORS アクセス許可を設定します。 | アクセス用にバケットを設定するときは AWS Transform 、バケットの Cross-Origin Resource Sharing (CORS) を設定する必要があります。正しく設定されていないと、 AWS Transformのインライン表示またはファイル比較機能が使用できなくなる場合があります。バケットの CORS を設定する方法について、詳しくは Amazon S3 バケットの「[Cross−Origin Resource Sharing (CORS) の使用](https://docs.aws.amazon.com/AmazonS3/latest/userguide/cors.html)」をご確認ください。ポリシーについては、 AWS Transform ドキュメントの[S3 バケット CORS アクセス許可](https://docs.aws.amazon.com/transform/latest/userguide/transform-app-mainframe-workflow.html#transform-app-mainframe-workflow-setup-connector-s3)」を参照してください。 | 一般的な AWS、AWS 管理者 | 
| サンプルメインフレームアプリケーションコードを準備します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | AWS 全般、アプリ開発者 | 

### メインフレームアプリケーションの変換
<a name="transform-the-mainframe-application"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
|  AWS Transform ジョブをセットアップします。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、アプリオーナー | 
| コネクタをセットアップします。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、アプリオーナー | 
| コードを変換します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、アプリオーナー | 

### Terraform を使用してインフラストラクチャをデプロイする
<a name="deploy-the-infrastructure-through-terraform"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| テンプレートを更新します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html)本番稼働および本番稼働に近い環境では、追加のセキュリティコンポーネントを設定します。例えば、[[AWS WAF Application Load Balancer の保護]](https://aws.amazon.com/about-aws/whats-new/2024/02/aws-application-load-balancer-one-click-waf-integrations/) を有効にします。 | 一般的な AWS、AWS 管理者 | 
| インフラストラクチャを準備します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | Terraform | 

### Amazon EC2 インスタンスに Apache Tomcat をインストールして設定する
<a name="install-and-configure-apache-tomcat-on-the-ec2-instance"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| 必要なソフトウェアをインストールします。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 
| ソフトウェアのインストールを確認します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 

### モダナイズされたアプリケーションコードをコンパイルしてパッケージ化する
<a name="compile-and-package-the-modernized-application-code"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| 生成されたコードをダウンロードして抽出します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 
| モダナイズされたアプリケーションを構築します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 

### データベースの移行
<a name="migrate-the-database"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| データベースと JICS スキーマを作成します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 
| データベースの作成を検証します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 
| データを JICS データベースに移行します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 

### モダナイズされたアプリケーションをインストールする
<a name="install-the-modernized-application"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| モダナイズ済みのアプリケーションを Amazon EC2 インスタンスにインストールします。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、クラウドアーキテクト | 
| Tomcat サーバーを再起動します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、クラウドアーキテクト | 
| VSAM データセットを移行します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、移行エンジニア | 
| Groovy スクリプトのパラメータを更新します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者 | 

### アプリケーションをテストする
<a name="test-the-application"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| モダナイズされたアプリケーションをテストします。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、テストエンジニア | 
| バッチスクリプトを確認します。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | アプリ開発者、テストエンジニア | 

### クリーンアップ
<a name="clean-up"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| インフラストラクチャを削除する準備をします。 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | AWS 全般 | 
| インフラストラクチャを削除します。 | これらのステップにより、リソースは完全に削除されます。先に進む前に、重要なデータをバックアップしていることを確認してください。[See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | AWS 全般 | 

## トラブルシューティング
<a name="modernize-mainframe-app-transform-terraform-troubleshooting"></a>


| 問題 | ソリューション | 
| --- | --- | 
| Terraform 認証 | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | 
| Tomcat 関連のエラー | [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/modernize-mainframe-app-transform-terraform.html) | 
| URL 名がロードされない | Application Load Balancer セキュリティグループに、ソースとしてインバウンドルールに IP アドレスがあることを確認します。 | 
| Tomcat ログの認証の問題 | のデータベースシークレットパスワード AWS Secrets Manager と **server.xml** のパスワードが一致していることを確認します。 | 

## 関連リソース
<a name="modernize-mainframe-app-transform-terraform-resources"></a>

**AWS 規範ガイダンス**
+ [Modernize the CardDemo mainframe application by using AWS Transform](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/modernize-carddemo-mainframe-app.html)

**AWS サービスドキュメント**
+ [AWS Blu Age Blusam 管理コンソール](https://docs.aws.amazon.com/m2/latest/userguide/ba-shared-bac-userguide.html)
+ [AWS Blu Age ランタイムのインフラストラクチャセットアップ要件 (非マネージド型)](https://docs.aws.amazon.com/m2/latest/userguide/ba-infrastructure-setup.html)
+ [AWS Blu Age ランタイムのオンボーディング](https://docs.aws.amazon.com/m2/latest/userguide/ba-runtime-setup-onboard.html)
+ [メインフレームアプリケーションのモダナイゼーション](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/transform-app-mainframe.html)
+ [AWS Blu Age ランタイムの設定](https://docs.aws.amazon.com/m2/latest/userguide/ba-runtime-config.html)

**AWS ブログ投稿**
+ [で AI エージェントを使用して Mainframe Modernization ジャーニーを加速する AWS Transform](https://aws.amazon.com/blogs/migration-and-modernization/accelerate-your-mainframe-modernization-journey-using-ai-agents-with-aws-transform/)