Dataset Viewer
Auto-converted to Parquet
id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
a2c-ug-001
a2c-ug.pdf
1
User Guide AWS App2Container Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. AWS App2Container User Guide AWS App2Container: User Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. AWS App2Container Table of Contents User Guide What is AWS App2Container? ......................................................................................................... 1 How App2Container works ......................................................................................................................... 1 Accessing AWS through App2Container .................................................................................................. 2 Pricing ............................................................................................................................................................. 2 Compatibility guide ......................................................................................................................... 3 Operating system compatibility ................................................................................................................ 3 Containerization features ............................................................................................................................ 5 Deployment features ................................................................................................................................... 6 Pipeline support ............................................................................................................................................ 8 Supported applications ................................................................................................................... 9 Complex Windows .NET apps .................................................................................................................. 13 Step 1: Setup and initialization ......................................................................................................... 13 Step 2: Analysis phase ......................................................................................................................... 13 Step 3: Containerization ...................................................................................................................... 16 Step 4: Deployment ............................................................................................................................. 17 Getting started .............................................................................................................................. 28 Understand Docker containers ................................................................................................................ 29 Decide where containerization will run ................................................................................................. 29 Prerequisites: Set up your servers .......................................................................................................... 30 Sign up for AWS ................................................................................................................................... 31 Grant permissions to run AWS App2Container commands .......................................................... 31 Enable remote access for a worker machine (optional) ................................................................ 32 Configure your AWS profile ................................................................................................................ 34 Install the Docker engine .................................................................................................................... 35 Step 1: Install App2Container ................................................................................................................. 37 Step 2: Initialize App2Container ............................................................................................................. 41 Step 3: Analyze your application ............................................................................................................ 43 Step 4: Transform your application ....................................................................................................... 45 Step 5: Deploy your application ............................................................................................................. 47 Step 6: Clean up ......................................................................................................................................... 49 App2Container Automation runbook ........................................................................................... 50 Prerequisites ................................................................................................................................................ 50 Create policies and roles for the automation ................................................................................. 51 Attaching the IAM role ........................................................................................................................ 60 iii AWS App2Container User Guide Run the automation .................................................................................................................................. 61 Runbook parameters ............................................................................................................................ 61 Running the automation ..................................................................................................................... 64 Reviewing output from the automation .......................................................................................... 65 Complete the modernization process .................................................................................................... 65 Configuring your application ........................................................................................................ 66 Manage secrets ........................................................................................................................................... 66 Create remote access secrets ............................................................................................................. 67 Create secrets for Jenkins pipelines ................................................................................................. 69 Create secrets for Microsoft Azure DevOps pipelines ................................................................... 72 Configure containers ................................................................................................................................. 74 Configure deployment .............................................................................................................................. 94 deployment.json file ............................................................................................................................. 94 Configure pipelines .................................................................................................................................. 113 pipeline.json file .................................................................................................................................. 113 Product and service integrations ............................................................................................... 123 Automatic storage and registration using Amazon Elastic Container Registry ........................... 123 Deploy to Amazon ECS ........................................................................................................................... 124 Prerequisites ........................................................................................................................................ 125 Amazon ECS integration for App2Container workflow .............................................................. 126 Deploy to Amazon EKS ........................................................................................................................... 129 Prerequisites ........................................................................................................................................ 129 Amazon EKS integration for App2Container workflow .............................................................. 129 Deploy to App Runner ............................................................................................................................ 132 Prerequisites ........................................................................................................................................ 133 App Runner integration for App2Container workflow ............................................................... 133 Set up CodePipeline pipelines .............................................................................................................. 135 Validation ............................................................................................................................................. 136 Output ................................................................................................................................................... 137 Set up Jenkins pipelines ......................................................................................................................... 138 Prerequisites ........................................................................................................................................ 138 Jenkins integration for App2Container workflow ....................................................................... 139 Set up Azure DevOps pipelines ............................................................................................................ 141 Prerequisites ........................................................................................................................................ 142 Azure DevOps integration for App2Container workflow ........................................................... 143 Route logs using FireLens ...................................................................................................................... 149 iv AWS App2Container User Guide FireLens log routing for Linux ......................................................................................................... 149 Security ........................................................................................................................................ 162 Data protection ........................................................................................................................................ 162 Data encryption .................................................................................................................................. 163 Internetwork traffic privacy .............................................................................................................. 164 Identity and access management ......................................................................................................... 164 Create IAM resources for general use ............................................................................................ 166 Create IAM resources for deployment ........................................................................................... 181 Update management .............................................................................................................................. 182 Command reference .................................................................................................................... 183 Containerization phases ......................................................................................................................... 183 Initialize ................................................................................................................................................. 183 Analyze .................................................................................................................................................. 184 Transform ............................................................................................................................................. 185 Deploy ................................................................................................................................................... 186 Utility commands ..................................................................................................................................... 187 analyze ....................................................................................................................................................... 187 Syntax .................................................................................................................................................... 188 Parameters and options .................................................................................................................... 188 Output ................................................................................................................................................... 188 Examples ............................................................................................................................................... 189 containerize ............................................................................................................................................... 190 Syntax .................................................................................................................................................... 190 Parameters and options .................................................................................................................... 190 Output ................................................................................................................................................... 191 Examples ............................................................................................................................................... 192 extract ......................................................................................................................................................... 194 Syntax .................................................................................................................................................... 194 Parameters and options .................................................................................................................... 195 Output ................................................................................................................................................... 195 Examples ............................................................................................................................................... 195 generate app-deployment ..................................................................................................................... 196 Syntax .................................................................................................................................................... 198 Parameters and options .................................................................................................................... 198 Output ................................................................................................................................................... 199 Examples ............................................................................................................................................... 201 v AWS App2Container User Guide generate pipeline ..................................................................................................................................... 205 Syntax .................................................................................................................................................... 207 Parameters and options .................................................................................................................... 207 Output ................................................................................................................................................... 208 Examples ............................................................................................................................................... 210 help ............................................................................................................................................................. 216 Syntax .................................................................................................................................................... 217 Parameters and options .................................................................................................................... 217 Output ................................................................................................................................................... 217 Examples ............................................................................................................................................... 217 init ............................................................................................................................................................... 218 Syntax .................................................................................................................................................... 218 Parameters and options .................................................................................................................... 218 Output ................................................................................................................................................... 219 Examples ............................................................................................................................................... 220 inventory .................................................................................................................................................... 222 Syntax .................................................................................................................................................... 222 Parameters and options .................................................................................................................... 222 Output ................................................................................................................................................... 223 Examples ............................................................................................................................................... 223 remote analyze ......................................................................................................................................... 225 Syntax .................................................................................................................................................... 225 Parameters and options .................................................................................................................... 226 Output ................................................................................................................................................... 226 Examples ............................................................................................................................................... 227 remote configure ..................................................................................................................................... 228 Syntax .................................................................................................................................................... 228 Parameters and options .................................................................................................................... 228 Input ...................................................................................................................................................... 228 Output ................................................................................................................................................... 230 Examples ............................................................................................................................................... 230 remote extract .......................................................................................................................................... 231 Syntax .................................................................................................................................................... 232 Parameters and options .................................................................................................................... 232 Output ................................................................................................................................................... 232 Examples ............................................................................................................................................... 233 vi AWS App2Container User Guide remote inventory ..................................................................................................................................... 233 Syntax ....................................................................................................................................................
a2c-ug-002
a2c-ug.pdf
2
218 Syntax .................................................................................................................................................... 218 Parameters and options .................................................................................................................... 218 Output ................................................................................................................................................... 219 Examples ............................................................................................................................................... 220 inventory .................................................................................................................................................... 222 Syntax .................................................................................................................................................... 222 Parameters and options .................................................................................................................... 222 Output ................................................................................................................................................... 223 Examples ............................................................................................................................................... 223 remote analyze ......................................................................................................................................... 225 Syntax .................................................................................................................................................... 225 Parameters and options .................................................................................................................... 226 Output ................................................................................................................................................... 226 Examples ............................................................................................................................................... 227 remote configure ..................................................................................................................................... 228 Syntax .................................................................................................................................................... 228 Parameters and options .................................................................................................................... 228 Input ...................................................................................................................................................... 228 Output ................................................................................................................................................... 230 Examples ............................................................................................................................................... 230 remote extract .......................................................................................................................................... 231 Syntax .................................................................................................................................................... 232 Parameters and options .................................................................................................................... 232 Output ................................................................................................................................................... 232 Examples ............................................................................................................................................... 233 vi AWS App2Container User Guide remote inventory ..................................................................................................................................... 233 Syntax .................................................................................................................................................... 234 Parameters and options .................................................................................................................... 234 Output ................................................................................................................................................... 230 Examples ............................................................................................................................................... 230 upgrade ...................................................................................................................................................... 237 Syntax .................................................................................................................................................... 237 Options ................................................................................................................................................. 238 Output ................................................................................................................................................... 238 Examples ............................................................................................................................................... 238 upload-support-bundle ........................................................................................................................... 238 Syntax .................................................................................................................................................... 239 Options ................................................................................................................................................. 239 Output ................................................................................................................................................... 239 Examples ............................................................................................................................................... 239 Troubleshooting ........................................................................................................................... 241 Access App2Container logs on your server ........................................................................................ 241 Access application logs inside of a running container ..................................................................... 242 AWS resource creation fails for the generate command ................................................................. 242 Description ........................................................................................................................................... 242 Cause ..................................................................................................................................................... 243 Solution ................................................................................................................................................. 243 Troubleshoot Java applications on Linux ............................................................................................ 243 Troubleshoot .NET applications on Windows ..................................................................................... 245 Troubleshoot generate pipeline build for Jenkins ............................................................................ 246 Release notes ............................................................................................................................... 248 Document history ........................................................................................................................ 276 vii AWS App2Container User Guide What is 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, Amazon EKS, or AWS App Runner. For a console-based experience, you can use the Replatform applications to Amazon ECS template in the AWS Migration Hub Orchestrator console. For more information, see Replatform applications to Amazon ECS in the AWS Migration Hub Orchestrator User Guide. Moving legacy applications to containers is often the starting point toward application modernization. There are many benefits to containerization: • Reduces operational overhead and infrastructure costs • Increases development and deployment agility • Standardizes build and deployment processes across an organization Contents • How App2Container works • Accessing AWS through App2Container • Pricing How App2Container works You can use App2Container to generate container images for one or more applications running on Windows or Linux servers that are compatible with the Open Containers Initiative (OCI). This includes commercial off-the-shelf applications (COTs). App2Container does not need source code for the application to containerize it. You can use App2Container directly on the application servers that are running your applications, or perform the containerization and deployment steps on a worker machine. App2Container performs the following tasks: • Creates an inventory list for the application server that identifies all running ASP.NET (Windows) and Java applications (Linux) that are candidates to containerize. How App2Container works 1 AWS App2Container User Guide • Analyzes the runtime dependencies of supported applications that are running, including cooperating processes and network port dependencies. • Extracts application artifacts for containerization and generates a Dockerfile. • Initiates builds for the application container. • Generates AWS artifacts and optionally deploys the containers on Amazon ECS, Amazon EKS, or AWS App Runner. For example: • a CloudFormation template to configure required compute, network, and security infrastructure to deploy containers using Amazon ECS, Amazon EKS, or AWS App Runner. • An Amazon ECR container image, Amazon ECS task definitions, or AWS CloudFormation templates for Amazon EKS or AWS App Runner that incorporate best practices for security and scalability of the application by integrating with various AWS services. • When deploying directly, App2Container can upload AWS CloudFormation resources to an Amazon S3 bucket, and create a CloudFormation stack. • Optionally creates a CI/CD pipeline with AWS CodePipeline and associated services, to automate building and deploying your application containers. Accessing AWS through App2Container When you initialize App2Container, you provide it with your AWS credentials. This allows App2Container to do the following: • Store artifacts in Amazon S3, if you configured it to do so. • Create and deploy application containers using AWS services such as Amazon ECS, Amazon EKS, and AWS App Runner. • Create CI/CD pipelines using AWS CodePipeline. Pricing App2Container is offered at no additional charge. You are charged only when you use other AWS services to run your containerized application, such as Amazon ECR, Amazon ECS, Amazon EKS, and AWS App Runner. For more information, see AWS Pricing. Accessing AWS through App2Container 2 AWS App2Container User Guide App2Container compatibility The following documentation provides information for the operating systems, software, and tooling that you can use with App2Container. Contents • Operating system compatibility • Containerization features • Deployment features • Pipeline support Operating system compatibility The following table contains information about the applications that App2Container supports for each operating system. Compatibility item Linux Windows Supported application server operating systems 1 • Ubuntu (version
a2c-ug-003
a2c-ug.pdf
3
other AWS services to run your containerized application, such as Amazon ECR, Amazon ECS, Amazon EKS, and AWS App Runner. For more information, see AWS Pricing. Accessing AWS through App2Container 2 AWS App2Container User Guide App2Container compatibility The following documentation provides information for the operating systems, software, and tooling that you can use with App2Container. Contents • Operating system compatibility • Containerization features • Deployment features • Pipeline support Operating system compatibility The following table contains information about the applications that App2Container supports for each operating system. Compatibility item Linux Windows Supported application server operating systems 1 • Ubuntu (version 18.04 and • Windows Server 2016 and later) later 2 Container hosts • CentOS (version 8 and later) • RHEL (version 7 and later) • Amazon Linux 2 (AL2) • Amazon Linux 2023 (AL2023) The container host can be any supported application server operating system. The major kernel version of the container host must match with the container image. The container host operating system must be either Windows Server 2016, 2019, or 2022. The Windows Server operating system version of the container host must match the container image. Operating system compatibility 3 AWS App2Container User Guide Compatibility item Linux Windows App2Container automatically deploys the container host using the same operating system used for the container ization process. Application types • Java applications • IIS .NET applications .NET Framework version 3.5 and 4.x • .NET applications Supported frameworks • Java (JDK 1.8 and later) • Tomcat • TomEE • JBoss (standalone mode) • .NET applications • .NET Core 3.1 • .NET 5 • .NET 6 • .NET 7 • .NET 8 • .NET 9 Unsupported application features High Availability (HA) clusters • IIS applications that use files and registries outside of IIS web application directories Operating system compatibility 4 AWS App2Container User Guide Compatibility item Linux Windows Additional system requireme nts • Docker version 17.07 and • Docker version 17.07 and later 3 later 3 • kubectl versions up to v1.30 for Amazon EKS • kubectl versions up to v1.30 for Amazon EKS deployments. deployments. • Windows IIS (7.5 and later) • Windows PowerShell version 5.1 or PowerShell version 6 and later 1 We have only tested the operating systems and configurations listed. Other operating systems could be compatible, but have not been tested. 2 App2Container v1.47 is the last version that supports Windows 2008 and 2012. These operating systems also require a worker machine. We recommend using a later version of the Windows Server operating system to be able to use the latest version of App2Container. For more information, see Applications you can containerize using AWS App2Container. 3 Docker must be installed to use App2Container. For more information, see Prerequisites: Set up your servers. Note Windows client operating systems such as Windows 7 and Windows 10 aren't supported. Containerization features App2Container supports the following containerization features. Containerization feature Linux gMSA for connection with Active Directory Not supported Windows Supported Containerization features 5 AWS App2Container User Guide Containerization feature Linux Windows Containerization of multiple applications in the same container Containerization of applicati ons that use multiple ports Not supported Supported * Not supported Supported * Containerizing multiple applications in the same container for Windows requires that the applications are nested under a main IIS site. For more information about configuring Windows containers with additional ports and multiple applications, see Configuring application containers. For more information about group managed service accounts (gMSAs), see Configuring container deployment. Deployment features The following table lists the deployment services that App2Container supports. Deploymen t feature Linux Amazon ECS (AWS Fargate only) Amazon EKS (Amazon EC2 only) Supported Supported Windows Amazon ECS (AWS Fargate) AWS App Runner Not supported Supported 1 Amazon ECS (Amazon EC2) Amazon EKS (Amazon EC2 only) Supported Supported Supported Supported Not supported Supported Supported Supported Modify memory usage Modify CPU usage Deployment features 6 AWS App2Container Deploymen t feature Linux Load balancer types Applicati on Load Balancer Applicati on Load Balancer, Network Load Balancer with Nginx Windows N/A Applicati on Load Balancer Applicati on Load Balancer User Guide Applicati on Load Balancer, Network Load Balancer with Nginx Supported Supported Not supported Supported Supported Supported Supported Supported N/A Supported Supported Supported Supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Supported Supported Reuse VPC ² Reuse cluster previously deployed with App2Conta iner 2 FireLens logging gMSA for connection with Active Directory N/A N/A Supported Supported Supported N/A Deploy complex .NET applicati ons 3 1 AWS Fargate only supports certain Windows Server operating systems for running Windows containers. Select a Windows Server operating system that both Fargate and App2Container Deployment features 7 AWS App2Container User Guide support. For more information, see Windows platform versions in the Amazon ECS User Guide for AWS Fargate. 2 You
a2c-ug-004
a2c-ug.pdf
4
Not supported Not supported Not supported Not supported Not supported Not supported Not supported Not supported Supported Supported Reuse VPC ² Reuse cluster previously deployed with App2Conta iner 2 FireLens logging gMSA for connection with Active Directory N/A N/A Supported Supported Supported N/A Deploy complex .NET applicati ons 3 1 AWS Fargate only supports certain Windows Server operating systems for running Windows containers. Select a Windows Server operating system that both Fargate and App2Container Deployment features 7 AWS App2Container User Guide support. For more information, see Windows platform versions in the Amazon ECS User Guide for AWS Fargate. 2 You can reuse certain components that App2Container created for a prior deployment. For more information about the reuseResources object, see Configuring container deployment. 3 A complex .NET application has multiple Windows .NET application components running in a single container. For more information, see Containerizing complex Windows .NET applications with App2Container. For more information about FireLens for Amazon ECS, see Custom log routing in the Amazon Elastic Container Service Developer Guide. For more information about deployment settings for group managed service accounts (gMSAs), see Configuring container deployment. Pipeline support App2Container supports AWS CodePipeline, Jenkins, and Azure DevOps Services pipeline types for both Windows and Linux. For more information about configuring pipelines, see Configuring container pipelines and Examples. Pipeline support 8 AWS App2Container User Guide Applications you can containerize using AWS App2Container App2Container supports the following application types: • Java applications (Linux) • ASP.NET applications (Windows, Linux) For supported application frameworks, App2Container targets only the application files and dependencies that are needed for containerization, thereby minimizing the size of the resulting container image. This is known as application mode. If App2Container does not find a supported framework running on your application server, or if you have other dependent processes running on your server, App2Container takes a conservative approach to identifying dependencies. This is known as process mode. For process mode, all non- system files on the application server are included in the container image. For more details on application and framework support, expand the section that matches the platform that your application runs on. Important App2Container does not containerize database layer components. If your application requires access to a database, you must configure your application container to have access to the database server. Supported applications for Linux App2Container supports identification and containerization of Java and ASP.NET applications running on Linux. Supported Linux distributions: • Ubuntu • CentOS Supported applications for Linux 9 AWS App2Container • RHEL • Amazon Linux User Guide For supported frameworks, and other language-specific details, choose the tab that matches the language your application is written in. Java For Java applications, App2Container identifies Java processes, and can generate container images that replicate the running state of each process. App2Container determines which files to include in the application container image, based on the Java application framework. Application mode is supported for the following Java application frameworks: Supported frameworks • Tomcat • TomEE • JBoss (standalone mode) Note Containerization is not supported for Java applications running on frameworks that are using Cluster/HA mode. ASP.NET For ASP.NET applications running on Linux, App2Container detects the .NET runtime version and containerizes the application using the corresponding runtime base images. Supported .NET Core runtime versions • .NET Core 3.1 – uses SDK version 3.1 as the base image for generic .NET Core applications (or the highest version if multiple versions are used). • .NET 5 – uses SDK version 5.0 as the base image for generic .NET Core applications (or the highest version if multiple versions are used). Supported applications for Linux 10 AWS App2Container User Guide • .NET 6 – uses SDK version 6.0 as the base image for generic .NET Core applications (or the highest version if multiple versions are used). • .NET 7 – uses SDK version 7.0 as the base image for generic .NET Core applications (or the highest version if multiple versions are used). • .NET 8 – uses SDK version 8.0 as the base image for generic .NET Core applications (or the highest version if multiple versions are used). Important • Process mode is not supported for ASP.NET applications running on .NET Core. • If you are using .NET Core 3.1 or .NET 5, you must update the analysis.json file's containerBaseImage parameter to mcr.microsoft.com/dotnet/sdk:3.1 or mcr.microsoft.com/dotnet/sdk:5.0, respectively. For more information, see Configuring application containers. Supported applications for Windows App2Container supports containerization of ASP.NET applications deployed on IIS, including IIS- hosted WCF applications, running on Windows Server 2016, 2019, and 2022. It uses Windows Server Core as a base image for its container artifacts, matching the Windows Server Core version to the operating system (OS) version of the server where you run containerization commands. If you use a worker machine to containerize your application, the version matches your worker machine OS.
a2c-ug-005
a2c-ug.pdf
5
3.1 or .NET 5, you must update the analysis.json file's containerBaseImage parameter to mcr.microsoft.com/dotnet/sdk:3.1 or mcr.microsoft.com/dotnet/sdk:5.0, respectively. For more information, see Configuring application containers. Supported applications for Windows App2Container supports containerization of ASP.NET applications deployed on IIS, including IIS- hosted WCF applications, running on Windows Server 2016, 2019, and 2022. It uses Windows Server Core as a base image for its container artifacts, matching the Windows Server Core version to the operating system (OS) version of the server where you run containerization commands. If you use a worker machine to containerize your application, the version matches your worker machine OS. If you are running containerization directly on application servers, the version matches your application server OS. If your applications are running on Windows Server 2008 or 2012 R2, you might still be able to use App2Container by setting up a worker machine for containerization and deployment steps. App2Container does not support applications running on Windows client operating systems, such as Windows 7 or Windows 10. Application framework and system requirements • Containerization commands must run on Windows OS versions that support containers— Windows Server 2016, 2019, or 2022. This can be the worker machine, if you configure one, or the application server. Supported applications for Windows 11 AWS App2Container User Guide • If you use a worker machine to run containerization commands, App2Container supports Windows Server 2008 and up for the application server. Note Windows Server 2008 and 2012 only support App2Container up to version 1.47. For more information, see Release notes for AWS App2Container. • IIS 7.5 or later. • .NET framework version 3.5 or later. • Docker version 17.07 or later (to install). Note App2Container does not support applications running on Windows client operating systems, such as Windows 7 or Windows 10. Supported applications • Simple ASP.NET applications running in a single container • A Windows service running in a single container • Complex ASP.NET applications that depend on WCF, running in a single container or multiple containers • Complex ASP.NET applications that depend on Windows services or processes outside of IIS, running in a single container or multiple containers • Complex, multi-node IIS or Windows service applications, running in a single container or multiple containers Unsupported applications • ASP.NET applications that use files and registries outside of IIS web application directories • ASP.NET applications that depend on features of a Windows operating system version prior to Windows Server Core 2016 Supported applications for Windows 12 AWS App2Container User Guide Containerizing complex Windows .NET applications with App2Container Containerization for complex multi-tier Windows .NET applications requires careful planning. When functionality is shared between the root application and one or more lower-level or system applications, you need to make decisions about packaging, deployment, and orchestration for all of the components. To summarize how AWS App2Container works to containerize a complex Windows .NET application, we'll visit each step in the App2Container workflow, and call out the highlights and things to consider. Step 1: Setup and initialization Setup and initialization are the same for complex Windows .NET applications as for other types of applications. Setup tasks include installing software, configuring your AWS profile and IAM permissions, and deciding which servers the App2Container commands should run on. To learn more about setting up your environment before running App2Container for the first time, see Prerequisites: Set up your servers. After you have completed the setup tasks, but before you use App2Container for the first time, you must initialize the servers where you plan to run App2Container commands. To learn more about initialization and worker machine configuration, see the Initialize section in the App2Container command reference. Step 2: Analysis phase After you have completed setup and initialization tasks on your servers, App2Container helps you to take an inventory of your running applications, and perform analysis to determine what should be included in your application containers. Inventory The first step in the analysis phase is to take an inventory of your applications. When you run the app2container inventory command (or the app2container remote inventory command, if you have configured a worker machine), App2Container detects the applications that are running in IIS. It also detects the Windows services that could be configured as dependent application components. Complex Windows .NET apps 13 AWS App2Container User Guide App2Container identifies each IIS application or Windows service as a separate application, with its own application ID in the inventory.json file. App2Container makes an effort to exclude basic operating system services that you would not want to add to your containers. However, even when these services are excluded, the inventory list can still be quite long. To narrow the results of the app2container inventory or app2container remote inventory commands, you can specify what type of application you are looking for with the --type option: • To run an inventory of your IIS
a2c-ug-006
a2c-ug.pdf
6
Windows .NET apps 13 AWS App2Container User Guide App2Container identifies each IIS application or Windows service as a separate application, with its own application ID in the inventory.json file. App2Container makes an effort to exclude basic operating system services that you would not want to add to your containers. However, even when these services are excluded, the inventory list can still be quite long. To narrow the results of the app2container inventory or app2container remote inventory commands, you can specify what type of application you are looking for with the --type option: • To run an inventory of your IIS applications, you can set the --type option to "iis". • To run an inventory of your Windows services, you can set the --type option to "service". If you don't want App2Container to filter inventory results at all, you can use the --nofilter option. This option prevents App2Container from filtering out default system services when building the inventory list. For more information and command syntax, see the inventory or remote inventory command in the command reference section. Analysis When you run the app2container analyze or app2container remote analyze commands, App2Container analyzes the application component that you specify with the --application-id parameter. App2Container creates the folder structure for the application component, inside of the App2Container directory on your application server or worker machine. It produces the analysis.json file, and saves it to the new folder structure, along with other artifacts that are required for containerization. The analysis.json file is where you begin to define your container structure. Tip Run the app2container analyze or app2container remote analyze command for every component in your multi-tier application before you configure your container structure. You can implement the following container structures for a multi-tier Windows .NET application: • Multiple application components running in separate containers (recommended) Step 2: Analysis phase 14 AWS App2Container User Guide In this scenario, each application component in your multi-tier Windows .NET application runs in a separate container. Relationships between the root application and up to two dependent applications are configured in the deployment.json file for the root application. This file is produced during the containerization phase. When your application components are running in separate containers, leave the additionalApps array in the analysis.json file empty for all components. • Multiple application components running in a single container In this scenario, the application components in a multi-tier Windows .NET application run together in one container. We recommend that packaging multiple application components in a single container is only done when there are cross-dependencies between the components. To specify multiple application components running in a single container, you can include up to five dependent component application IDs in the additionalApps array in the analysis.json file for the root application. Note This configuration has the following limitations: • Only the port that is defined for the root application is exposed to outside traffic through your load balancer. Ports that are defined for other application components are exposed only from the container, and are not accessible through the load balancer. • If you are using remote commands on a worker machine, all of the application components in a multi-tier application must be running on the same application server if you want them to run in a single container. To learn more about configuring containers, see Configuring application containers. To compare configuration examples for a simple .NET application, and for complex multi-tier .NET applications, expand the Containers running on Windows section, and explore the example tabs. For more information and command syntax, see the analyze or remote analyze command in the command reference section. Step 2: Analysis phase 15 AWS App2Container User Guide Step 3: Containerization This phase creates containers for your application, based on the output of the analysis phase and on your configuration in the analysis.json file. Extract If you are using a worker machine to run App2Container commands, or if you want to store an application archive for reference, this phase starts with an app2container extract or app2container remote extract command. Because this has no effect on the configuration for multi-tier application containers, we will not cover that here. Containerize The app2container containerize command performs the following tasks for the application that's specified in the --application id parameter: • Extracts application artifacts from the server it runs on, or reads from an extract archive. For complex multi-tier applications, the extract includes all artifacts that are needed for all of the components running in the container. • Generates a Dockerfile and a container image, based on the application artifacts and the application settings in the analysis.json file. • Creates the deployment.json file that defines initial settings for container deployment during the deployment phase. You must run the app2container containerize command for the root application container, and for each additional application component that runs in a
a2c-ug-007
a2c-ug.pdf
7
the --application id parameter: • Extracts application artifacts from the server it runs on, or reads from an extract archive. For complex multi-tier applications, the extract includes all artifacts that are needed for all of the components running in the container. • Generates a Dockerfile and a container image, based on the application artifacts and the application settings in the analysis.json file. • Creates the deployment.json file that defines initial settings for container deployment during the deployment phase. You must run the app2container containerize command for the root application container, and for each additional application component that runs in a separate container. Do not run the command for any components that are included in the root application container. The command displays real-time task completion messages, followed by instructions for next steps. This includes the AWS commands that you run if you are deploying manually. To configure the deployment.json file for a complex multi-tier application, refer to the following scenario that describes your implementation: • Multiple application components running in separate containers In this scenario, each application component is running in a separate container, and each has its own deployment file. Before running the generate app-deployment command, configure the Step 3: Containerization 16 AWS App2Container User Guide deployment.json file for the root application to include all dependent applications or services in the dependentApps array, including the application ID, private root domain, and DNS record name for each one. • Multiple application components running in a single container If you are running multiple application components in a single container, the process for configuring the deployment.json file is the same as for any other containerized application. Leave the dependentApps array empty. Note If you are deploying to a specific VPC, make sure that all components point to that VPC in the vpcId parameter in the reuseResources array in the deployment.json file. To learn more about configuring your deployment.json file, see Configuring container deployment. For more information and command syntax for creating your application container, see the containerize command in the command reference section. Step 4: Deployment Deployment steps for complex Windows .NET applications with multiple application components running in a single container are handled the same as any other application deployment. For more information and command syntax for deploying your application container, see the generate app- deployment command in the command reference section. The remainder of the content in this section applies to complex Windows .NET applications that have multiple application components running in separate containers, similar to the application example shown in the following diagrams: Amazon ECS deployment Step 4: Deployment 17 AWS App2Container User Guide Step 4: Deployment 18 AWS App2Container Amazon EKS deployment User Guide Step 4: Deployment 19 AWS App2Container User Guide Step 4: Deployment 20 AWS App2Container User Guide Normally, you run the generate app-deployment command for each application container that you create. However, with complex Windows .NET applications that have dependent applications running in separate containers, App2Container takes care of some of that for you. When you run the generate app-deployment command for the root application, App2Container completes the following tasks for the root application and each of its dependent application components: • Checks for AWS and Docker prerequisites. • Creates an Amazon ECR repository. • Pushes the container image to the Amazon ECR repository. • Generates the following artifacts, depending on your target container management service: Amazon ECS • An Amazon ECS task definition. • The ecs-master.yml file that you can use for Amazon ECS deployment. Amazon EKS • The Kubernetes eks-master.yml file that you can use for Amazon EKS deployment. • The eks_deployment.yaml and eks_service.yaml files that you can use with the kubectl command. • Generates a pipeline.json file. Additionally, if you use the --deploy option, App2Container takes care of all of those deployments in the order in which they need to run, and configures shared infrastructure settings. When App2Container handles the deployment for you, it follows these conventions: • The root application and all dependent application components are deployed to the same cluster. • All dependent application components are configured with an internal load balancer only. • Each application component has its own Amazon ECS or Amazon EKS service running in a shared cluster. If you want to customize the deployment artifacts, you can deploy manually, using the AWS Management Console or AWS CLI when you are ready. For deployment steps, choose the tab that matches your deployment scenario. Step 4: Deployment 21 AWS App2Container Automated (A2C) User Guide Follow these steps if you are using the App2Container automated deployment. 1. Verify that the values are set correctly in the deployment.json files for all of your application components, before running the generate app-deployment command for your root application, as follows: • None of the application components in the multi-tier application should specify reuseCfnStack. •
a2c-ug-008
a2c-ug.pdf
8
If you want to customize the deployment artifacts, you can deploy manually, using the AWS Management Console or AWS CLI when you are ready. For deployment steps, choose the tab that matches your deployment scenario. Step 4: Deployment 21 AWS App2Container Automated (A2C) User Guide Follow these steps if you are using the App2Container automated deployment. 1. Verify that the values are set correctly in the deployment.json files for all of your application components, before running the generate app-deployment command for your root application, as follows: • None of the application components in the multi-tier application should specify reuseCfnStack. • Dependent application components should not specify any of the following parameters: vpcId, gMSAParameters. • The following parameters can be specified in the root application, and App2Container applies the same values for all dependent application components: vpcId, resourceTags, and gMSAParameters. 2. The following example shows the generate app-deployment command for the root application in our sample multi-tier application, using the --deploy option, with the --application-id parameter set to the application ID for the root application. This example handles the full deployment for all application components. PS> app2container generate app-deployment --deploy --application-id iis- colormvciis-b69c09ab --profile admin-profile √ AWS prerequisite check succeeded √ Docker prerequisite check succeeded ... [more notifications as deployment steps are completed for each dependent application component, followed by the root application and shared configurations] Deployment successful for application iis-colormvciis-b69c09ab The URL to your Load Balancer Endpoint is: a2c-i-Publi-1A2BCD3EFGRW-4567890123.us-west-2.elb.amazonaws.com Successfully created Amazon ECS stack a2c-iis-colormvciis-b69c09ab-ECS. Check the AWS CloudFormation Console for additional details. 3. Set up a pipeline for your application stack using app2container: app2container generate pipeline --application-id iis-colormvciis- b69c09ab Step 4: Deployment 22 AWS App2Container User Guide The first deployment for a dependent application component creates shared AWS resources, such as the VPC and Amazon ECS or Amazon EKS cluster. After the first dependent application component is successfully deployed, App2Container updates deployment artifacts for all of the other application components to reference the shared AWS resources prior to completing the remaining deployments. Manual (AWS CLI) Follow these steps to customize your deployment files and use the AWS CLI to deploy manually. We do not include AWS Management Console instructions here. However, you can follow the same general order of operations in the console. 1. Verify that the values are set correctly in the deployment.json files for all of your application components, before running the generate app-deployment command for your root application, as follows: • None of the application components in the multi-tier application should specify reuseCfnStack. • Dependent application components should not specify any of the following parameters: vpcId, gMSAParameters. • The following parameters can be specified in the root application, and App2Container applies the same values for all dependent application components: vpcId, resourceTags, and gMSAParameters. 2. The following example shows the generate app-deployment command for the root application in our sample multi-tier application, with the --application-id parameter set to the application ID for the root application. The --deploy option is not used in this case, as we plan to customize deployment files and then deploy using AWS CLI commands to control deployment for each application component. Note App2Container creates deployment artifacts for all application components in the complex Windows .NET application when you run the generate app-deployment command for the root application. Step 4: Deployment 23 AWS App2Container User Guide Use the generate app-deployment command, specifying the application ID for your root application, as follows: PS> app2container generate app-deployment --application-id iis-colormvciis- b69c09ab --profile admin-profile √ AWS prerequisite check succeeded √ Docker prerequisite check succeeded ... [more notifications as deployment steps are completed for each dependent component, followed by the root application and shared configurations] CloudFormation templates and additional deployment artifacts generated successfully for application iis-colormvciis-b69c09ab You're all set to use AWS CloudFormation to manage your application stack. Next Steps: 1. Create application stacks for first dependent application using the AWS CLI or the AWS Console. AWS CLI commands: aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\iis-dependentappb-12345bcd\EcsDeployment\ecs-master.yml -- capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name a2c-iis- dependentappb-12345bcd-ECS 2. Required! Reuse the VpcId, ClusterId and PublicSubnets from above CloudFormation console outputs and assign them in master templates of service- colorwindowsservice-69f90194, iis-colormvciis-b69c09ab If your other dependent application(s) that share the same root domain, also assign HostedZoneId to their master template(s). Create application stacks for remaining applications using the AWS CLI or the AWS Console. AWS CLI commands: aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\service-colorwindowsservice-69f90194\EcsDeployment\ecs- master.yml --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack- name a2c-service-colorwindowsservice-69f90194-ECS aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\iis-colormvciis-b69c09ab\EcsDeployment\ecs-master.yml -- capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name a2c-iis- colormvciis-b69c09ab-ECS 3. Set up a pipeline for your application stack using app2container: Step 4: Deployment 24 AWS App2Container User Guide app2container generate pipeline --application-id iis-colormvciis- b69c09ab 3. Review the deployment artifacts that were generated in the prior step, and customize the YAML deployment templates and other deployment artifacts as needed. Manual deployment follows this
a2c-ug-009
a2c-ug.pdf
9
to their master template(s). Create application stacks for remaining applications using the AWS CLI or the AWS Console. AWS CLI commands: aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\service-colorwindowsservice-69f90194\EcsDeployment\ecs- master.yml --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack- name a2c-service-colorwindowsservice-69f90194-ECS aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\iis-colormvciis-b69c09ab\EcsDeployment\ecs-master.yml -- capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name a2c-iis- colormvciis-b69c09ab-ECS 3. Set up a pipeline for your application stack using app2container: Step 4: Deployment 24 AWS App2Container User Guide app2container generate pipeline --application-id iis-colormvciis- b69c09ab 3. Review the deployment artifacts that were generated in the prior step, and customize the YAML deployment templates and other deployment artifacts as needed. Manual deployment follows this step, beginning with one of the dependent applications. The first deployment creates any shared infrastructure that is required. Note If you are using an existing VPC, the vpcId that you specified in the deployment.json file for the root application should be reflected in the YAML deployment templates for all of the dependent applications. 4. To deploy your first dependent application and create shared infrastructure, run the following command in the AWS CLI, using your dependent application's details. PS> aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\iis-dependentappb-12345bcd\EcsDeployment\ecs-master.yml -- capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name a2c-iis- dependentappb-12345bcd-ECS 5. After your first stack is ready (stack status is CREATE_COMPLETE), update the YAML deployment templates for all remaining application components in your application to reference the following shared infrastructure in the parameters for existing resources: • VpcId • PublicSubnets • ClusterId Additionally, for any remaining dependent applications, update the following references: • DomainName • RecordName • ExistingHostedZoneId – update this if dependent applications share the root domain, or if they are using an existing domain. Step 4: Deployment 25 AWS App2Container User Guide • RecordExist – set this to "true" (string) if the record already exists in the hosted zone. If you are creating a new domain, set this to "false". The default value is "true". 6. Deploy any remaining dependent applications, using your application component information and the updated YAML deployment templates, with the cloudformation deploy command. The following command example deploys the service component in our sample multi-tier application. PS> aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\service-colorwindowsservice-69f90194\EcsDeployment\ecs- master.yml --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack- name a2c-service-colorwindowsservice-69f90194-ECS 7. After you've created all of your dependent component stacks, deploy your root application with the cloudformation deploy command. The following command example deploys the root application in our sample multi-tier application. PS> aws cloudformation deploy --template-file C:\Users\Administrator\AppData \Local\app2container\iis-colormvciis-b69c09ab\EcsDeployment\ecs-master.yml -- capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name a2c-iis- colormvciis-b69c09ab-ECS Tip It can take a few minutes to spin up a CloudFormation stack, along with the other infrastructure that is created for your deployment. You can use one of the following methods to check the stack status for your deployment: • Sign in to the AWS Management Console and open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation. In the console, you can see stacks that are being created, as well as existing stacks. For more information, see Viewing AWS CloudFormation stack data and resources on the AWS Management Console in the AWS CloudFormation User Guide. • Use one of these AWS CloudFormation commands in the AWS CLI: list-stacks or describe-stacks. For more information, see Available Commands in the AWS CLI Command Reference. Step 4: Deployment 26 AWS App2Container User Guide • Use one of these AWS CloudFormation API commands: ListStacks or DescribeStacks. For more information, see Actions in the AWS CloudFormation API Reference. Step 4: Deployment 27 AWS App2Container User Guide Getting started with AWS App2Container AWS App2Container is a tool that helps you break down the work of moving your applications into containers, and configuring them to be hosted in AWS using the Amazon ECS, Amazon EKS, or App Runner container management services. The following sections demonstrate the initial setup of your containerization environment, starting with prerequisites and initial workflow decisions. Then we take you step by step through containerizing a basic application using App2Container. We generate the artifacts that you can use to deploy it on Amazon ECS, Amazon EKS, or AWS App Runner, and then we clean up. Note To avoid creating billable AWS resources, we stop before the final deployment. You can review the deployment artifacts that are created by the generate app-deployment command to see what we would create. For an overview of the command phases that includes summary information and command reference links for all of the App2Container commands, see the App2Container command reference. Contents • Understand Docker containers • Decide where containerization will run • Prerequisites: Set up your servers • Step 1: Install App2Container • Step 2: Initialize App2Container • Step 3: Analyze your application • Step 4: Transform your application • Step 5: Deploy your application • Step 6: Clean up 28 AWS App2Container User Guide Understand Docker containers The following resources can help you get the most out of your application containers by understanding what goes into them.
a2c-ug-010
a2c-ug.pdf
10
the command phases that includes summary information and command reference links for all of the App2Container commands, see the App2Container command reference. Contents • Understand Docker containers • Decide where containerization will run • Prerequisites: Set up your servers • Step 1: Install App2Container • Step 2: Initialize App2Container • Step 3: Analyze your application • Step 4: Transform your application • Step 5: Deploy your application • Step 6: Clean up 28 AWS App2Container User Guide Understand Docker containers The following resources can help you get the most out of your application containers by understanding what goes into them. • To learn more about Docker containers on AWS, see What is Docker?. • Use the Docker command line reference to look up Docker commands. See Use the Docker command line. Decide where containerization will run To use App2Container on the server where the applications are running, you must set up an AWS profile, install App2Container, and install the Docker engine. If your server does not meet the requirements to containerize your application and deploy it to AWS, or if you do not want to install the Docker engine on the application server, you can set up and use a worker machine. On the worker machine, you can run the steps to containerize your application and deploy it to AWS, or you can set up connectivity between the worker machine and the application servers to run remote commands from the worker machine, targeting the application servers. The following are example situations where you might decide to set up a worker machine: • Your application servers are running in an on-premises data center and they do not have internet access. • Your application server is running on a Windows operating system that does not support containers. For more information, see Supported applications. • You prefer to use a dedicated server to run the containerization and deployment steps. • You want to consolidate your work by using a worker machine to run commands for all of your application servers. When you set up a worker machine to handle the steps to containerize and deploy your applications, it must have the same operating system platform as your application server (Linux or Windows), and the operating system must support containers. We recommend that you launch an Amazon EC2 instance as the worker machine, using an Amazon Machine Image (AMI) that is optimized for Amazon ECS. Understand Docker containers 29 AWS App2Container User Guide Prerequisites: Set up your servers Before you use App2Container for the first time, make sure that your application environment meets all of the requirements that are listed for your operating system (OS) platform in the Supported applications section of this guide. Choose the tab that matches your operating system (OS) platform to continue: Linux To run on a Linux platform, App2Container has the following additional requirements for the servers where you run App2Container commands. This includes application servers and the worker machine, if you have one configured. • There are one or more Java applications running on each application server whose inventory is the subject of the analyze or remote analyze command. • You have root access on the servers. • The servers have tar and at least 20 GB of free space. Windows To run on a Windows platform, App2Container has the following additional requirements for the servers where you run App2Container commands. This includes application servers and the worker machine, if you have one configured. • There are one or more applications running in IIS on each application server whose inventory is the subject of the analyze or remote analyze command. • You are logged in as the Administrator user on the servers. • The servers have Windows PowerShell version 5.1 or PowerShell version 6 or later and at least 20-30 GB of free space. Complete the following tasks before you use App2Container for the first time. • Sign up for AWS • Grant permissions to run AWS App2Container commands • Enable remote access for a worker machine (optional) • Configure your AWS profile Prerequisites: Set up your servers 30 AWS App2Container • Install the Docker engine Sign up for AWS User Guide When you sign up for Amazon Web Services (AWS), your AWS account is automatically signed up for all services in AWS. You are charged only for the services that you use. If you do not have an AWS account already, use the following procedure to create one. To create an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in
a2c-ug-011
a2c-ug.pdf
11
Web Services (AWS), your AWS account is automatically signed up for all services in AWS. You are charged only for the services that you use. If you do not have an AWS account already, use the following procedure to create one. To create an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. Grant permissions to run AWS App2Container commands App2Container needs access to AWS services in order to run most of its commands. There are two very different sets of permissions needed to run app2container commands. • The general purpose IAM user, group, or role can run all of the commands except commands that are run with the --deploy option. • For deployment, App2Container must be able to create or update AWS objects for container management services (Amazon ECR with Amazon ECS, Amazon EKS, or AWS App Runner), and to create CI/CD pipelines with AWS CodePipeline. This requires elevated permissions that should only be used for deployment. We recommend that you create general purpose IAM resources, and if you plan to use App2Container to deploy your containers or create pipelines, that you create separate IAM resources for deployment. Sign up for AWS 31 AWS App2Container User Guide For instructions on how to set up your IAM resources for App2Container, and policy examples that include resources and actions that App2Container needs access to, see Identity and access management in App2Container. Note You can use an instance profile to pass an IAM role to an Amazon EC2 instance. App2Container detects if there is an instance profile associated with the application server or worker machine when you run the init command. If it detects an instance profile, the init command prompts if you want to use it. To find out more about using instance profiles, see Using instance profiles in the IAM User Guide. Enable remote access for a worker machine (optional) To enable your worker machine to run remote commands for your application servers, you must ensure that the worker machine can connect. For the required setup to enable remote access, choose the operating system tab that matches your application server. Linux For Linux application servers, you can use SSH key-based or SSH certificate-based connections. You must ensure that there is network connectivity between the worker machine and the application server, and verify that your worker machine can connect. Certificate-based connections By default, App2Container trusts the certificate, and does not verify its validity before connecting to your application server. To change this behavior, set the acceptCerts attribute to false in the init.json file. Windows To connect to a Windows application server from a Windows Server 2016, 2019, or 2022 worker machine, use the WinRM protocol. Your application server must meet the requirements that are listed for Windows in the Supported applications section of this user guide. Enable remote access for a worker machine (optional) 32 AWS App2Container Note User Guide App2Container does not support applications running on Windows client operating systems, such as Windows 7 or Windows 10. 1. Worker machine To ensure that you can run PowerShell scripts on the worker machine, set the PowerShell Execution Policy to one of the following values: RemoteSigned Example: PS> Set-ExecutionPolicy RemoteSigned Unrestricted Example: PS> Set-ExecutionPolicy Unrestricted 2. Application servers Complete the following steps on each application server to enable remote access from the worker machine. 1. Ensure network connectivity to the application server over WinRM port 5986. 2. Download the WinRMSetup.ps1 PowerShell script to your application server from the following location: WinRMSetup.ps1. Note Checksum files for this script can be downloaded using the following links: • WinRMSetup.ps1.sha256 • WinRMSetup.ps1.md5 Enable remote access for a worker machine (optional) 33 AWS App2Container User Guide 3. Download the New-SelfsignedCertificateEx.ps1 PowerShell script from the Microsoft Technet gallery. The WinRMSetup.ps1 PowerShell script from step 2 uses it to generate a self-signed certificate. Note This script must run from the same directory where the WinRMSetup.ps1 PowerShell script from step 2 is located. 4. Run the WinRMSetup.ps1 PowerShell script on the application server. The script ensures that WinRM is enabled, and generates self-signed certificates that are used to secure the connection from the worker machine. Configure your AWS profile AWS App2Container requires command line access to AWS resources for containerization and deployment commands. It uses information from your AWS profile to configure access to AWS resources for your account. To run App2Container commands, you must install
a2c-ug-012
a2c-ug.pdf
12
2 uses it to generate a self-signed certificate. Note This script must run from the same directory where the WinRMSetup.ps1 PowerShell script from step 2 is located. 4. Run the WinRMSetup.ps1 PowerShell script on the application server. The script ensures that WinRM is enabled, and generates self-signed certificates that are used to secure the connection from the worker machine. Configure your AWS profile AWS App2Container requires command line access to AWS resources for containerization and deployment commands. It uses information from your AWS profile to configure access to AWS resources for your account. To run App2Container commands, you must install and configure a command line tool on the application servers and worker machines where you run the commands. Note • AWS Tools for Windows PowerShell is required for running App2Container commands in PowerShell on a Windows server. • Tools for Windows PowerShell comes pre-installed on Windows-based Amazon Machine Images (AMIs). If your application server or worker machine is an Amazon EC2 instance that was launched from one of these AMIs, you can skip to configuring your AWS profile. See Shared credentials in the AWS Tools for Windows PowerShell User Guide for more details. To install the AWS Command Line Interface (AWS CLI) or AWS Tools for Windows PowerShell command line tools, and to configure your AWS profile, follow the instructions on the tab that matches your command line tool. Configure your AWS profile 34 AWS App2Container AWS CLI User Guide To install the AWS CLI and set up your AWS profile, follow these steps: 1. Install the AWS CLI according to the instructions in the AWS Command Line Interface User Guide. For more information, see Installing the AWS CLI. 2. To configure your AWS default profile, use the aws configure command. For more information, see Configuration basics in the AWS Command Line Interface User Guide. Tools for Windows PowerShell To install Tools for Windows PowerShell and set up your AWS profile, follow these steps: 1. Install the Tools for Windows PowerShell according to the instructions in the AWS Tools for Windows PowerShell User Guide. For more information see Installing the AWS Tools for Windows PowerShell. 2. To set up your AWS default profile, use the Initialize-AWSDefaultConfiguration cmdlet. For more information about shared credentials in Tools for Windows PowerShell, see Shared credentials in the AWS Tools for Windows PowerShell User Guide. After you containerize your applications, you can also use the AWS CLI or Tools for Windows PowerShell to deploy them on AWS, though we recommend using the --deploy option with the generate app-deployment and generate pipeline commands to do your deployment. Install the Docker engine App2Container uses the Docker engine (Docker CE) to create container images and generate Dockerfiles that run the containers hosted on Amazon ECS, Amazon EKS, or AWS App Runner. You must install the Docker engine on the application server or worker machine that you'll use to containerize the application using the containerize command. Linux Use the following procedure to install Docker on Linux. Install the Docker engine 35 AWS App2Container To install the Docker engine 1. Install Docker version 17.07 or later User Guide Choose your Linux distribution from the following options, and follow instructions to download and install the Docker engine, using the links provided. Amazon Linux To download and install the Docker engine on Amazon Linux instances, see Docker basics for Amazon ECS in the Amazon Elastic Container Service Developer Guide. This works with any Amazon Linux instance. RHEL Recent versions of RHEL do not natively support the Docker engine. However, you can still download and install the Docker engine on RHEL to create containers that will be hosted and run on Amazon ECS, Amazon EKS, or AWS App Runner. To do this, follow the instructions given for CentOS on the Docker website: Install Docker engine. All other supported distributions (CentOS, Ubuntu) To download and install the Docker engine for other supported Linux distributions, follow the instructions for your Linux distribution on the Docker website: Install Docker engine. 2. Verify the Docker installation To verify that your Docker installation was successful, run the following command. $ docker run -it hello-world When the command runs, it pulls the latest hello-world application from the Docker repository, if applicable. When the application has finished downloading, it displays a "Hello" message followed by information on how this command verified your installation of Docker. Windows Use the following procedure to install Docker on Windows. Install the Docker engine 36 AWS App2Container To install the Docker engine 1. Install Docker version 17.07 or later User Guide To download and install the Docker engine on Windows, see Get started: Prep Windows for containers (Install Docker section). 2. Verify the Docker installation To verify that your Docker installation was successful, run the following command. PS> docker run -it hello-world When the command
a2c-ug-013
a2c-ug.pdf
13
if applicable. When the application has finished downloading, it displays a "Hello" message followed by information on how this command verified your installation of Docker. Windows Use the following procedure to install Docker on Windows. Install the Docker engine 36 AWS App2Container To install the Docker engine 1. Install Docker version 17.07 or later User Guide To download and install the Docker engine on Windows, see Get started: Prep Windows for containers (Install Docker section). 2. Verify the Docker installation To verify that your Docker installation was successful, run the following command. PS> docker run -it hello-world When the command runs, it pulls the latest hello-world application from the Docker repository, if applicable. When the application has finished downloading, it displays a "Hello" message followed by information on how this command verified your installation of Docker. Step 1: Install App2Container To get started with App2Container, the first step is to download and install the application. To help ensure a successful installation, you can verify the integrity and authenticity of the binary file before installing it. Tip For Amazon EC2 instances, you can perform Step 1, Step 2, Step 3, and Step 4 by using an AWS Systems Manager Automation runbook. For more information, see App2Container Automation runbook. If you prefer, you can replatform your applications running on Amazon EC2 to containers and deploy them to Amazon ECS on AWS Fargate with a console-based experience by using the Replatform applications to Amazon ECS template in the Migration Hub Orchestrator console. For more information, see the AWS Migration Hub Orchestrator User Guide. Choose the tab that matches your operating system (OS) platform to continue: Step 1: Install App2Container 37 AWS App2Container Linux User Guide App2Container for Linux is packaged as a tar.gz archive. The archive contains an interactive shell script that installs App2Container on your server. If you use an application server and a worker machine, you must install App2Container on both. To download and install App2Container for Linux 1. Download the installation file in one of the following ways: • Use the curl command to download the App2Container installation package from Amazon S3. $ curl -o AWSApp2Container-installer-linux.tar.gz https://app2container- release-us-east-1.s3.us-east-1.amazonaws.com/latest/linux/AWSApp2Container- installer-linux.tar.gz • Use your browser to download the installer from the following URL: https:// app2container-release-us-east-1.s3.us-east-1.amazonaws.com/latest/linux/ AWSApp2Container-installer-linux.tar.gz. 2. Extract the package to a local folder on the server. $ sudo tar xvf AWSApp2Container-installer-linux.tar.gz 3. Run the install script that you extracted from the package and follow the prompts. $ sudo ./install.sh To check the downloaded tar.gz installer archive for integrity, you can validate the SHA256 hash of the local file against the published hash file. Verify the integrity of the download 1. Generate hashes to verify From the directory where you downloaded your tar.gz installer, run the following command to generate the hash of the downloaded tar.gz file. $ sha256sum AWSApp2Container-installer-linux.tar.gz Step 1: Install App2Container 38 AWS App2Container User Guide 9482952019adb6df96c7be773aa20ecb8de559083b99c270c67c34da56dd8dee AWSApp2Container-installer-linux.tar.gz 2. Verify hashes against the public file Download the App2Container hash file from Amazon S3 with the following link, and compare the contents to the hash that you generated in step 1: • Download the App2Container hash file from Amazon S3:AWSApp2Container-installer- linux.tar.gz.sha256. To verify the authenticity of the download, run the following commands to download the certificate and signature files, and verify the signature. Verify the authenticity of the download 1. Download the App2Container certificate: curl -o app2container.cert https://app2container-keys.s3.us- east-1.amazonaws.com/latest/app2container.cert 2. Download the App2Container signature file: curl -o app2container.sig https://app2container-release-us-east-1.s3.us- east-1.amazonaws.com/latest/linux/app2container.sig 3. Verify the signature: openssl dgst -sha256 -verify app2container.cert -signature app2container.sig / usr/bin/app2container Windows App2Container for Windows is packaged as a zip archive. The package contains a PowerShell script that installs App2Container. If you use an application server and a worker machine, you must install App2Container on both. Step 1: Install App2Container 39 AWS App2Container User Guide To download and install App2Container for Windows 1. Download the App2Container installation package, AWSApp2Container-installer- windows.zip. 2. Extract the package to a local folder on the server and navigate to that folder. Note App2Container automatically enables NTFS long paths for all supported Windows versions so that you can use file paths longer than 260 characters. For more information about this setting, see How to enable NTFS Long Paths in Windows 10 / Windows Server 2016 / 2019 or newer (PDF). 3. Run the install script from the folder where you extracted it, and follow the prompts. PS> .\install.ps1 4. (Optional) To verify the authenticity of the download, use the Get- AuthenticodeSignature PowerShell command as follows to get the Authenticode Signature of the App2Container executable. PS> Get-AuthenticodeSignature C:\Users\Administrator\app2container \AWSApp2Container\bin\app2container.exe To check the downloaded zip archive for integrity, you can validate the SHA256 hash of the local file against the published hash file. To verify the integrity of the download 1. Generate hashes to verify From the directory where you downloaded your zip archive, run the
a2c-ug-014
a2c-ug.pdf
14
2016 / 2019 or newer (PDF). 3. Run the install script from the folder where you extracted it, and follow the prompts. PS> .\install.ps1 4. (Optional) To verify the authenticity of the download, use the Get- AuthenticodeSignature PowerShell command as follows to get the Authenticode Signature of the App2Container executable. PS> Get-AuthenticodeSignature C:\Users\Administrator\app2container \AWSApp2Container\bin\app2container.exe To check the downloaded zip archive for integrity, you can validate the SHA256 hash of the local file against the published hash file. To verify the integrity of the download 1. Generate hashes to verify From the directory where you downloaded your zip archive, run the following command to generate the hash of the downloaded archive file. PS> Get-FileHash C:\Users\Administrator\Downloads\AWSApp2Container-installer- windows.zip -Algorithm SHA256 Step 1: Install App2Container 40 AWS App2Container User Guide 2. Verify hashes against the public file Download the App2Container hash file from Amazon S3 with the following link, and compare the contents to the hash that you generated in step 1: • Download the App2Container hash file from Amazon S3:AWSApp2Container-installer- windows.zip.sha256. Step 2: Initialize App2Container The containerization process consists of several distinct phases. This step focuses on the initialization phase, during which you initialize App2Container's global settings, and configure remote command settings if you are using a worker machine. The init command performs one-time initialization tasks for App2Container. This interactive command prompts for the information required to set up the local App2Container environment. Run this command before you run any other App2Container commands. For more information, see the init command reference page. If you are using a worker machine to run commands remotely on application servers, you must also run the remote configure command on the worker machine. For more information, see the remote configure command reference page. Choose the tab that matches your operating system (OS) platform to continue: Linux On each server where you installed App2Container, run the init command as follows. $ sudo app2container init You are prompted to provide the following information. Choose <enter> to accept the default value. • Workspace directory path – A local directory where App2Container can store artifacts during the containerization process. The default is /root/app2container. • AWS profile – Contains information needed to run App2Container, such as your AWS access keys. For more information about AWS profiles, see Configure your AWS profile. Step 2: Initialize App2Container 41 AWS App2Container Note User Guide If App2Container detects an instance profile for your server, the init command prompts if you want to use it. If you don't specify any value, App2Container uses your AWS default profile. • Amazon S3 bucket – You can optionally provide the name of an Amazon S3 bucket where you can extract artifacts using the extract command. The containerize command uses the extracted components to create the application container if the Amazon S3 bucket is configured. The default is no bucket. • You can optionally upload logs and command-generated artifacts automatically to App2Container support when an app2container command crashes or encounters internal errors. • Permission to collect usage metrics – You can optionally allow App2Container to collect information about the host operating system, application type, and the app2container commands that you run. The default is to allow the collection of metrics. • Whether to enforce signed images – You can optionally require that images are signed using Docker Content Trust (DCT). The default is no. Windows On each server where you installed App2Container, run the init command as follows. PS> app2container init You are prompted to provide the following information. Choose <enter> to accept the default value. • Workspace directory path – A local directory where App2Container can store artifacts during the containerization process. The default is C:\Users\Administrator\AppData\Local \app2container. • AWS profile – Contains information needed to run App2Container, such as your AWS access keys. For more information about AWS profiles, see Configure your AWS profile. Step 2: Initialize App2Container 42 AWS App2Container Note User Guide If App2Container detects an instance profile for your server, the init command prompts if you want to use it. If you don't specify any value, App2Container uses your AWS default profile. • Amazon S3 bucket – You can optionally provide the name of an Amazon S3 bucket where you can extract artifacts using the extract command. The containerize command uses the extracted components to create the application container if the Amazon S3 bucket is configured. The default is no bucket. • You can optionally upload logs and command-generated artifacts automatically to App2Container support when an app2container command crashes or encounters internal errors. • Permission to collect usage metrics – You can optionally allow App2Container to collect information about the host operating system, application type, and the app2container commands that you run. The default is to allow the collection of metrics. • Whether to enforce signed images – You can optionally require that images are signed using Docker
a2c-ug-015
a2c-ug.pdf
15
containerize command uses the extracted components to create the application container if the Amazon S3 bucket is configured. The default is no bucket. • You can optionally upload logs and command-generated artifacts automatically to App2Container support when an app2container command crashes or encounters internal errors. • Permission to collect usage metrics – You can optionally allow App2Container to collect information about the host operating system, application type, and the app2container commands that you run. The default is to allow the collection of metrics. • Whether to enforce signed images – You can optionally require that images are signed using Docker Content Trust (DCT). The default is no. Step 3: Analyze your application After you have completed setup and initialization tasks on your servers, you can begin to analyze your applications. During the analysis phase, you take inventory of the applications running on your application servers, and analyze specific applications within your inventory. Choose the tab that matches your operating system (OS) platform to continue: Linux On the application server, follow these steps to prepare to containerize the applications. Prepare for containerization 1. Run the inventory command as follows to list the Java applications that are running on your server. $ sudo app2container inventory Step 3: Analyze your application 43 AWS App2Container User Guide The output includes a JSON object collection with one entry for each application. Each application object will include key/value pairs as shown in the following example. "java-app-id": { "processId": pid, "cmdline": "/user/bin/java ...", "applicationType": "java-apptype" } 2. Locate the application ID for the application to containerize in the JSON output of the inventory command, and then run the analyze command as follows, replacing java-app- id with the application ID that you located. $ sudo app2container analyze --application-id java-app-id The output is a JSON file, analysis.json, stored in the workspace directory that you specified when you ran the init command. 3. (Optional) You can edit the information in the containerParameters section of analysis.json as needed before continuing to the next step. Windows On the application server, follow these steps to prepare to containerize your applications. Prepare for containerization 1. Run the inventory command as follows to list the ASP.NET applications that are running on your server. PS> app2container inventory The output includes a JSON object collection with one entry for each application. Each application object will include key/value pairs as shown in the following example. "iis-app-id": { "siteName": My site name, "bindings": "http/*:80:", "applicationType": "iis", Step 3: Analyze your application 44 AWS App2Container User Guide "discoveredWebApps": [ "app1", "app2" ] } 2. Locate the application ID for the application to containerize in the JSON output of the inventory command, and then run the analyze command as follows, replacing iis-app- id with the application ID that you located. PS> app2container analyze --application-id iis-app-id The output is a JSON file, analysis.json, stored in the workspace directory that you specified when you ran the init command. 3. (Optional) You can edit the information in the containerParameters section of analysis.json as needed before continuing to the next step. Step 4: Transform your application Now that your application has gone through the analysis phase, it's ready for containerization. The transform phase creates the containers that your application runs in after you deploy it to Amazon ECS, Amazon EKS, or App Runner, if eligible. For more information about how App2Container integrates with container management services and other products, see Product and service integrations for AWS App2Container. Choose the tab that matches your operating system (OS) platform to continue: Linux The transform phase depends on whether you are running all steps on the application server, or are using the application server for the analysis and a worker machine for containerization and deployment. To containerize the application on the application server If you are using an application server for all steps, run the containerize command as follows. $ sudo app2container containerize --application-id java-app-id Step 4: Transform your application 45 AWS App2Container User Guide The output is a set of deployment files that are stored in the workspace directory that you specified when you ran the init command. To containerize the application on a worker machine If you are using a worker machine for containerization and deployment, use the following procedure to transform the application. 1. On the application server, run the extract command as follows. $ sudo app2container extract --application-id java-app-id 2. If you specified an Amazon S3 bucket when you ran the init command, the archive is extracted to that location. Otherwise, you can manually copy the resulting archive file to the worker machine. 3. On the worker machine, run the containerize command as follows. $ sudo app2container containerize --input-archive /path/extraction-file.tar The output is a set of deployment artifacts that are stored in the workspace directory that you specified when you ran the init command.
a2c-ug-016
a2c-ug.pdf
16
use the following procedure to transform the application. 1. On the application server, run the extract command as follows. $ sudo app2container extract --application-id java-app-id 2. If you specified an Amazon S3 bucket when you ran the init command, the archive is extracted to that location. Otherwise, you can manually copy the resulting archive file to the worker machine. 3. On the worker machine, run the containerize command as follows. $ sudo app2container containerize --input-archive /path/extraction-file.tar The output is a set of deployment artifacts that are stored in the workspace directory that you specified when you ran the init command. Windows The transform phase depends on whether you are running all steps on the application server or using the application server for the analysis and a worker machine for containerization and deployment. To containerize the application on the application server If you are using an application server for all steps, run the containerize command as follows. PS> app2container containerize --application-id iis-app-id The output is a set of deployment files stored in the workspace directory that you specified when you ran the init command. Step 4: Transform your application 46 AWS App2Container User Guide To containerize the application on a worker machine If you are using a worker machine for containerization and deployment, use the following procedure to transform the application. 1. On the application server, run the extract command as follows. PS> app2container extract --application-id iis-app-id 2. If you specified an Amazon S3 bucket when you ran the init command, the archive is extracted to that location. Otherwise, you can manually copy the resulting archive file to the worker machine. 3. On the worker machine, run the containerize command as follows. PS> app2container containerize --input-archive drive:\path\extraction-file.zip The output is a set of deployment artifacts that are stored in the workspace directory that you specified when you ran the init command. Step 5: Deploy your application After your application has gone through containerization, it's ready to deploy to Amazon ECS, Amazon EKS, or App Runner, if eligible. When you run the generate app-deployment command, App2Container creates an Amazon ECR repository where it stores your application container artifacts for deployment. It also creates deployment configuration files that you can deploy as follows: • You can customize the deployment files, and have complete control over the deployment by running the AWS commands for your destination container management environment. When you run the generate app-deployment command without the --deploy option, App2Container returns instructions that you can use to deploy manually. • If you're sure that you won't need to customize your deployment files, App2Container can optionally deploy your application containers directly to the container management environment that you have configured. To choose this option, run the generate app-deployment command with the --deploy option. You can verify the settings that App2Container used for the deployment by reviewing the deployment configuration files. Step 5: Deploy your application 47 AWS App2Container User Guide The deployment phase includes the option to create a deployment pipeline using the generate pipeline command. That step is not covered here, in order to prevent any unexpected charges for AWS resources. For more information, see app2container generate pipeline command in the command reference section. Choose the tab that matches your operating system (OS) platform to continue: Linux Run the generate app-deployment command as follows to deploy the application on AWS. $ sudo app2container generate app-deployment --application-id java-app-id You have now created deployment artifacts for your application! You can find the deployment artifacts that the generate app-deployment command created for you in the local directory for your application. Windows Run the generate app-deployment command as follows to deploy the application on AWS. PS> app2container generate app-deployment --application-id iis-smarts-51d2dbf8 You have now created deployment artifacts for your application! You can find the deployment artifacts that the generate app-deployment command created for you in the local directory for your application. Applications using Windows authentication For applications using Windows authentication, you can use the gMSAParameters inside of the deployment.json file to set the gMSA-related artifacts automatically during generation of your AWS CloudFormation template. Perform the actions in the list below once per Active Directory domain before you update the gMSA parameters. • Set up a secret in SecretsManager that stores the Domain credentials with the following key value pairs: Step 5: Deploy your application 48 AWS App2Container User Guide Key Username Password Value <DomainNetBIOSName>\<Domain User> <DomainUserPassword> • For the VPC with the Domain Controller, verify that the DHCP options are set to reach the Domain Controller. The options for DomainName and DomainNameServers must be set correctly. See DHCP options sets for more information about how to set DHCP options. Step 6: Clean up If you explored deployment options outside of the steps that we covered for this tutorial, make sure that you tear down any application stacks
a2c-ug-017
a2c-ug.pdf
17
SecretsManager that stores the Domain credentials with the following key value pairs: Step 5: Deploy your application 48 AWS App2Container User Guide Key Username Password Value <DomainNetBIOSName>\<Domain User> <DomainUserPassword> • For the VPC with the Domain Controller, verify that the DHCP options are set to reach the Domain Controller. The options for DomainName and DomainNameServers must be set correctly. See DHCP options sets for more information about how to set DHCP options. Step 6: Clean up If you explored deployment options outside of the steps that we covered for this tutorial, make sure that you tear down any application stacks that might have been created, and verify that you have removed any artifacts that were created in the process. Choose the tab that matches your operating system (OS) platform to continue: Linux To remove App2Container from your application server or worker machine, delete the /usr/ local/app2container folder where it is installed, and then remove this folder from your path. To clean up your AWS profile, use the aws configure set command. For more information, see Set and view configuration settings in the AWS Command Line Interface User Guide. Windows To remove App2Container from your application server or worker machine, delete the C: \Users\Administrator\app2container folder where it is installed, and then remove this folder from your path. To clean up your AWS profile, see Removing Credential Profiles in the AWS Tools for Windows PowerShell User Guide. Step 6: Clean up 49 AWS App2Container User Guide App2Container Automation runbook AWS App2Container provides the AWSApp2Container-ReplatformApplications Automation runbook for use on Amazon EC2 instances. Automation is a capability of AWS Systems Manager. The runbook performs the installation of App2Container as well as the initialize, analyze, and transform phases for replatforming supported applications. If desired, the automation can also push the containerized application to Amazon Elastic Container Registry (Amazon ECR). For more information, see App2Container compatibility and Applications you can containerize using AWS App2Container. You must have access to Systems Manager to use the runbook. For more information about Systems Manager Automation, see AWS Systems Manager Automation in the AWS Systems Manager User Guide. Tip To containerize your applications with a console-based experience and deploy them on Amazon ECS on AWS Fargate, you can use the Replatform applications to Amazon ECS template on the AWS Migration Hub Orchestrator console. For more information, see Replatform applications to Amazon ECS in the AWS Migration Hub Orchestrator User Guide. Contents • Prerequisites • Create policies and roles for the automation • Attaching the IAM role • Run the automation • Runbook parameters • Running the automation • Reviewing output from the automation • Complete the modernization process Prerequisites Before you run the automation, you must have: Prerequisites 50 AWS App2Container User Guide • An S3 bucket to store your containerized application artifacts. This bucket must be in the same AWS account and Region as your Amazon EC2 instances being containerized. For more information, see Creating a bucket in the Amazon Simple Storage Service User Guide. • An IAM service role with the permissions necessary for Automation, a capability of AWS Systems Manager, to run the automation on your behalf. • An IAM role for your EC2 instances that permits the necessary actions to run the automation in your target instances. • (Optional) A customer managed key in AWS KMS to use as your own server-side encryption key for Amazon S3. For more information, see Customer managed keys in the Amazon Simple Storage Service User Guide. • If you are using AWS Application Migration Service and running this automation as a post-launch action, you must configure the EC2 launch template setting Auto-assign public IP to Enabled. For more information, see Full launch template setting review in the AWS Application Migration Service User Guide. Topics • Create policies and roles for the automation • Attaching the IAM role Create policies and roles for the automation You must create the required policies and roles before running the automation. You can create the roles using AWS CloudFormation or manually. Creating policies and roles with AWS CloudFormation You can use the following AWS CloudFormation template to create a stack which will create the roles and policies required to run the automation. You can create a stack using the AWS CloudFormation console or the AWS Command Line Interface (AWS CLI). AWSTemplateFormatVersion: "2010-09-09" Parameters: A2CServiceRoleName: Type: String Description: Name of the A2C Service Role Default: "a2cServiceRole" Create policies and roles for the automation 51 User Guide AWS App2Container A2CInstanceRoleName: Type: String Description: Name of the A2C Instance Role Default: "a2cinstancerole" Resources: A2CServiceRole: Type: "AWS::IAM::Role" Properties: RoleName: !Ref A2CServiceRoleName AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: "Allow" Principal: Service: ["ssm.amazonaws.com"] Action: "sts:AssumeRole" Policies: - PolicyName: "a2cServicePolicy" PolicyDocument: Version: "2012-10-17" Statement: - Sid: "EC2DescribeAccess" Effect: "Allow" Action: - "ec2:DescribeInstances" Resource: "*" - Sid: "IAMRoleAccess" Effect: "Allow" Action: -
a2c-ug-018
a2c-ug.pdf
18
create a stack using the AWS CloudFormation console or the AWS Command Line Interface (AWS CLI). AWSTemplateFormatVersion: "2010-09-09" Parameters: A2CServiceRoleName: Type: String Description: Name of the A2C Service Role Default: "a2cServiceRole" Create policies and roles for the automation 51 User Guide AWS App2Container A2CInstanceRoleName: Type: String Description: Name of the A2C Instance Role Default: "a2cinstancerole" Resources: A2CServiceRole: Type: "AWS::IAM::Role" Properties: RoleName: !Ref A2CServiceRoleName AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: "Allow" Principal: Service: ["ssm.amazonaws.com"] Action: "sts:AssumeRole" Policies: - PolicyName: "a2cServicePolicy" PolicyDocument: Version: "2012-10-17" Statement: - Sid: "EC2DescribeAccess" Effect: "Allow" Action: - "ec2:DescribeInstances" Resource: "*" - Sid: "IAMRoleAccess" Effect: "Allow" Action: - "iam:AttachRolePolicy" - "iam:GetInstanceProfile" Resource: "*" - Sid: "ApplicationTransformationAccess" Effect: "Allow" Action: - "application-transformation:StartRuntimeAssessment" - "application-transformation:GetRuntimeAssessment" - "application-transformation:PutMetricData" - "application-transformation:PutLogData" Resource: "*" - Sid: "SSMSendCommandAccess" Effect: "Allow" Action: Create policies and roles for the automation 52 AWS App2Container User Guide - "ssm:SendCommand" Resource: - "arn:aws:ec2:*:*:instance/*" - "arn:aws:ssm:*::document/AWS-RunRemoteScript" - Sid: "SSMDescribeAccess" Effect: "Allow" Action: - "ssm:DescribeInstanceInformation" - "ssm:ListCommandInvocations" - "ssm:GetCommandInvocation" - "ssm:GetParameters" Resource: "arn:aws:ssm:*:*:*" - Sid: "S3ObjectAccess" Effect: "Allow" Action: - "s3:GetObject" - "s3:PutObject" Resource: - "arn:aws:s3:::*/application-transformation*" - Sid: "S3ListAccess" Effect: "Allow" Action: - "s3:ListBucket" - "s3:GetBucketLocation" Resource: "arn:aws:s3:::*" - Sid: "KmsAccess" Effect: "Allow" Action: - "kms:GenerateDataKey" - "kms:Decrypt" Resource: - "arn:aws:kms:*:*:key/*" Condition: StringLike: kms:ViaService: - "s3.*.amazonaws.com" A2CInstanceRole: Type: "AWS::IAM::Role" Properties: RoleName: !Ref A2CInstanceRoleName AssumeRolePolicyDocument: Version: "2012-10-17" Statement: Create policies and roles for the automation 53 AWS App2Container User Guide - Effect: "Allow" Principal: Service: ["ec2.amazonaws.com"] Action: "sts:AssumeRole" ManagedPolicyArns: - "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" Policies: - PolicyName: "ApplicationTransformationAnalyzerPolicy" PolicyDocument: Version: "2012-10-17" Statement: - Sid: "S3BucketAccess" Effect: "Allow" Action: - "s3:GetBucketLocation" Resource: - "arn:aws:s3:::*" - Sid: "S3ObjectAccess" Effect: "Allow" Action: - "s3:PutObject" - "s3:GetObject" Resource: - "arn:aws:s3:::*/application-transformation*" - Sid: "KmsAccess" Effect: "Allow" Action: - "kms:GenerateDataKey" - "kms:Decrypt" Resource: - "arn:aws:kms:*:*:key/*" Condition: StringLike: kms:ViaService: - "s3.*.amazonaws.com" - Sid: "TelemetryAccess" Effect: "Allow" Action: - "application-transformation:PutMetricData" - "application-transformation:PutLogData" Resource: - "*" a2cInstanceProfile: Type: AWS::IAM::InstanceProfile Create policies and roles for the automation 54 AWS App2Container Properties: InstanceProfileName: !Ref A2CInstanceRoleName Roles: - !Ref A2CInstanceRole Creating policies and roles manually User Guide The following sections detail how you can manually create the roles and policies required to run the automation. Creating policies to run the automation To enhance the security posture of the App2Container automation execution, it is strongly recommended to scope down IAM S3 access permissions to allow access only to the bucket created for the App2Container automation execution. You can create least-privilege policies required to run the automation with the following procedures. To create the service role policy for running the automation 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Policies then choose Create policy. 3. Choose JSON, enter the following policy in the Policy editor, then choose Next: { "Version": "2012-10-17", "Statement": [ { "Sid": "EC2DescribeAccess", "Effect": "Allow", "Action": [ "ec2:DescribeInstances" ], "Resource": "*" }, { "Sid": "IAMRoleAccess", "Effect": "Allow", "Action": [ "iam:AttachRolePolicy", "iam:GetInstanceProfile" ], "Resource": ["*"] Create policies and roles for the automation 55 AWS App2Container }, User Guide { "Sid": "ApplicationTransformationAccess", "Effect": "Allow", "Action": [ "application-transformation:StartRuntimeAssessment", "application-transformation:GetRuntimeAssessment", "application-transformation:PutMetricData", "application-transformation:PutLogData" ], "Resource": "*" }, { "Sid": "SSMSendCommandAccess", "Effect": "Allow", "Action": [ "ssm:SendCommand" ], "Resource": [ "arn:aws:ec2:*:*:instance/*", "arn:aws:ssm:*::document/AWS-RunRemoteScript" ] }, { "Sid": "SSMDescribeAccess", "Effect": "Allow", "Action": [ "ssm:DescribeInstanceInformation", "ssm:ListCommandInvocations", "ssm:GetCommandInvocation", "ssm:GetParameters" ], "Resource": "arn:aws:ssm:*:*:*" }, { "Sid": "S3ObjectAccess", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::*/application-transformation*" ] Create policies and roles for the automation 56 AWS App2Container }, User Guide { "Sid": "S3ListAccess", "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Resource": "arn:aws:s3:::*" }, { "Sid": "KmsAccess", "Effect": "Allow", "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": [ "arn:aws:kms:*:*:key/*" ], "Condition": { "StringLike": { "kms:ViaService": [ "s3.*.amazonaws.com" ] } } } ] } 4. Enter a value for the Policy name. 5. Choose Create policy. To create the policy for the IAM role used by your instance profile 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Policies then choose Create policy. 3. Choose JSON, enter the following policy in the Policy editor, then choose Next: { "Version": "2012-10-17", Create policies and roles for the automation 57 AWS App2Container User Guide "Statement": [ { "Sid": "S3BucketAccess", "Effect": "Allow", "Action": [ "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3:::*" ] }, { "Sid": "S3ObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject" ], "Resource": [ "arn:aws:s3:::*/application-transformation*" ] }, { "Sid": "KmsAccess", "Effect": "Allow", "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": [ "arn:aws:kms:*:*:key/*" ], "Condition": { "StringLike": { "kms:ViaService": [ "s3.*.amazonaws.com" ] } } }, { "Sid": "TelemetryAccess", "Effect": "Allow", "Action": [ Create policies and roles for the automation 58 AWS App2Container User Guide "application-transformation:PutMetricData", "application-transformation:PutLogData" ], "Resource": [ "*" ] } ] } 4. Enter ApplicationTransformationAnalyzerPolicy for the Policy name. 5. Choose Create policy. Creating the IAM service role for running the automation You can use the following procedure to create an IAM service role. To create an IAM role using the IAM console 1. Open the IAM
a2c-ug-019
a2c-ug.pdf
19
}, { "Sid": "KmsAccess", "Effect": "Allow", "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": [ "arn:aws:kms:*:*:key/*" ], "Condition": { "StringLike": { "kms:ViaService": [ "s3.*.amazonaws.com" ] } } }, { "Sid": "TelemetryAccess", "Effect": "Allow", "Action": [ Create policies and roles for the automation 58 AWS App2Container User Guide "application-transformation:PutMetricData", "application-transformation:PutLogData" ], "Resource": [ "*" ] } ] } 4. Enter ApplicationTransformationAnalyzerPolicy for the Policy name. 5. Choose Create policy. Creating the IAM service role for running the automation You can use the following procedure to create an IAM service role. To create an IAM role using the IAM console 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Roles then choose Create role. 3. On the Select trusted entity page, choose AWS service, select the Systems Manager use case, and then choose Next. 4. On the Add permissions page, select the policy that you created for the IAM service role previously, and then choose Next. 5. On the Name, review, and create page, enter a name and description for the role and add tags if needed. 6. Choose Create role. This role is used for the AutomationAssumeRole parameter in the Run the automation section. Creating the instance profile role You can use the following procedure to create an IAM role for your instance profile. The permissions provided by the instance profile role are used by your EC2 instances. For more information, see Using an IAM role to grant permissions to applications running on Amazon EC2 instances in the AWS Identity and Access Management User Guide. Create policies and roles for the automation 59 AWS App2Container Note User Guide An instance profile can only contain one IAM role. If your target instances have an existing IAM role, the automation will add the ApplicationTransformationAnalyzerPolicy policy on execution to the instance profile role on your behalf. The existing role should provide the permissions required to make the instances managed nodes in AWS Systems Manager. For more information, see Instance profiles in the Amazon Elastic Compute Cloud User Guide and Managed nodes in the AWS Systems Manager User Guide. To create an instance profile role using the IAM console 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Roles then choose Create role. 3. On the Select trusted entity page, choose AWS service, select the EC2 use case, and then choose Next. 4. On the Add permissions page, select both the AmazonSSMManagedInstanceCore policy and the policy you created for the instance profile role previously, and then choose Next. 5. On the Name, review, and create page, enter a name and description for the role and add tags if needed. 6. Choose Create role. The instance profile role is used in the following section. Attaching the IAM role If your target instances don't have an existing IAM role, you can attach the previously created IAM role to them. The following steps assume you have already created the required policies and roles. To attach an IAM role to an instance 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. 3. 4. In the navigation pane, choose Instances. Select the instance, choose Actions, Security, Modify IAM role. Select the IAM role to attach to your instance, and choose Save. Attaching the IAM role 60 AWS App2Container User Guide For more information, see Attach an IAM role to an instance. Run the automation When you run the automation, the following processes occur: • Discover – The instances you specified are scanned for supported applications to create an inventory of each server. • Analyze – Once the discover phase has completed, the automation analyzes each application and creates an entry. The instances you specified are scanned for supported applications to create an inventory of each server. Once this discovery process has completed, the automation analyzes each application and creates an entry. Note Applications using Windows Server operating systems will use Windows Server Core as their base image. Applications using Linux operating systems will use a Linux based image. Topics • Runbook parameters • Running the automation • Reviewing output from the automation Runbook parameters You can specify the following parameters for the Automation runbook. Parameter name Automatio nAssumeRo le Run the automation Type Description Default value Required String The ARN of the role that allows Automation to TRUE 61 AWS App2Container Parameter name Type Description Default value Required User Guide Boolean EnableCon taineriza tion FALSE FALSE perform actions on your behalf. Controls whether to containerize discovered applications. If enabled, the automation will use the artifacts uploaded to the S3 bucket to generate Open Container s Initiative (OCI) container images and push them to Amazon ECR. Runbook parameters 62 Type Description Default value Required User Guide AWS App2Container Parameter name OutputLoc ation String OutputEnc ryptionKey String TRUE FALSE The S3 location in which to upload
a2c-ug-020
a2c-ug.pdf
20
Default value Required String The ARN of the role that allows Automation to TRUE 61 AWS App2Container Parameter name Type Description Default value Required User Guide Boolean EnableCon taineriza tion FALSE FALSE perform actions on your behalf. Controls whether to containerize discovered applications. If enabled, the automation will use the artifacts uploaded to the S3 bucket to generate Open Container s Initiative (OCI) container images and push them to Amazon ECR. Runbook parameters 62 Type Description Default value Required User Guide AWS App2Container Parameter name OutputLoc ation String OutputEnc ryptionKey String TRUE FALSE The S3 location in which to upload deployment artifacts. The bucket must be in the same account and Region of the EC2 instance. All artifacts will be create d with a prefix of applicati on-transf ormation . The ARN of a customer managed KMS key to use for server-si de encryptio n. For more information, see Protecting data with server-si de encryption in the Amazon Simple Storage Service User Guide. Runbook parameters 63 AWS App2Container Parameter name Type Description Default value Required User Guide InstanceId String TRUE An EC2 instance ID with applicati ons to be assessed for replatforming. Only running applications are assessed. Running the automation You can run the automation from the Systems Manager console. To run the automation 1. Access the AWS Systems Manager Automation console at https://console.aws.amazon.com/ systems-manager/automation. 2. Choose Execute automation. 3. Under Automation runbook, enter AWSApp2Container-ReplatformApplications, and search the repository. 4. Choose the AWSApp2Container-ReplatformApplications runbook, then choose Next. 5. Enter the required parameters, and any optional ones you require: a. b. c. d. For AutomationAssumeRole, enter the ARN of the service role you created previously. For EnableContainerization, specify TRUE if you want your containerized applications pushed to Amazon ECR. For OutputLocation, specify the S3 path to upload artifacts to. For OutputEncryptionKey, you can specify the ARN of a KMS key if you want to encrypt the uploaded objects with your customer managed key. e. For InstanceId, specify the instance ID for the automation to take action on. 6. Choose Execute. Running the automation 64 AWS App2Container User Guide Reviewing output from the automation Once the automation has completed, you can access the output in the S3 location that you provided. To review output from the automation 1. Access the AWS Systems Manager Automation console at https://console.aws.amazon.com/ systems-manager/automation. 2. Choose the Execution ID to review. 3. 4. Select Outputs and review the Finalize.report output. For more details, review the text file indicated in the Finalize.reportS3Location output. Complete the modernization process You can complete the modernization process using AWS Migration Hub Orchestrator to create a workflow based on the Replatform applications to Amazon ECS template to deploy your applications on Amazon ECS on AWS Fargate. This template can use the application artifacts App2Container uploaded to Amazon S3. For more information, see Replatform applications to Amazon ECS in the AWS Migration Hub Orchestrator User Guide. To continue the containerization process without Migration Hub Orchestrator, you can use the App2Container CLI extraction and containerization process. For more information, see Step 4: Transform your application. After performing the containerization process with App2Container, continue with the deployment phase to complete the modernization process. You can use either App2Container or proprietary deployment tools. If you use the App2Container CLI, you can generate the required AWS CloudFormation templates. For more information about deploying your containerized application using App2Container, see Step 5: Deploy your application. Reviewing output from the automation 65 AWS App2Container User Guide Configuring your application Containerizing your application and creating pipelines with App2Container requires configuration throughout the process. This section of the guide describes the configuration files that are created by app2container commands, the fields that they contain, and which fields are configurable. App2Container commands primarily generate JSON configuration files, using standard JSON notation. Field details for the files included here indicate where there are specific requirements for the values. App2Container also generates YAML format CloudFormation templates when you run the generate app-deployment command. However, those are not covered in this section, as their content is dictated by the target container management environment, such as Amazon ECS, Amazon EKS, or AWS App Runner. For more information about how App2Container works with these services, see Product and service integrations for AWS App2Container. Creating IAM resources is also covered separately, under the Security section. For more information and instructions about how to set up IAM resources for App2Container, see Identity and access management in App2Container. You can consolidate your containerization workload by configuring connections to your application servers to run containerization workflows remotely, using App2Container remote commands from your worker machine. Prior to running remote commands, you must configure the connections that the worker machine uses for its target application servers. For more information on configuring connections, see the remote configure command reference page. Contents • Manage secrets for
a2c-ug-021
a2c-ug.pdf
21
integrations for AWS App2Container. Creating IAM resources is also covered separately, under the Security section. For more information and instructions about how to set up IAM resources for App2Container, see Identity and access management in App2Container. You can consolidate your containerization workload by configuring connections to your application servers to run containerization workflows remotely, using App2Container remote commands from your worker machine. Prior to running remote commands, you must configure the connections that the worker machine uses for its target application servers. For more information on configuring connections, see the remote configure command reference page. Contents • Manage secrets for AWS App2Container • Configuring application containers • Configuring container deployment • Configuring container pipelines Manage secrets for AWS App2Container App2Container uses AWS Secrets Manager to manage the credentials necessary to connect your worker machine to application servers and run remote commands. Secrets Manager encrypts your secrets for storage and provides an Amazon Resource Name (ARN) so that you can access Manage secrets 66 AWS App2Container User Guide the secret. When you run the remote configure command, you provide the secret ARN that App2Container uses to connect to your target server when you run the remote command. For more information about Secrets Manager, see What Is AWS Secrets Manager? For information specifically related to costs, see Pricing for AWS Secrets Manager in the AWS Secrets Manager User Guide. Create remote access secrets The secret that App2Container uses to connect to an application server varies with the application server's operating system (OS) platform. To create a remote access secret for your application server, choose the tab that matches your OS platform. Linux For Linux, you can store either the SSH private key or the Certificate and SSH private key in Secrets Manager. To create a secret in Secrets Manager so that you can access your application server remotely, follow the steps shown in the Create a secret page in the AWS Secrets Manager User Guide. Provide the information that App2Container needs to run remote commands as follows. Step 1 Choose secret type • Secret type – To store a key that App2Container uses programmatically, through API calls, choose the Other type of secrets option. • Specify the following Key/value pairs to store in the secret. To add the next key/value pair, choose + Add row. Username key • Key name (box 1): username • Key value (box 2): Enter the plaintext username value to use with SSH. SSH private key • Key name (box 1): key • Key value (box 2): Copy the base64-encoded string that represents your private key file into the second box. Create remote access secrets 67 AWS App2Container User Guide Note To base64-encode your key file, you can use the following command, where .ssh/ id_rsa is the private key that encodes the file: $ base64 .ssh/id_rsa SSH Certificate key (optional) • Key name (box 1): cert • Key value (box 2): Copy the base64-encoded string that represents your signed certificate file into the second box. Note To base64-encode your signed certificate file, you can use the following command, where .ssh/id_rsa-cert.pub is the private key that encodes the file: $ base64 .ssh/id_rsa-cert.pub Step 2 Configure secret • Enter a name for your secret in the Secret name box. You can also enter optional information to help identify your secret, such as Description, or you can enter tags in the Tags panel. Windows For Windows application servers, you can store the Username and Password for remote access. In most cases, the username and password translates to a set of credentials for a domain user with access to the application servers. Create a secret page in the AWS Secrets Manager User Guide Step 1 Choose secret type • Secret type – To store a key that App2Container uses programmatically, through API calls, choose the Other type of secrets option. Create remote access secrets 68 AWS App2Container User Guide • Specify the following Key/value pairs to store in the secret. To add the next key/value pair, choose + Add row. Username key • Key name (box 1): username • Key value (box 2): In the second box, enter the plaintext username value to use with the connection credentials for your application server. Password key • Key name (box 1): password • Key value (box 2): In the second box, enter the password value. Step 2 Configure secret • Enter a name for your secret in the Secret name box. You can also enter optional information to help identify your secret, such as Description, or you can enter tags in the Tags panel. Create secrets for Jenkins pipelines Integration with Jenkins requires secure authentication, both for the Git repository that Jenkins uses for automated container build pipelines, and for authentication to the Jenkins server itself. For secure authentication, App2Container uses Secrets Manager to
a2c-ug-022
a2c-ug.pdf
22
Password key • Key name (box 1): password • Key value (box 2): In the second box, enter the password value. Step 2 Configure secret • Enter a name for your secret in the Secret name box. You can also enter optional information to help identify your secret, such as Description, or you can enter tags in the Tags panel. Create secrets for Jenkins pipelines Integration with Jenkins requires secure authentication, both for the Git repository that Jenkins uses for automated container build pipelines, and for authentication to the Jenkins server itself. For secure authentication, App2Container uses Secrets Manager to store credentials, and provide access to the authentication secrets to Jenkins agent nodes. Jenkins secrets • Authentication secret for Git • Authentication secret for Jenkins server Authentication secret for Git App2Container uses SSH to authenticate to the Git source repository that the Jenkins agent uses to update your pipeline. In the pipeline.json file, you provide the ARN from the authentication secret you create, in the sshKeyArn parameter value. To create a secret in Secrets Manager so that App2Container can authenticate to the Git repository for the Jenkins agent, follow the steps shown in the Create a secret page in the AWS Secrets Create secrets for Jenkins pipelines 69 AWS App2Container User Guide Manager User Guide. Provide the information that App2Container needs to authenticate to the Git source repository as follows. Step 1 Choose secret type • Secret type – To store a key that App2Container uses programmatically, through API calls, choose the Other type of secrets option. • Specify the following Key/value pairs to store in the secret. To add the next key/value pair, choose + Add row. Username key • Key name (box 1): username • Key value (box 2): In the second box, enter the plaintext username value that App2Container uses with SSH to authenticate to the Git source repository for Jenkins. Username key • Key name (box 1): key • Key value (box 2): In the second box, copy the base64-encoded string that represents your private key file. Note To base64-encode your key file, you can use the following command, where .ssh/ id_rsa is the private key that encodes the file: $ base64 .ssh/id_rsa Step 2 Configure secret • Enter a name for your secret in the Secret name box. You can also enter optional information to help identify your secret, such as Description, or you can enter tags in the Tags panel. Authentication secret for Jenkins server Just as App2Container needs credentials to interact with AWS services on your behalf, so it also needs credentials to interact with the Jenkins server that runs your pipelines. In the Create secrets for Jenkins pipelines 70 AWS App2Container User Guide pipeline.json file, you provide the ARN from the authentication secret you create, in the apiTokenArn parameter value. Generate a Jenkins authentication token Before you store your Jenkins authentication secrets in Secrets Manager, generate an API token from your Jenkins server. To generate a Jenkins API authentication token, follow these steps: 1. 2. 3. 4. Log in to your Jenkins server. In the upper right corner of the interface, choose your name. From the left side navigation menu, choose Configure . In the API Token panel, choose Add new Token. 5. After Jenkins generates the token, give it a name. Keep track of the name. You will need it for the secret key you enter in Secrets Manager. 6. Choose the copy icon to copy the token value, or select and copy the value manually. You will need it for the secret value that you enter in Secrets Manager You can't see the value again after you log out of Jenkins. Note Ensure that you revoke tokens that you no longer need. Store your Jenkins authentication token in Secrets Manager To create a secret in Secrets Manager for the Jenkins authentication token, follow the steps shown in the Create a secret page in the AWS Secrets Manager User Guide. Provide the information that App2Container needs to authenticate to the Jenkins server that runs your pipelines as follows. Step 1 Choose secret type • Secret type – To store a key that App2Container uses programmatically, through API calls, choose the Other type of secrets option. • Specify the following Key/value pairs to store in the secret. To add the next key/value pair, choose + Add row. Username key • Key name (box 1): username Create secrets for Jenkins pipelines 71 AWS App2Container User Guide • Key value (box 2): In the second box, enter the plaintext username value so that App2Container can log in to the Jenkins server. Username key • Key name (box 1): apitoken • Key value (box 2): In the second box, copy the base64-encoded string that represents your Jenkins authentication token. Note To base64-encode a string, you
a2c-ug-023
a2c-ug.pdf
23
type of secrets option. • Specify the following Key/value pairs to store in the secret. To add the next key/value pair, choose + Add row. Username key • Key name (box 1): username Create secrets for Jenkins pipelines 71 AWS App2Container User Guide • Key value (box 2): In the second box, enter the plaintext username value so that App2Container can log in to the Jenkins server. Username key • Key name (box 1): apitoken • Key value (box 2): In the second box, copy the base64-encoded string that represents your Jenkins authentication token. Note To base64-encode a string, you can use the following command: $ echo string-to-encode | base64 Step 2 Configure secret • Enter a name for your secret in the Secret name box. You can also enter optional information to help identify your secret, such as Description, or you can enter tags in the Tags panel. Create secrets for Microsoft Azure DevOps pipelines To integrate with Azure Repos Git repositories and Azure DevOps pipelines, App2Container uses secure authentication. App2Container authenticates with a Microsoft Azure Personal Access Token (PAT) that you store as a secret in Secrets Manager. In the apiTokenArn parameter value of the pipeline.json file, provide the ARN from the authentication secret that you create. Generate a Microsoft Azure Personal Access Token (PAT) Before you generate a Personal Access Token (PAT), you first must have an active Microsoft Azure account, with an organization and project already defined. For more information about how to set up Azure DevOps, see Prerequisites. To generate a PAT for your Microsoft Azure account, sign in to your Azure organization and create a new token with a Custom defined scope. For instructions, see Create a PAT in the Azure DevOps Create secrets for Microsoft Azure DevOps pipelines 72 AWS App2Container User Guide Services documentation on the Microsoft documentation website. Choose the settings for your custom scope as follows. • Agent Pools: Read and manage • Build: Read and execute • Code: Full • Extensions: Read and manage • Release: Read, write, execute, and manage • Service Connections: Read and query Note If you don't see all of the settings, choose Show all scopes to show the complete list. Store your PAT in Secrets Manager To create a secret in Secrets Manager for the PAT, follow the procedure on the Create a secret page in the AWS Secrets Manager User Guide. To access the Azure Repos Git repository, and Azure DevOps, provide the information that App2Container needs to authenticate to Microsoft Azure, as follows. Step 1 Choose secret type • Secret type – To store a key that App2Container uses programmatically, through API calls, choose the Other type of secrets option. • Specify the following Key/value pair to store in the secret. PAT key • Key name (box 1): azure-personal-access-token • Key value (box 2): Paste a copy of the token string that the Azure DevOps service generated. Step 2 Configure secret • Enter a name for your secret in the Secret name box. You can also enter optional information to help identify your secret, such as Description, or you can enter tags in the Tags panel. Create secrets for Microsoft Azure DevOps pipelines 73 AWS App2Container User Guide Configuring application containers When you run the analyze command, an analysis.json file is created for the application that is specified in the --application-id parameter. The containerize command uses this file to build the application container image and to generate artifacts. You can configure the fields in the containerParameters section before running the containerize command to customize your application container. For configurable key/value pairs that do not apply to your container, set string values to an empty string, numeric values to zero, and Boolean values to false. Containers running on Linux For applications running on Linux, the application analysis.json file includes the following content: Read-only data • Control fields – Fields having to do with file creation, such as template version, and the file creation timestamp. • analysisInfo – System dependencies for the application. Configurable data The containerParameters section contains the following fields: • imageRepository (string, required) – The name of the repository where the application container image is stored. • imageTag (string, required) – A tag for the build version of the application container image. • containerBaseImage (string) – The base operating system (OS) image for the container build. By default, App2Container uses the operating system from the application server or worker machine where containerization runs. Note If specified, this must be an image name from your registry in the format <image name>[:<tag>], and it must match the operating system platform and version that runs Configure containers 74 AWS App2Container User Guide on the application server or worker machine where containerization runs. The tag is optional if the repository supports "latest". • appExcludedFiles (array
a2c-ug-024
a2c-ug.pdf
24
A tag for the build version of the application container image. • containerBaseImage (string) – The base operating system (OS) image for the container build. By default, App2Container uses the operating system from the application server or worker machine where containerization runs. Note If specified, this must be an image name from your registry in the format <image name>[:<tag>], and it must match the operating system platform and version that runs Configure containers 74 AWS App2Container User Guide on the application server or worker machine where containerization runs. The tag is optional if the repository supports "latest". • appExcludedFiles (array of strings) – Specific files and directories to exclude from the container build. • appSpecificFiles (array of strings) – Specific files and directories to include in the container build. • applicationPort (number) – The application port exposed inside of the container. This port is tested for a successful HTTP response during pre-validation when the containerize command runs. App2Container assigns this as the default exposed port when creating a load balancer during deployment. • applicationMode (Boolean, required) – The approach that App2Container uses to determine which files to include in your container image. App2Container uses application mode (value=true) for supported application frameworks, and process mode (value=false) for all other configurations. You can override this value if necessary. For example, if your application is running on a supported framework, but App2Container did not recognize it and therefore assigned process mode, you can override the setting to use application mode instead. Application mode settings • true (application mode): For supported application frameworks, App2Container targets only the application files and dependencies that are needed for containerization, thereby minimizing the size of the resulting container image. This is known as application mode. Supported application frameworks include: Tomcat, TomEE, and JBoss (standalone mode). • false (process mode): If App2Container does not find a supported framework running on your application server, or if you have other dependent processes running on your server, App2Container takes a conservative approach to identifying dependencies. This is known as process mode. For process mode, all non-system files on the application server are included in the container image. Tip If your application container image includes unnecessary files, or is missing files that should be included, use the following parameters to make corrections: • To specify files to exclude from your application container image, use the appExcludedFiles parameter. Configure containers 75 AWS App2Container User Guide • To add files that were missed, use the appSpecificFiles parameter. • logLocations (array of strings) – Specific log files or log directories to be routed to stdout. This enables applications that write to log files on the host to be integrated with AWS services such as CloudWatch and Firehose. • enableDynamicLogging (Boolean, required) – Maps application logs to stdout as they are created. If set to true, requires log directories to be entered in logLocations. • dependencies (array of strings) – A listing of all dependent processes or applications found for the application ID by the analyze command. You can remove specific dependencies to exclude them from the container. Examples The following examples show an analysis.json file for an application running on Linux. Choose the tab that matches your application. Java This example shows an analysis.json file for a Java application running on Linux. { "a2CTemplateVersion": "", "createdTime": "", "containerParameters": { "_comment1": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the analysisInfo section below for details discovered regarding the application. ***", "imageRepository": "java-tomcat-6e6f3a87", "imageTag": "latest", "containerBaseImage": "ubuntu:18.04", "appExcludedFiles": [], "appSpecificFiles": [], "applicationPort": 5000, "applicationMode": true, "logLocations": [], "enableDynamicLogging": false, "dependencies": [] }, "analysisInfo": { "_comment2": "*** NON-EDITABLE: Analysis Results ***", Configure containers 76 AWS App2Container User Guide "processId": 2065, "appId": "java-tomcat-6e6f3a87", "userId": "1000", "groupId": "1000", "cmdline": [ "/usr/bin/java", "... list of commands", "start" ], "osData": { "BUG_REPORT_URL": "", "HOME_URL": "", "ID": "ubuntu", "ID_LIKE": "debian", "NAME": "Ubuntu", "PRETTY_NAME": "Ubuntu 18.04.2 LTS", "PRIVACY_POLICY_URL": "", "SUPPORT_URL": "", "UBUNTU_CODENAME": "", "VERSION": "", "VERSION_CODENAME": "", "VERSION_ID": "18.04" }, "osName": "ubuntu", "ports": [ { "localPort": 8080, "protocol": "tcp6" }, { "localPort": 8009, "protocol": "tcp6" }, { "localPort": 8005, "protocol": "tcp6" } ], "Properties": { "catalina.base": "<application directory>", "catalina.home": "<application directory>", "classpath": "<application directory>/bin/bootstrap.jar:... etc.", "ignore.endorsed.dirs": "", Configure containers 77 AWS App2Container User Guide "java.io.tmpdir": "<application directory>/temp", "java.protocol.handler.pkgs": "org.apache.catalina.webresources", "java.util.logging.config.file": "<application directory>/conf/ logging.properties", "java.util.logging.manager": "org.apache.juli.ClassLoaderLogManager", "jdk.tls.ephemeralDHKeySize": "2048", "jdkVersion": "11.0.7", "org.apache.catalina.security.SecurityListener.UMASK": "" }, "AdvancedAppInfo": { "Directories": { "base": "<application directory>", "bin": "<application directory>/bin", "conf": "<application directory>/conf", "home": "<application directory>", "lib": "<application directory>/lib", "logConfig": "<application directory>/conf/ logging.properties", "logs": "<application directory>/logs", "tempDir": "<application directory>/temp", "webapps": "<application directory>/webapps", "work": "<application directory>/work" }, "distro": "java-tomee", "flavor": "plume", "jdkVersion": "11.0.7", "version": "8.0.0" }, "env": { "HOME": "... Java Home directory", "JDK_JAVA_OPTIONS": "", "LANG": "C.UTF-8", "LC_TERMINAL": "iTerm2", "LC_TERMINAL_VERSION": "3.3.11", "LESSCLOSE": "/usr/bin/lesspipe %s %s", "LESSOPEN": "| /usr/bin/lesspipe %s", "LOGNAME": "ubuntu", "LS_COLORS": "", "MAIL": "", "OLDPWD": "",
a2c-ug-025
a2c-ug.pdf
25
containers 77 AWS App2Container User Guide "java.io.tmpdir": "<application directory>/temp", "java.protocol.handler.pkgs": "org.apache.catalina.webresources", "java.util.logging.config.file": "<application directory>/conf/ logging.properties", "java.util.logging.manager": "org.apache.juli.ClassLoaderLogManager", "jdk.tls.ephemeralDHKeySize": "2048", "jdkVersion": "11.0.7", "org.apache.catalina.security.SecurityListener.UMASK": "" }, "AdvancedAppInfo": { "Directories": { "base": "<application directory>", "bin": "<application directory>/bin", "conf": "<application directory>/conf", "home": "<application directory>", "lib": "<application directory>/lib", "logConfig": "<application directory>/conf/ logging.properties", "logs": "<application directory>/logs", "tempDir": "<application directory>/temp", "webapps": "<application directory>/webapps", "work": "<application directory>/work" }, "distro": "java-tomee", "flavor": "plume", "jdkVersion": "11.0.7", "version": "8.0.0" }, "env": { "HOME": "... Java Home directory", "JDK_JAVA_OPTIONS": "", "LANG": "C.UTF-8", "LC_TERMINAL": "iTerm2", "LC_TERMINAL_VERSION": "3.3.11", "LESSCLOSE": "/usr/bin/lesspipe %s %s", "LESSOPEN": "| /usr/bin/lesspipe %s", "LOGNAME": "ubuntu", "LS_COLORS": "", "MAIL": "", "OLDPWD": "", "PATH": "... server PATH", "PWD": "", Configure containers 78 AWS App2Container User Guide "SHELL": "/bin/bash", "SHLVL": "1", "SSH_CLIENT": "", "SSH_CONNECTION": "", "SSH_TTY": "", "TERM": "", "USER": "ubuntu", "XDG_DATA_DIRS": "", "XDG_RUNTIME_DIR": "", "XDG_SESSION_ID": "1", "_": "bin/startup.sh" }, "cwd": "", "procUID": { "euid": "1000", "suid": "1000", "fsuid": "1000", "ruid": "1000" }, "procGID": { "egid": "1000", "sgid": "1000", "fsgid": "1000", "rgid": "1000" }, "userNames": { "1000": "ubuntu" }, "groupNames": { "1000": "ubuntu" }, "fileDescriptors": [ "<application directory>/logs/... log files", "<application directory>/lib/... jar files", "... etc.", "/usr/lib/jvm/.../lib/modules" ], "dependencies": {} } } Configure containers 79 AWS App2Container ASP.NET generic User Guide This example shows an analysis.json file for an ASP.NET generic application running on Linux. { "a2CTemplateVersion": "1.0", "createdTime": "2021-11-24 18:49:1224", "containerParameters": { "_comment1": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the analysisInfo section below for details discovered regarding the application. ***", "imageRepository": "dotnet-generic-a27b2829", "imageTag": "latest", "containerBaseImage": "mcr.microsoft.com/dotnet/sdk:5.0", "appExcludedFiles": [ "/root/.aws" ], "appSpecificFiles": [], "applicationPort": 5000, "applicationMode": true, "logLocations": [], "enableDynamicLogging": false, "dependencies": [] }, "analysisInfo": { "_comment2": "*** NON-EDITABLE: Analysis Results ***", "processId": 1, "appId": "dotnet-generic-a27b2829", "userId": "0", "groupId": "0", "cmdline": [ "/usr/bin/dotnet", "/root/nopCommerce440/Nop.Web.dll" ], "webApp": "", "osData": { "BUG_REPORT_URL": "https://bugs.launchpad.net/ubuntu/", "HOME_URL": "https://www.ubuntu.com/", "ID": "ubuntu", "ID_LIKE": "debian", "NAME": "Ubuntu", "PRETTY_NAME": "Ubuntu 20.04.3 LTS", Configure containers 80 AWS App2Container User Guide "PRIVACY_POLICY_URL": "https://www.ubuntu.com/legal/terms-and- policies/privacy-policy", "SUPPORT_URL": "https://help.ubuntu.com/", "UBUNTU_CODENAME": "focal", "VERSION": "20.04.3 LTS (Focal Fossa)", "VERSION_CODENAME": "focal", "VERSION_ID": "20.04" }, "osName": "ubuntu", "ports": [ { "localPort": 5000, "protocol": "tcp" } ], "Properties": null, "applicationType": "dotnet-generic", "AdvancedAppInfo": { "Directories": { "dotnetApp": "/root/nopCommerce440" }, "dotnetVersion": "5.0" }, "env": { "HOME": "/root", "HOSTNAME": "678f90a12bc3", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM": "xterm", "TZ": "Etc/UTC" }, "cwd": "", "exe": "/usr/share/dotnet/dotnet", "procUID": { "euid": "0", "suid": "0", "fsuid": "0", "ruid": "0" }, "procGID": { "egid": "0", "sgid": "0", "fsgid": "0", "rgid": "0" }, Configure containers 81 AWS App2Container User Guide "userNames": { "0": "root" }, "groupNames": { "0": "root" }, "fileDescriptors": [ "/dev/pts/0", "/root/nopCommerce440/AdvancedStringBuilder.dll", "/root/nopCommerce440/AutoMapper.dll", "... etc.", "/root/nopCommerce440/netstandard.dll" ], "dependencies": {} } } ASP.NET single file This example shows an analysis.json file for an ASP.NET single file application running on Linux. { "a2CTemplateVersion": "1.0", "createdTime": "2021-11-29 07:08:2929", "containerParameters": { "_comment1": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the analysisInfo section below for details discovered regarding the application. ***", "imageRepository": "dotnet-single-c2930d3132", "imageTag": "latest", "containerBaseImage": "mcr.microsoft.com/dotnet/sdk:latest", "appExcludedFiles": [ "/root/.aws" ], "appSpecificFiles": [], "applicationPort": 5000, "applicationMode": true, "logLocations": [], "enableDynamicLogging": false, "dependencies": [] }, "analysisInfo": { Configure containers 82 AWS App2Container User Guide "_comment2": "*** NON-EDITABLE: Analysis Results ***", "processId": 1, "appId": "dotnet-single-c2930d3132", "userId": "0", "groupId": "0", "cmdline": [ "./MyCoreWebApp.5" ], "webApp": "", "osData": { "BUG_REPORT_URL": "https://bugs.launchpad.net/ubuntu/", "HOME_URL": "https://www.ubuntu.com/", "ID": "ubuntu", "ID_LIKE": "debian", "NAME": "Ubuntu", "PRETTY_NAME": "Ubuntu 20.04.3 LTS", "PRIVACY_POLICY_URL": "https://www.ubuntu.com/legal/terms-and- policies/privacy-policy", "SUPPORT_URL": "https://help.ubuntu.com/", "UBUNTU_CODENAME": "focal", "VERSION": "20.04.3 LTS (Focal Fossa)", "VERSION_CODENAME": "focal", "VERSION_ID": "20.04" }, "osName": "ubuntu", "ports": [ { "localPort": 5000, "protocol": "tcp" } ], "Properties": null, "applicationType": "dotnet-single", "AdvancedAppInfo": { "Directories": { "dotnetApp": "/root/mycorewebapp" }, "dotnetVersion": "latest" }, "env": { "HOME": "/root", "HOSTNAME": "a1bc23d4567e", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM": "xterm", Configure containers 83 AWS App2Container User Guide "TZ": "Etc/UTC" }, "cwd": "/root/mycorewebapp", "exe": "/root/mycorewebapp/MyCoreWebApp.5", "procUID": { "euid": "0", "suid": "0", "fsuid": "0", "ruid": "0" }, "procGID": { "egid": "0", "sgid": "0", "fsgid": "0", "rgid": "0" }, "userNames": { "0": "root" }, "groupNames": { "0": "root" }, "fileDescriptors": [ "/dev/pts/0", "/root/mycorewebapp/MyCoreWebApp.5" ], "dependencies": {} } } Containers running on Windows For applications running on Windows, the application analysis.json file includes the following content: Read-only data • Control fields – Fields having to do with file creation, such as template version, and the file creation timestamp. • analysisInfo – System dependencies for the application. Configure containers 84 AWS App2Container Configurable data User Guide The containerParameters section contains the following fields: • containerBaseImage (string) – The base operating system (OS) image for the container build. By default, App2Container uses the operating system from the application server or worker machine where containerization runs. Note If specified, this must be an image name from your registry in the format <image name>[:<tag>], and it must match the operating system platform and version that runs on the application server or worker machine where containerization runs. The tag is optional if the repository supports "latest". • enableServerConfigurationUpdates (Boolean, required)
a2c-ug-026
a2c-ug.pdf
26
application. Configure containers 84 AWS App2Container Configurable data User Guide The containerParameters section contains the following fields: • containerBaseImage (string) – The base operating system (OS) image for the container build. By default, App2Container uses the operating system from the application server or worker machine where containerization runs. Note If specified, this must be an image name from your registry in the format <image name>[:<tag>], and it must match the operating system platform and version that runs on the application server or worker machine where containerization runs. The tag is optional if the repository supports "latest". • enableServerConfigurationUpdates (Boolean, required) – Provides an option in the Dockerfile to restore the application configuration of the source server. • imageRepositoryName (string, required) – The name of the repository where the application container image is stored. • imageTag (string, required) – A tag for the build version of the application container image. • additionalExposedPorts (array of numbers) – Additional port numbers that should be exposed inside of the application container. • appIncludedFiles (array of strings) – Specific files and directories to include in the container build. • appExcludedFiles (array of strings) – Specific files and directories to exclude from the container build. • enableLogging (Boolean, required) – Enables dynamic logging, redirecting application logs to container stdout. • includedWebApps (array of strings) – The application IDs for web applications running under the IIS site that should be included in the container image. Applications must have been running in IIS during inventory and analysis. • additionalApps (array of strings) – For the analysis.json file that describes the root application in a complex Windows .NET application, these are the additional application or service components to include in the application container. You can include up to five additional application components in the array. Configure containers 85 AWS App2Container Examples User Guide The following examples show an analysis.json file for a .NET application running on Windows. Your analysis.json file configuration can vary by the type of .NET application you are migrating, its dependencies, and whether you want it to run in a single container or in multiple containers. Choose the tab that matches your .NET configuration. Simple The following example shows an analysis.json file for a simple .NET application running on Windows. { "a2CTemplateVersion": "3.1", "createdTime": "", "containerParameters": { "_comment": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the Analysis Results section further below for details discovered regarding the application. ***", "containerBaseImage": "mcr.microsoft.com/dotnet/framework/aspnet:4.7.2- windowsservercore-ltsc2019", "enableServerConfigurationUpdates": true, "imageRepositoryName": "iis-smarts-51d2dbf8", "imageTag": "latest", "additionalExposedPorts": [ ], "appIncludedFiles": [ ], "appExcludedFiles": [ ], "enableLogging": false, "additionalApps": [ ] }, "analysisInfo": { "_comment": "*** NON-EDITABLE: Analysis Results ***", "hostInfo": { "os": "...", "osVersion": "...", "osWindowsDirectory": "...", "arch": "..." }, Configure containers 86 AWS App2Container User Guide "appId": "iis-smarts-51d2dbf8", "appServerIp": "localhost", "appType": "IIS", "appName": "smarts", "ports": [ { "localPort": 90, "protocol": "http" } ], "features": [ "File-Services", "FS-FileServer", "Web-Http-Tracing", "Web-Basic-Auth", "Web-Digest-Auth", "Web-Url-Auth", "Web-Windows-Auth", "Web-ASP", "Web-CGI", "Web-Mgmt-Tools", "Web-Mgmt-Console", "Web-Scripting-Tools", "FS-SMB1", "User-Interfaces-Infra", "Server-Gui-Mgmt-Infra", "Server-Gui-Shell", "PowerShell-ISE" ], "appPoolName": "smarts", "poolIdentityType": "ApplicationPoolIdentity", "dotnetVersion": "v4.0", "iisVersion": "IIS 10.0", "sitePhysicalPath": "<IIS web root directory>\\smarts", "discoveredWebApps": [ ], "reportPath": "<application output directory>\\iis-smarts-51d2dbf8\\report.txt", "isSiteUsingWindowsAuth": false, "serverBackupFile": "<application directory>\\Web Deploy Backups\\... backup zip file" } } Configure containers 87 AWS App2Container Complex – one container User Guide In this scenario, each application or service has its own analysis.json file, but the root application references the application ID for the service in the additionalApps array. This results in a single container that includes both the root application and the service when you run the containerize command. • Root application The following example shows the analysis.json file for the root application. { "a2CTemplateVersion": "1.0", "createdTime": "2021-06-25-05:18:24", "containerParameters": { "_comment": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the Analysis Results section further below for details discovered regarding the application. ***", "containerBaseImage": "", "enableServerConfigurationUpdates": true, "imageRepositoryName": "iis-colormvciis-b69c09ab", "imageTag": "latest", "additionalExposedPorts": [ ], "appIncludedFiles": [ ], "appExcludedFiles": [ ], "enableLogging": false, "includedWebApps": [ ], "additionalApps": [ "service-colorwindowsservice-69f90194" ] }, "analysisInfo": { "_comment": "*** NON-EDITABLE: Analysis Results ***", "hostInfo": { "os": "Microsoft Windows Server 2019 Datacenter", "osVersion": "10.0.17763", "osWindowsDirectory": "C:\\Windows", "arch": "64-bit" }, Configure containers 88 AWS App2Container User Guide "appId": "iis-colormvciis-b69c09ab", "appServerIp": "localhost", "appType": "IIS", "appName": "colorMvcIIs", "ports": [ { "localPort": 82, "protocol": "http" } ], "features": [ "Web-Http-Redirect", "Web-Custom-Logging", "... etc." ], "appPoolName": "colorMVC", "poolIdentityType": "ApplicationPoolIdentity", "dotNetVersion": "v4.0", "iisVersion": "IIS 10.0", "sitePhysicalPath": "C:\\colorMvcIis", "discoveredWebApps": [ ], "siteUsesWindowsAuth": false, "serverBackupFile": "<application directory>\\Web Deploy Backups\\... backup zip file", "reportPath": "<application output directory>\\iis-colormvciis-b69c09ab\ \report.txt" } } • Windows service The following example shows the analysis.json file for the Windows service that is included in the application container. { "a2CTemplateVersion": "1.0", "createdTime": "2021-07-09-04:16:58", "containerParameters": { "_comment": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the Analysis Results section further
a2c-ug-027
a2c-ug.pdf
27
"appType": "IIS", "appName": "colorMvcIIs", "ports": [ { "localPort": 82, "protocol": "http" } ], "features": [ "Web-Http-Redirect", "Web-Custom-Logging", "... etc." ], "appPoolName": "colorMVC", "poolIdentityType": "ApplicationPoolIdentity", "dotNetVersion": "v4.0", "iisVersion": "IIS 10.0", "sitePhysicalPath": "C:\\colorMvcIis", "discoveredWebApps": [ ], "siteUsesWindowsAuth": false, "serverBackupFile": "<application directory>\\Web Deploy Backups\\... backup zip file", "reportPath": "<application output directory>\\iis-colormvciis-b69c09ab\ \report.txt" } } • Windows service The following example shows the analysis.json file for the Windows service that is included in the application container. { "a2CTemplateVersion": "1.0", "createdTime": "2021-07-09-04:16:58", "containerParameters": { "_comment": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the Analysis Results section further below for details discovered regarding the application. ***", "containerBaseImage": "", Configure containers 89 AWS App2Container User Guide "enableServerConfigurationUpdates": true, "imageRepositoryName": "service-colorwindowsservice-69f90194", "imageTag": "latest", "additionalExposedPorts": [ ], "appIncludedFiles": [ ], "appExcludedFiles": [ ], "enableLogging": false, "additionalApps": [ ] }, "analysisInfo": { "_comment": "*** NON-EDITABLE: Analysis Results ***", "hostInfo": { "os": "Microsoft Windows Server 2019 Datacenter", "osVersion": "10.0.17763", "osWindowsDirectory": "C:\\Windows", "arch": "64-bit" }, "appId": "service-colorwindowsservice-69f90194", "appServerIp": "localhost", "appType": "service", "appName": "colorwindowsservice", "ports": [ { "localPort": 33335, "protocol": "TCP" } ], "features": [ "Web-Http-Redirect", "Web-Custom-Logging", "... etc." ], "serviceName": "colorwindowsservice", "serviceBinary": "ColorWindowsService.exe", "serviceDir": "C:\\COLORCODE\\colorservice-master\\ColorWindowsService\\bin\ \Release\\", "cmdline": [ "C:\\COLORCODE\\colorservice-master\\ColorWindowsService\\bin\\Release\ \ColorWindowsService.exe" ] Configure containers 90 AWS App2Container } } Complex – multiple containers User Guide In this scenario, each application or service has its own analysis.json file, and the additionalApps array is empty. To create two containers, run the containerize command twice – once for the root application and once for the service. For container orchestration, specify the service as a dependent application when you configure the deployment.json file for the root application. • Root application The following example shows the analysis.json file for the root application. { "a2CTemplateVersion": "1.0", "createdTime": "2021-06-25-05:18:24", "containerParameters": { "_comment": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the Analysis Results section further below for details discovered regarding the application. ***", "containerBaseImage": "", "enableServerConfigurationUpdates": true, "imageRepositoryName": "iis-colormvciis-b69c09ab", "imageTag": "latest", "additionalExposedPorts": [ ], "appIncludedFiles": [ ], "appExcludedFiles": [ ], "enableLogging": false, "includedWebApps": [ ], "additionalApps": [ ] }, "analysisInfo": { "_comment": "*** NON-EDITABLE: Analysis Results ***", "hostInfo": { "os": "Microsoft Windows Server 2019 Datacenter", Configure containers 91 AWS App2Container User Guide "osVersion": "10.0.17763", "osWindowsDirectory": "C:\\Windows", "arch": "64-bit" }, "appId": "iis-colormvciis-b69c09ab", "appServerIp": "localhost", "appType": "IIS", "appName": "colorMvcIIs", "ports": [ { "localPort": 82, "protocol": "http" } ], "features": [ "Web-Http-Redirect", "Web-Custom-Logging", "... etc." ], "appPoolName": "colorMVC", "poolIdentityType": "ApplicationPoolIdentity", "dotNetVersion": "v4.0", "iisVersion": "IIS 10.0", "sitePhysicalPath": "C:\\colorMvcIis", "discoveredWebApps": [ ], "siteUsesWindowsAuth": false, "serverBackupFile": "<application directory>\\Web Deploy Backups\\... backup zip file", "reportPath": "<application output directory>\\iis-colormvciis-b69c09ab\ \report.txt" } } • Windows service The following example shows the analysis.json file for the Windows service that runs in a separate container. { "a2CTemplateVersion": "1.0", "createdTime": "2021-07-09-04:16:58", "containerParameters": { Configure containers 92 AWS App2Container User Guide "_comment": "*** EDITABLE: The below section can be edited according to the application requirements. Please see the Analysis Results section further below for details discovered regarding the application. ***", "containerBaseImage": "", "enableServerConfigurationUpdates": true, "imageRepositoryName": "service-colorwindowsservice-69f90194", "imageTag": "latest", "additionalExposedPorts": [ ], "appIncludedFiles": [ ], "appExcludedFiles": [ ], "enableLogging": false, "additionalApps": [ ] }, "analysisInfo": { "_comment": "*** NON-EDITABLE: Analysis Results ***", "hostInfo": { "os": "Microsoft Windows Server 2019 Datacenter", "osVersion": "10.0.17763", "osWindowsDirectory": "C:\\Windows", "arch": "64-bit" }, "appId": "service-colorwindowsservice-69f90194", "appServerIp": "localhost", "appType": "service", "appName": "colorwindowsservice", "ports": [ { "localPort": 33335, "protocol": "TCP" } ], "features": [ "Web-Http-Redirect", "Web-Custom-Logging", "... etc." ], "serviceName": "colorwindowsservice", "serviceBinary": "ColorWindowsService.exe", "serviceDir": "C:\\COLORCODE\\colorservice-master\\ColorWindowsService\\bin\ \Release\\", Configure containers 93 AWS App2Container "cmdline": [ User Guide "C:\\COLORCODE\\colorservice-master\\ColorWindowsService\\bin\\Release\ \ColorWindowsService.exe" ] } } Note For complex Windows .NET applications, you can also use a hybrid approach, with some components running together in a single container and other components running in separate containers. Configuring container deployment This topic contains information about the files that are used for configuring deployment of application containers. Container deployment files • deployment.json file deployment.json file When you run the containerize command, a deployment.json file is created for the application specified in the --application-id parameter. The generate app-deployment command uses this file, along with others, to generate application deployment artifacts. All of the fields in this file are configurable as needed so that you can customize your application container deployment before running the generate app-deployment command. Important The deployment.json file includes sections for both Amazon ECS and Amazon EKS. If your application is suitable for App Runner, there is a section for that too. Set the Boolean value deployment flag for the section that matches your target container management service to true. Set the other flags to false. The flag to deploy to Amazon ECS Configure deployment 94 AWS App2Container User Guide is createEcsArtifacts, the flag to deploy to Amazon EKS is createEksArtifacts, and the flag to deploy to App Runner is createAppRunnerArtifacts. The application deployment.json file includes the following content. While all fields are configurable, the
a2c-ug-028
a2c-ug.pdf
28
The deployment.json file includes sections for both Amazon ECS and Amazon EKS. If your application is suitable for App Runner, there is a section for that too. Set the Boolean value deployment flag for the section that matches your target container management service to true. Set the other flags to false. The flag to deploy to Amazon ECS Configure deployment 94 AWS App2Container User Guide is createEcsArtifacts, the flag to deploy to Amazon EKS is createEksArtifacts, and the flag to deploy to App Runner is createAppRunnerArtifacts. The application deployment.json file includes the following content. While all fields are configurable, the following fields should not be changed: a2CTemplateVersion, applicationId, and imageName. For key-value pairs that do not apply to your deployment, set string values to an empty string, numeric values to zero, and Boolean values to false. • exposedPorts (array of objects, required) – An array of JSON objects representing the ports that should be exposed when the container is running. Each object consists of the following fields: • localPort (number) – A port to expose for container communication. • protocol (string) – The application protocol for the exposed port, for example, "http". • environment (array of objects) – Environment variables to be passed on to the target container management deployment. For Amazon ECS deployments, the key-value pairs update the Amazon ECS task definition. For Amazon EKS deployments, the key-value pairs update the Kubernetes deployment.yml file. • ecrParameters (object) – Contains parameters needed to register application container images in Amazon ECR. • ecrRepoTag (string, required) – The version tag to use for registering an application container image in Amazon ECR. • ecsParameters (object) – Contains parameters needed for deployment to Amazon ECS. The createEcsArtifacts parameter is always required. Other parameters in this section that are marked as required apply only to Amazon ECS deployment. • createEcsArtifacts (Boolean, required) – A flag that indicates if you are targeting Amazon ECS for deployment. • ecsFamily (string, required) – An ID for the Amazon ECS family in the Amazon ECS task definition. We recommend setting this value to the application ID. • cpu (number, required*) – The hard limit for the number of vCPUs to present for the task. When the task definition is registered, the number of CPU units is determined by multiplying the number of vCPUs by 1024. * This parameter is required for Linux containers, but is not supported for Windows containers. • memory (number or string, required*) – The hard limit of memory (in MiB) to present to the task. You can express this value as an integer in the Amazon ECS task definition, using MiB, for deployment.json file 95 AWS App2Container User Guide example, 1024. You can also express the value as a string including the unit GB, for example, 1 GB. When the task definition is registered, a GB value is converted to an integer indicating the MiB. * This parameter is required for Linux containers, but is not supported for Windows containers. Note In the Amazon ECS task definition, task size consists of the cpu and memory parameters. The configuration for task size, in part, depends on where your tasks are hosted – on an EC2 instance, or in Fargate. For more information about setting the task size for your Amazon ECS task definition, see Task definition parameters in the Amazon Elastic Container Service Developer Guide. • dockerSecurityOption (string) – For .NET applications, this is the gMSA Credspec location value for the Amazon ECS task definition. • enableCloudwatchLogging (Boolean, required*) – A flag that sets the Amazon ECS task definition to turn on CloudWatch logging for your Windows application container. If set to true, the enableLogging field in the analysis.json file must have a valid value. * This parameter is required for Windows containers, but is not supported for Linux containers. • publicApp (Boolean, required) – A flag to configure the CloudFormation templates with a public endpoint for your application when it runs. • stackName (string, required) – A name to use as a prefix to your CloudFormation stack Amazon Resource Name (ARN). We recommend using the application ID for this. • resourceTags (array of objects) – Custom tags, expressed as key/value pairs that are added to resources during deployment. For Amazon ECS deployments, the key-value pairs update the Amazon ECS task definition. Note An example tag is generated when the deployment.json file is created. If the example tag isn't removed or changed before deployment, it's ignored by default. • reuseResources (object) – Contains shared resource identifiers that can be used throughout your CloudFormation templates. deployment.json file 96 AWS App2Container User Guide • vpcId (string) – The VPC ID, if you want to bring your own VPC or to reuse an existing VPC that App2Container created for a prior deployment. • reuseExistingA2cStack (object) – Contains references so
a2c-ug-029
a2c-ug.pdf
29
resources during deployment. For Amazon ECS deployments, the key-value pairs update the Amazon ECS task definition. Note An example tag is generated when the deployment.json file is created. If the example tag isn't removed or changed before deployment, it's ignored by default. • reuseResources (object) – Contains shared resource identifiers that can be used throughout your CloudFormation templates. deployment.json file 96 AWS App2Container User Guide • vpcId (string) – The VPC ID, if you want to bring your own VPC or to reuse an existing VPC that App2Container created for a prior deployment. • reuseExistingA2cStack (object) – Contains references so that you can reuse AWS CloudFormation resources that App2Container has already created. • cfnStackName (string) – The name or ID (ARN) of the CloudFormation stack created with App2Container for the containerized application. • microserviceUriPath (string) – Used to create application forwarding rules in your load balancer. Note The load balancer does not strip off this prefix when it forwards traffic. Your application must be able to handle requests coming in with the prefix. • sshKeyPairName (string) – The name of the EC2 key pair to use for the instances that your container runs on. • acmCertificateArn (string) – The AWS Certificate Manager certificate ARN used to provide HTTPS connectivity to your Application Load Balancer. Note The certificate can be imported or provisioned as follows: • To import an IIS certificate into ACM, see How to import PFX-formatted certificates into AWS Certificate Manager using OpenSSL. • To provision a certificate in ACM, see Issuing and Managing Certificates in the AWS Certificate Manager User Guide. If you use an HTTPS endpoint for your load balancer, this parameter is required. For more information about ACM, see What is AWS Certificate Manager in the AWS Certificate Manager User Guide. • gMSAParameters (object) – Contains parameters used by the CloudFormation template to create gMSA-related artifacts for .NET applications that are deployed on EC2 instances. The gMSAParameters are not valid for deployments to Fargate, and will generate an error when the generate app-deployment command runs. deployment.json file 97 AWS App2Container User Guide • domainSecretsArn (string) – The Secrets Manager ARN for the domain credentials to join the Amazon ECS nodes to gMSA Active Directory. • domainDNSName (string) – The DNS name of the gMSA Active Directory for Amazon ECS nodes to join. • domainNetBIOSName (string) – The NetBIOS name of the Active Directory for Amazon ECS nodes to join. • createGMSA (Boolean, required) – A flag to create a group Managed Service Account (gMSA) Active Directory security group and account, using the name supplied in the gMSAName field. • gMSAName (string) – The name of the gMSA Active Directory that the container should use for access. • deployTarget (string, required) – Identifies which Amazon ECS container launch type runs the task. Valid values depend on your application environment, as follows: • .NET applications running on Windows – ec2, fargate. • Java applications running on Linux – fargate. Note The default value that is generated for the deployTarget parameter for .NET applications running on Windows is ec2. To deploy your application to Fargate, you can edit the deployment.json file, and change that value to fargate. If your .NET application meets the following criteria, you can deploy to Fargate. • The base operating system for your container is Windows 2019. If you are using a worker machine for containerization, this means that the worker machine must be running Windows 2019. • Your application must not use gMSA. • dependentApps (array of objects) – For complex Windows applications, this array of JSON objects contains identifying details for dependent applications. App2Container does not generate this array. For complex Windows applications that incorporate dependent applications, you must add details to this array for each dependent application. You can include up to two dependent applications in the array. • appId (string, required) – The application ID that App2Container generated for this dependent application. deployment.json file 98 AWS App2Container User Guide • privateRootDomain (string, required) – The private domain name that's used for creating the hosted zone. • dnsRecordName (string, required) – The DNS record name of the application. This is combined with the privateRootDomain to construct the endpoint for the dependent application. • fireLensParameters (object) – Contains parameters needed to use FireLens with your Linux application to route your application logs for Amazon ECS tasks. The enableFireLensLogging parameter is always required. Other parameters in this section that are marked as required apply only when FireLens is used for log routing. Note This section is not included for applications running on Windows. • enableFireLensLogging (Boolean, required) – A flag for using FireLens for Amazon ECS to configure application log routing for containers. • logDestinations (array of objects) – A list of unique target destinations for application log routing. If more than one destination
End of preview. Expand in Data Studio

📚 AWS PDF Chunk Dataset

This dataset consists of chunked text extracted from all publicly available PDF documents on the Amazon Web Services (AWS) official website. The data includes whitepapers, user guides, technical documentation, and best practice manuals—covering virtually every AWS service, concept, and architecture in depth.

It is designed to serve as a high-quality knowledge base for use in embedding generation, vector databases, and retrieval-augmented generation (RAG) systems.


📦 Dataset Structure

The dataset is provided as a .json file. Each entry corresponds to a text chunk extracted from a PDF document using a sliding window with 800-token chunks and 100-token overlap. This preserves semantic continuity and improves embedding-based retrieval performance.

[
  {
    "id": "EC2Guide-001",
    "source": "EC2Guide.pdf",
    "chunk_id": 1,
    "text": "Amazon EC2 allows scalable computing capacity in the AWS cloud..."
  },
  ...
]

⚠️ Disclaimer This dataset is not affiliated with or endorsed by Amazon Web Services. All content is extracted from publicly available PDF files hosted on aws.amazon.com and is provided strictly for educational and research purposes under fair use.

Commercial usage is not allowed.


🔗 Author & Contact

Downloads last month
88