Category

AWS CLI

How to Create the IAM Policy for AWS Cloud Auto Scaling

AutoscalingAWS Auto Scaling allows the user to automatically scale the Amazon EC2 compute resources up or down as per the defined conditions. The AWS Identification and Access Management allows the AWS user to create roles, users or groups for the organization. IAM is used to configure groups of users who will be allowed or denied access to specific AWS services. The user can provide or deny the access with a set of IAM policies.

The IAM Policy is used to grant access permission to a user, group or role based on the AWS resources specific rules. To give a particular IAM entity permission, the user needs to write a policy according to the access policy language that IAM uses and then attach the policy to the related AWS entity. In case of a group, the group users’ inherit the group policy. More than one policy can be attached to a group or a user.

The IAM Roles can also be used with Auto Scaling. Auto Scaling integrates with IAM so that the user can specify which Auto Scaling actions can be performed in the AWS Account with the Auto Scaling resources. Auto Scaling can be configured with IAM at a service level (e.g. create or delete launch configuration, create or update the Auto scaling group). However, it cannot be linked to a particular resource, such as a specific Auto Scaling group or instance.

Using IAM does not change how to scale or configure Auto Scaling. However, it changes who should do it.

The present guide demonstrates how to create an IAM policy for Auto Scaling. The policy will allow accessing or denying certain Auto Scaling services.

How to Suspend and Resume the AWS Cloud Auto Scaling Process

AutoscalingAWS Auto Scaling allows the user to automatically scale the Amazon EC2 compute resources up or down as per the defined conditions. The scaling process can be configured to maintain a fixed number of instances, scale up or down based on demand or scale up or down at fixed schedule. If it is required to change the scaling configuration, the scaling group or for some unforeseen reason not scale for sometime, the user may need to suspend the scaling process. Auto Scaling allows suspending the process for some time and resuming it when required.

The present guide demonstrates how to suspend or resume the Auto Scaling process. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.

How to Use AWS Cloud Auto Scaling to Launch Spot EC2 Instances

AutoscalingAWS Auto Scaling provides horizontal scaling by automatically adding or removing compute resources for the application hosted on AWS. Auto Scaling is ideally suited for applications where there is a requirement for scalability.

Do you Auto-Scale your AWS Cloud?

In addition, it is also very important to track the cost of the AWS resources since AWS charges as per the pay as you go model.?AWS provides three kinds of instances: On-demand, Reserved Instances and Spot Instances.

For the spot instance, the user can bid for the unused AWS EC2 compute power at a cheaper rate. The spot instance helps the user to save some costs as the price bid is normally lesser than the on-demand fixed price. To use a spot instance, it requires placing a bid for the maximum amount that the user is ready to pay. If the current spot price is lesser than the bid price, AWS allows the user to launch a spot instance, whereby it will be charged at the current spot price. When the spot instance price is higher than the maximum bid price, AWS will terminate the instance.

Spot instances gives very good flexibility as Auto scaling launches new instances on certain conditions and terminates them when not required. Using a spot instance helps the user to add additional compute power at a lower rate.

The present guide demonstrates how to launch spot instances with Auto Scaling. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.

How to Tag the AWS EC2 Instances of the Auto Scaling Groups

AutoscalingAWS Auto Scaling allows the user to automatically scale the Amazon EC2 compute resources up or down as per the defined conditions. It is very important to track the cost of the AWS resources since AWS charges as per the pay as you go model. Amazon provides a tagging facility to tag the resources, such as Auto Scaling, EC2 Instances and S3 objects. The user can track the cost of the resources based on the tags. Tagging uses a defined different key value pair for the tags, which aids the user to filter the cost based on the key (tag name). ?When an AWS instance is launched using the AWS console, it allows the user to provide tags, such as the name or any other key value pair.

The present guide demonstrates how to add or remove tags to the Auto Scaling group. The user can assign a cost center tag and then modify it to add or remove a tag. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.

How to Configure the Auto Scaling EC2 Cloud Instance Termination Policy

AutoscalingAWS Auto Scaling adds or removes the EC2 instances automatically based on a pre-configured condition. When a new EC2 instance is launched automatically it will be added to the Auto Scaling group. Auto Scaling allows the user to add a policy to decide on the termination of an instance.?Before Auto Scaling terminates the EC2 instance, it first checks the availability zones. It will find the availability zone with the highest number of instances and delete the instance from there. If all the availability zones have the same number of instances, Auto Scaling selects any random zone. Once the availability zone is defined, Auto Scaling uses the termination policy to identify the instance to be deleted.

By default, Auto Scaling will delete the oldest instance from the selected availability zone. If more than one instance was launched simultaneously based on the scaling policy, Auto Scaling will take the instance that is closest to next instance hour. The above mentioned policy can result in cost savings. If more than one instance has the same time, Auto Scaling selects any random instance.

The present guide demonstrates how to configure and test the above mentioned termination policy for Auto Scaling. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.

How to Launch EC2 Auto Scaling with an IAM on AWS Cloud

AutoscalingAWS Auto Scaling allows the user to automatically scale the Amazon EC2 compute resources up or down as per the defined conditions. The AWS resources launched with Auto Scaling require the AWS security credentials to access other AWS resources. AWS provides the IAM Role to easily access the other AWS resources from the newly launched EC2 computer resources.

(For example, a newly launched EC2 instance may need the AWS credentials to take a regular backup of the EBS volume).

To assign the IAM Role to Auto Scaling, the user has to create an IAM instance profile with EC2 access. An instance profile is a container for the IAM Role. The user has to first create an IAM role, which has the permission to access the EC2 resources. The above mentioned role must be added to the instance profile.

The present guide demonstrates how to launch Auto Scaling with an IAM role. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.

How to Collect AWS Cloud Auto Scaling Group Metrics

AutoscalingAWS Auto Scaling provides horizontal scaling by automatically adding or removing the computer resources for the application hosted on AWS. Auto Scaling is ideally suited for applications where there is a requirement for scalability. Amazon CloudWatch is used for the basic monitoring of several AWS products including Auto Scaling. In basic monitoring, Amazon CloudWatch collects the data points sent by Auto Scaling every five minutes. AWS CloudWatch offers detailed monitoring for Amazon EC2 and Auto Scaling. In detailed monitoring, an AWS service sends the data points to Amazon CloudWatch every minute.

Instance metrics are the metrics that an individual Amazon EC2 instance sends to Amazon CloudWatch. They are the same for any Amazon EC2 instance, whether the instance is a part of an Auto Scaling group or not.

The present guide demonstrates how to enable detailed monitoring for Auto Scaling and collect the Auto Scaling group metrics. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by CLI.

How to Auto Scale (Based on Alerts) Behind an AWS ELB

AutoscalingAWS Auto Scaling allows the user to scale the Amazon EC2 computer resources up or down automatically as per the defined conditions. The user can configure auto scaling?as per the requirement. The Amazon Web Services also provides Elastic Load Balancing (ELB) to manage the traffic on a fleet of Amazon Elastic Compute Cloud instances.

When the AWS EC2 resources are managed by ELB, adding new resources to ELB will ensure that the additional traffic is well distributed to the new resources and the application performance is maintained.

The present guide demonstrates how to configure Auto Scaling with Cloudwatch and ELB. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by?CLI.

How to Configure Email Alerts for AWS Auto Scaling Using SNS

AutoscalingAWS Auto Scaling allows the user flexibility to achieve horizontal scalability by automatically adding or removing the Amazon EC2 compute resources. AWS does not charge separately; it charges for all the additional EC2 compute resources. It is important for the user to know when Auto Scaling has added new resources and when resources have been removed. Auto Scaling can be configured with Simple Notification Services (AWS SNS) to get the notification when a new EC2 instance is launched or terminated.

The present guide demonstrates how to configure Auto Scaling to send an email notification when Auto Scaling adds or removes the EC2 computer resources. Since AWS does not provide the management console for Auto Scaling, all the tasks would be performed by Auto Scaling ?CLI.

How to Configure AWS Cloud Auto Scaling to Scale Based on a Schedule

AWS Auto Scaling provides horizontal scaling by automatically adding or removing computer resources for the application hosted on AWS.?The present guide demonstrates how to configure Auto Scaling to scale based on a schedule.?Auto Scaling is ideally suited for an application where there is a requirement for scalability.

AWS does not provide an AWS Management console for Auto Scaling. Thus, all the operations should be performed through CLI or API. When the user wants to configure Auto Scaling for their resources, it is required to follow certain steps. The first step is to create a launch configuration, which defines resources, such as the AMI, EBS or Instance Type or detailed monitoring to be added by Auto Scaling.

Hitchhiker's Guide to The Cloud

Newvem's eBook for Cloud Operations