Skip to content

aws-samples/amazon-ec2-auto-scaling-windows-best-practices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Accelerate Amazon EC2 Auto Scaling for Microsoft Windows workloads

This repo hosts templates written for the AWS Blog Post "Accelerate Amazon EC2 Auto Scaling for Microsoft Windows workloads" published on the Microsoft Workloads on AWS blog channel.

Overview

This deploys infrastructure to run Bob's Used Books, an e-commerce website built with .NET. This sample solution leverages Amazon EC2 Auto Scaling groups to launch additional instances seamlessly during traffic spikes. This maintains application performance even under heavy load. This solution also uses EC2 fast launch technologies to streamline the instance boot process. Rather than taking 15+ minutes for a typical Windows Server OS launch with multiple reboots, fast launch skips unnecessary steps to boot freshly launched instances.

Architectural Diagram

Deployment

Cloudformation

Prerequisites

To deploy the application to AWS you need the following:

Getting Started

  1. Download deployment template. For this example we'll use the WindowsAutoScaling.yml CloudFormation template.
  2. Create a stack from the AWS CloudFormation Console. The CloudFormation template will create the resources shown in the architectural diagram above.

Create Stack

Template Parameters

The stack template includes the following parameters:

Parameter Required Description
Stack name Yes A stack is a collection of AWS resources that you can manage as a single unit. In other words, you can create, update, or delete a collection of resources by creating, updating, or deleting stacks. All the resources in a stack are defined by the stack's AWS CloudFormation template.
VPC Yes A virtual private cloud (VPC) is a virtual network dedicated to your AWS account. It is logically isolated from other virtual networks in the AWS Cloud.
PublicSubnets Yes A public subnet is a subnet that is associated with a route table that has a route to an Internet gateway. This connects the VPC to the Internet and to other AWS services. You much provide at least two for the internet-facing load balancer.
PrivateSubnets Yes A private subnet is a subnet that is associated with a route table that doesn't have a route to an internet gateway. You much provide at least two for the Auto Scaling group, Amazon Relational Database Service (RDS), Managed Active Directory (MAD) and other resources.
InstanceType Yes Amazon EC2 provides a wide selection of instance types optimized to fit different use cases. Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications. Each instance type includes one or more instance sizes, allowing you to scale your resources to the requirements of your target workload.
KeyPair Yes A key pair, consisting of a public key and a private key, is a set of security credentials that you use to prove your identity when connecting to an Amazon EC2 instance.
MicrosoftADDomainName Yes Fully qualified domain name (FQDN) of the AWS Managed Microsoft AD domain e.g. corp.example.com

Post Deployment

Cloudformation

After the infrastructure has been deployed into your environment, you can test the application by changing the desired capacity for the Auto Scaling group size.

  1. To make this change in the AWS Console, navigate to the EC2 Service and click Auto Scaling Groups for the left navigation.
  2. In the right pane, you'll see an auto scaling group prefixed by the stack name you chose earlier.
  3. Select this group.
  4. Click Edit.

Edit

  1. Change the Desired, Minimum, Maximum to 2 and Update.
  2. After a few minutes the EC2 will be provisioned. To view the website we need to get the DNS of the load balancer. Click Load Balancers from EC2 Service left navigation.
  3. In the right pane, you'll see a load balancers prefixed by the stack name you chose earlier.
  4. Select this load balancer.
  5. Copy the DNS name and paste in your browser address bar to view the application.

Load Balancer

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published