Apache MXNet on AWS
Developer Guide

Step 2: Create an AWS CloudFormation Stack

To quickly create and configure the resources that you need for a cluster of EC2 instances, use the AWS CloudFormation Deep Learning template. The template creates an AWS CloudFormation stack, which is a group of related resources that you manage as a single unit. The stack includes a cluster of EC2 instances and an Amazon Elastic File System (Amazon EFS) file system that the instances can share, among other resources. For a complete list of the resources that the template creates, see Resources Created by the Deep Learning Template.

The Deep Learning template can use either the Ubuntu version or the Amazon Linux version of the AWS Deep Learning Amazon Machine Image (AMI). For this exercise, we use the Ubuntu version.

The AMI installs Apache MXNet and other components, such as Python 2, Python 3, launch configuration tools, and many popular AWS libraries and tools. For more information about these AMIs, see Deep Learning AMI Ubuntu Version and Deep Learning AMI Amazon Linux Version.

Create the stack

  1. Download the template from the awslabs/deeplearning-cfn GitHub repository, and save it.

  2. Sign in to the AWS Management Console and open the AWS CloudFormation console at

  3. Create a stack as follows:

    • On the Select Template page, choose Upload a template to Amazon S3. Navigate to the folder where you saved the AWS CloudFormation template and choose the template file.

    • On the Specify Details page, provide the following parameter values:

      • For ImageType, choose Ubuntu.

      • For InstanceType, choose c4.4xlarge. This instance type provides the compute power and memory required for this exercise. In a production environment, you might choose a different instance type based on the requirements of your use case.

      • For KeyName, specify the EC2 key pair.

      • Choose an SSHLocation. This is the range of IP addresses from which you want to access the cluster. You can provide a CIDR range (for example, You can find the IP address at

      • For the WorkerCount, leave the default value of 1. This gives you two EC2 instances (one master and one worker). In your application scenario, you might choose a different worker count.

    • On the Options page, leave the defaults, and choose Next. Then on the Review page, choose Create stack.


      The stack is ready to use when the creation status changes to CREATE_COMPLETE.

  4. After AWS CloudFormation creates the stack, find the public DNS name of the master node. You use the public DNS name to connect to the master node in Step 3.

    1. Navigate to the AWS CloudFormation console, and choose the stack.

    2. Expand the Resources section. In the Logical ID list, choose the Physical ID associated with the Master Auto Scaling Group. This opens the Auto Scaling Groups page in the Amazon Elastic Compute Cloud(Amazon EC2) console.

    3. Choose the Instances tab (in the console UI, you choose the Instances tab, not the instance link on the left pane). The tab shows the master instance.

    4. Choose the Instance ID to open the Instances page.

    5. Find the Public DNS name of the master node and record it.

Next Step

Step 3: Connect to the Master Node in the Stack