CloudWatch Custom Metrics for Windows Server

Posted on June 2, 2016 by Richa Pathak | Comments(0)

It’s not rare that users having requirements of sending custom metrics to CloudWatch. These metrics can be application based or server based. There are different ways we can send these metrics to CloudWatch like writing a simple PowerShell script and scheduling it in Task Scheduler to run periodically. Alternate way to accomplish this, which I personally find very easy is by making simple changes in EC2ConfigService in your windows instance. ADVANTAGES: It is very easy to implement. There is no need to write scripts which sometimes can be really lengthy. Task Scheduler is not required which in turn can save memory. Most Importantly, margin of making error is very less. Let’s take an example that you want to send Free disk and Memory utilization metrics to CloudWatch. PREREQUISITES: EC2Config version should be 2.2.5 or later. Create IAM user with following permissions. IMPLEMENTATION: 1. RDP into your windows instance and from the Start menu, click All Programs, and then click EC2ConfigService Settings. 2. Enable CloudWatch Logs Integration and click OK. 3. Go to C:\Program Files\Amazon\Ec2ConfigService\Settings\AWS.EC2.Windows.CloudWatch.json and replace below code in the file. 4. Go to Control Panel\System and Security\Administrative Tools\Settings and restart EC2 Config service. And It’s done. You

Continue reading…


Integrating AWS Lambda with Slack

Posted on January 1, 2016 by Bhavik Joshi | Comments(3)

In this blog, we are going to integrate Lambda with slack to receive important notification in the slack channel. We will accomplish the following task. Create an Incoming Webhook in slack. Create a Lambda function which sends the notification to the slack. Make the Lambda function subscribe to the SNS Topic. Create an Alarm on the EC2 instance. Prerequisites: You must have a slack account A running EC2 instance Step by step process to integrate Lambda with Slack:   Task 1: Create an Incoming Webhook in slack. Step 1: Go to your slack application where you might be able to see below scenario Step 2: Click on your team name as below Step 3: You will find a popup Menu as shown below and click on App and Custom Integration Step 4: You will find the application site of Slack. Type “incoming” in the search box and select the Incoming Webhooks.   Step 5: Install the app in your respective Team.     Step 6: Select the channel and click on Add Incoming Webhook     Step 7: So the Incoming Webhook is being created. Step 8: All you need is a Webhook URL that you can find as below

Continue reading…

Introducing Run Command in EC2

Posted on December 9, 2015 by Ravi Theja | Comments(5)

In order to perform updates, patches, restart a particular process or running a particular powershell script in a Windows based EC2 instance we need to login to the machine and then make the required changes. Sometimes in a huge production environment this tends to be a cumbersome job for managing large fleet of machines. Therefore in order to make our lives easier AWS has introduced a new add-on feature for EC2 called as Command. Features of Run Command Using this feature we can perform system administrator tasks on Windows based EC2 machines. Currently the following actions are supported in Run Command. Configuring Cloud Watch Configuring Windows Update Install an Application Install PowerShell Module Join an EC2 instance to Directory Service Domain Run a PowerShell script Update EC2 config Security of Run Command Since Run Command runs from the AWS console and no username and password is required to access the instances, questions may arise as to how safe this feature is? Run Command incorporates with IAM policies and roles. Each and every command which is run using Run Command is stored in CloudTrail and also remains in the Console for 30 days. Run Command shows the output in the console for

Continue reading…

AWS Lambda – the future of event driven automation

Posted on November 5, 2015 by Srihari Patil | Comments(0)

Lambda is a compute service in Amazon Web Services, which triggers actions based on the events. Lambda is efficient and event driven which responses to events from either objects added or removed from S3, updating to DynamoDB tables, SNS, data in Kinesis Stream, Cloudwatch logs, In-App activity etc. Once our code is uploaded to Lambda, this service handles all the capacity, scaling, patching and administration of the infrastructure needed to run our code and also provides us with greater visibility of performance by publishing us with logs and metrics to Amazon CloudWatch.Lambda is cost- effective as it helps in running our code without any provisioning and managing servers with high availability.  AWS has been adding a lot of new features. AWS Lambda supports only 4 AWS regions, which include US-East (North Virginia), US-West (Oregon), EU-West (Ireland) and Asia Pacific (Tokyo). AWS provided support for writing Lambda functions in Node.js language and added Java Programming Language recently this year. New features are added in Lambda to help developers and other community people to make life much simpler and easy. Recently, AWS Lambda function has brought in new features; Functions can now be written in Python Programming Language. Lambda functions now support

Continue reading…

Deep dive into the AWS API Gateway

Posted on October 21, 2015 by Bhavik Joshi | Comments(2)

  From my previous blog, you can get a hands on with the AWS API Gateway. Now we will deep dive into it. Following points will be covered. How to pass Query String to the method? How to pass Headers to the method? How to Transform the Response of the Method? How to receive Custom Response Code (400,500,…) for the method? How partially secure your API using API Keys Prerequisites: Create a lambda function with code given here Create and Deploy the Product API with the GET Method, which integrates with the above function You can refer my previous blog to have the prerequisites.   1.How to pass Query String to the method? You have an API with you already, where you are calling an API with GET method, you get all the records in response, but what if we want a specific record in response? How can we get it? In this scenario, we can use the Query String. We will get the query string parameter from the HTTP request and then integrate the request using Mapping Templates. Step by Step process to pass the Query String Parameters to the Method   2.How to pass Headers to the method?   3.How to Transform the Response of the

Continue reading…

Migrate your pre-configured Windows Instance from on-premise or AWS to Azure

Posted on August 20, 2015 by Arman Koradia | Comments(14)

IT industry today is fast paced compared to any other industries in this century. Growth, Upgrade, Mobility, Availability are the buzz words in today’s world. This is the only industry which is more fashion driven than women’s fashion. With the growth of Cloud Computing, people are moving their existing infrastructure to Cloud. Many tech-giants like Amazon, Microsoft, Google, VMWare are offering their services in cloud computing. Amazon Web Services and Microsoft Azure are very frequent names for cloud services. Azure argues that its platform allows businesses to fully take advantage of hybrid cloud platforms. Azure Logic Apps works with your existing assets like legacy softwares, ERP, etc and extend it to Azure cloud. Thus with Azure, extensibility is in your control. Problem Definition: Cloud Consultant always get below requirements: Moving your on premise Windows Server to Microsoft Azure Moving your Amazon EC2 Windows Instance to Microsoft Azure. We have configured SharePoint Server or Exchange Server on AWS or on premise. To setup the same environment on Azure from scratch, might be time consuming or complicated process. So in such cases we will want to migrate preconfigured server to Azure. Solution: To solve the above problem, I’ll take you through the

Continue reading…


Cassandra Multi-AZ Data Replication

Posted on August 19, 2015 by CloudThat | Comments(7)

Apache Cassandra is an open source non-relational/NOSQL database. It is massively scalable and is designed to handle large amounts of data across multiple servers (Here, we shall use Amazon EC2 instances), providing high availability. In this blog, we shall replicate data across nodes running in multiple Availability Zones (AZs) to ensure reliability and fault tolerance. We will also learn how to ensure that the data remains intact even when an entire AZ goes down. The initial setup consists of a Cassandra cluster with 6 nodes with 2 nodes (EC2s) spread across AZ-1a , 2 in AZ-1b and 2 in AZ-1c. Initial Setup: Cassandra Cluster with six nodes. AZ-1a: us-east-1a: Node 1, Node 2 AZ-1b: us-east-1b: Node 3, Node 4 AZ-1c: us-east-1c: Node 5, Node 6 Next, we have to make changes in the Cassandra configuration file. cassandra.yaml file is the main configuration file for Cassandra. We can control how nodes are configured within a cluster, including inter-node communication, data partitioning and replica placement etc., in this config file. The key value which we need to define in the config file in this context is called Snitch. Basically, a snitch indicates as to which Region and Availability zones does each node in the

Continue reading…

Implementation of Custom Cloudwatch Metric in Amazon Web Services

Posted on August 19, 2015 by Ravi Theja | Comments(2)

What are metrics? Metrics are used to monitor various resources in Amazon Web Services like EBS volumes, EC2 instances and RDS instances. Apart from the pre-defined metrics in AWS, sometimes monitoring is required for additional service parameters. For creating a user defined metric, AWS has introduced custom metrics in CloudWatch. This feature can be used to store business and application metrics in Amazon CloudWatch.  Also, a graph plot is generated to give a visual interpretation of the metric. Custom metrics can be setup on almost all services such as Amazon EC2 instances, AWS Billing, Autoscaling, EBS volumes and Relational Database Services. In addition, CloudWatch alarms can be set and automated actions can be configured on the basis of these metrics.   Why use Custom metrics? Amazon Web Services provides a wide range of metrics for EBS, EC2 and RDS services. Alarms can be configured on the basis of these metrics and actions like terminating EC2 instances, restarting them or sending messages to SQS can then be taken. Each of these services have different metrics associated with them and Cloudwatch can measure metrics provided by the hypervisor like disk-read, disk-write and disk usage for EBS and CPU Utilization, CPU credit Usage.

Continue reading…

Integrating AWS API Gateway, Lambda and DynamoDB

Posted on August 19, 2015 by Bhavik Joshi | Comments(19)

In the current world of API, every mobile application and website have to communicate using dedicated API servers. These dedicated servers are explicitly set to handle the API calls for an application. API servers act as an intermediary between the application and the database. The bottleneck of this setup is that the API server has to be maintained to handle all the API calls. The increase in the number of API calls, increases the load of the API server which may require auto-scaling, which is cost-consuming.   The latest approach of the best architects is to utilize a new AWS service that explicitly replaces the need for a dedicated API Server. AWS API Gateway provides the ability to act as an interface between application and database which uses AWS Lambda function as the backend.     To get the essence of AWS API Gateway, we need to get hands-on with it. The next part of the blog is a detailed tutorial on how to use AWS API Gateway along with AWS Lambda & DynamoDB. People who are familiar with DynamoDB, API Gateway and Lambda can proceed with the high-level instructions. Also for people who are new to these services, there

Continue reading…

IAM Authorization Hierarchy

Posted on May 5, 2015 by Sankeerth Reddy | Comments(1)

Identity and Access Management (IAM) is the service that provides a authentication and authorization control for users and resources in ones AWS account. Although authentication has been quite simple and straightforward, viz. one can create groups, users and credentials for the users and share the same, authorization is quite a trick on IAM. Also, S3 Bucket policies and Bucket ACLs, SNS Topic Policies and SQS Policies are other resource level permissions which work in tandem with IAM permission. While IAM is from a users perspective, others are from a resource perspective. Many a time, I get questions like “Which permission gets higher priority?” or “User is in two groups with contradicting permissions, what would be effective?” or “What happens when no permissions are given?”. This blog is to clear these kind of ambiguity while using IAM, S3 bucket policies or any other mode of permission on AWS for that matter. AWS has always been adopting least permission policy across all the services. Meaning, if no permission about a specific resource is  specified, it would be a “Deny”. Post the initial deny decision, the final decision of deny or allow would be based on “Explicit” allows and denies specified in the

Continue reading…