Migrate on-premises Java applications to AWS using AWS App2Container
Created by Dhananjay Karanjkar (AWS)
Summary
Notice: AWS CodeCommit is no longer available to new customers. Existing customers of AWS CodeCommit can continue to use the service as normal. Learn more
AWS App2Container (A2C) is a command line tool that helps transform existing applications running in virtual machines into containers, without needing any code changes. A2C discovers applications running on a server, identifies dependencies, and generates relevant artifacts for seamless deployment to Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS).
This pattern provides the steps for remotely migrating on-premises Java applications deployed on an application server to AWS Fargate or Amazon EKS by using App2Container through the worker machine.
The worker machine can be used in the following use cases:
Docker installation is not allowed or not available on the application servers where the Java applications are running.
You must manage the migration of multiple applications deployed on different physical or virtual servers.
This pattern uses AWS CodeCommit, AWS CodePipeline, and AWS CodeBuild.
Prerequisites and limitations
Prerequisites
An application server with a Java application running on a Linux server
A worker machine with a Linux operating system
A worker machine with at least 20 GB of available disk space
Limitations
Not all applications are supported. For more information, see Supported applications for Linux.
Architecture
Source technology stack
Java applications running on Linux server
Target technology stack
AWS CodeBuild
AWS CodeCommit
AWS CodeDeploy
AWS CodePipeline
Amazon Elastic Container Registry
AWS Fargate
Target architecture
Tools
Tools
AWS App2Container – AWS App2Container (A2C) is a command line tool to help you lift and shift applications that run in your on-premises data centers or on virtual machines, so that they run in containers that are managed by Amazon ECS or Amazon EKS.
AWS CodeBuild – AWS CodeBuild is a fully managed build service in the cloud. CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy.
AWS CodeCommit – AWS CodeCommit is a version control service hosted by Amazon Web Services that you can use to privately store and manage assets (such as documents, source code, and binary files) in the cloud.
AWS CodePipeline – AWS CodePipeline is a continuous delivery service you can use to model, visualize, and automate the steps required to release your software.
Amazon ECS – Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast container management service that for running, stopping, and managing containers on a cluster.
Amazon ECR – Amazon Elastic Container Registry (Amazon ECR) is an AWS managed container image registry service that is secure, scalable, and reliable.
Amazon EKS – Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that you can use to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane or nodes.
AWS Fargate – AWS Fargate is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon Elastic Compute Cloud (Amazon EC2) instances. With Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers.
Epics
Task | Description | Skills required |
---|---|---|
Create a secret to access the application server. | To access the application server remotely from the worker machine, create a secret in AWS Secrets Manager. For your secret, you can use either the SSH private key or the Certificate and the SSH private key. For more information, see Manage secrets for AWS App2Container. | DevOps, Developer |
Task | Description | Skills required |
---|---|---|
Install the tar file. | Run | DevOps, Developer |
Install the AWS CLI. | To install the Amazon Command Line Interface (AWS CLI), run Unzip Run | DevOps, Developer |
Install App2Container. | Run the following commands:
| DevOps, Developer |
Configure the profiles. | To configure the AWS default profile, run To configure the named AWS default profile, run | DevOps, Developer |
Install Docker. | Run the following commands.
| |
Initialize App2Container. | To initialize App2Container, you need the following information:
Run | DevOps, Developer |
Task | Description | Skills required |
---|---|---|
Configure the worker machine to remotely connect and run App2Container commands on the application server. | To configure the worker machine, the following information is required:
Run | DevOps, Developer |
Task | Description | Skills required |
---|---|---|
Discover the on-premises Java applications. | To remotely discover all the applications running on the application server, run the following command.
This command generates a list of deployed applications in | Developer, DevOps |
Analyze the discovered applications. | To remotely analyze each application by using the application-id obtained in the inventory stage, run the following command.
This generates | Developer, DevOps |
Extract the analyzed applications. | To generate an application archive for the analyzed application, remotely run the following command, which will generate the tar bundle in the workspace location.
Extracted artifacts can be generated on the local worker machine. | Developer, DevOps |
Task | Description | Skills required |
---|---|---|
Containerize the extracted artifacts. | Containerize the artifacts extracted in the previous step by running the following command.
| Developer, DevOps |
Finalize the target. | To finalize the target, open | Developer, DevOps |
Task | Description | Skills required |
---|---|---|
Generate AWS deployment artifacts on the worker machine. | To generate deployment artifacts, run the following command.
This generates the | DevOps |
Provision the artifacts. | To further provision the generated artifacts, deploy the AWS CloudFormation template by running the following command.
| DevOps |
Generate the pipeline. | Modify | DevOps |