O'Reilly logo

Amazon EC2 Cookbook by Aurobindo Sarkar, Sekhar Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deploying applications on EC2 instances

You can deploy your applications on EC2 instances using AWS CloudFormation. In this AWS CloudFormation template, for example, we will install an Apache server and deploy code to it. We also create EIP, SecurityGroup, and EC2 resources. Image ID, instance type, VPC ID, subnet ID, a name for the instance, and key/pair names are required parameters to run this recipe. As this is a public facing web application, use the public subnet in your VPC.

How to do it…

Follow the steps to install an Apache server and deploy some code to it:

  1. Create the CloudFormation template file JSON file (named apachewebserverdeployment.json) with the following content:
    { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required