Book Image

Ansible 2 Cloud Automation Cookbook

By : Aditya Patawari, Vikas Aggarwal
Book Image

Ansible 2 Cloud Automation Cookbook

By: Aditya Patawari, Vikas Aggarwal

Overview of this book

Ansible has a large collection of inbuilt modules to manage various cloud resources. The book begins with the concepts needed to safeguard your credentials and explain how you interact with cloud providers to manage resources. Each chapter begins with an introduction and prerequisites to use the right modules to manage a given cloud provider. Learn about Amazon Web Services, Google Cloud, Microsoft Azure, and other providers. Each chapter shows you how to create basic computing resources, which you can then use to deploy an application. Finally, you will be able to deploy a sample application to demonstrate various usage patterns and utilities of resources.
Table of Contents (11 chapters)

Creating auto scaling groups

So far, we have seen various services provided by AWS EC2. We have also seen the dynamic nature of the cloud that lets us spin any number of instances, volumes, load balancers, and so on.

When we deploy an application in production, we are likely to see non-uniform traffic patterns.

We might see a pattern where peak time starts at mid-afternoon and ends at midnight. For such cases, we might need to add more resources at certain times to keep our application latency uniform. Using auto scaling groups, we can achieve this goal. AWS EC2 provides three major components for auto scaling EC2 instances:

  • Launch Configurations act a template for auto scaling groups to launch EC2 instances. It contains information like the AMI ID, the security group, and so on required to launch an EC2 instance.
  • Auto Scaling Groups is a collection of EC2 instances which...