Create Deployment Artifacts
In this step, App2Container generates the artifacts needed to deploy your application container in AWS. App2Container pre-fills key values in the artifacts based on your profile, the application analysis, and best practices.
You have two options for deployment to your target container management environment (Amazon ECR with Amazon ECS or Amazon EKS).
In this scenario, you will deploy your application container into Amazon ECR with Amazon ECS.
Run “app2container generate app-deployment” command to create the CloudFormation template for your deployment.
app2container generate app-deployment --application-id <net-app-id>
The process will take few mins. You should see the below output.
With this command, App2container does the following activities:
- Creates an ECR (Elastic Container Registry) Repository moves your application container image to the registry.
- Go AWS Console and navigate to ECS Service.
- Click “Amazon ECR” on the left pane.
- You will see that your container is automatically registered with this ECR repository.
- Once you click into your Repository, you will see that your container image with the “latest” tag is deployed.
You can update this tag and other container parameters in “analysis.json” file.
- Creates an ECS Task Definition and registers it with ECS.
- NOTE: ECS Task definitions required to run docker images in ECS. For further information about Task Definitions, you can check Amazon ECS Task Definitions.
- Uploads all CloudFormation resources to your selected S3 bucket.
- NOTE: You have defined this bucket earlier in Install & Initialize App2container section.
- Go to S3 service. And navigate to your defined bucket initially.
- You will see that app2container created a separate bucket for all your applications and put all the deployment artifacts are uploaded in those bucket.
- Creates a CloudFormation Master template.
- App2Container reviews your environment and prefills the Cloudformation template based on your desired configurations you’ve defined in previous steps, application analysis and best practices.
- This CloudFormation template describes all required resources and their dependencies so you can launch and configure them together as a stack.
- On the Worker Machine, locate the EcsDeployment folder location in your application folder as shown below and open the file.
- Locate the ecs-master.yml file location in EcsDeployment folder as shown below and open the file.
You do not need to make any changes in this file in this workshop. But you can also update this file based on your needs.
Congrats!, you are now all set and ready to deploy your .NET Application to AWS ECS! Continue with the next section to trigger the deployment.