To deploy AWS cloud most effectively, monitoring is a crucial element. In this article, you will learn about the three key components of monitoring AWS performance: CloudWatch, CloudTrail, and Config.
Effective Monitoring of the AWS Cloud
CloudWatch
Cloudwatch provides metrics for every service that is used on AWS. Metrics is defined as a single variable to monitor. Each of these metrics belongs to namespaces, which is defined as the grouping. Dimension is an attribute of a metric and there are up to 10 dimensions per metric. Metrics also have timestamps. All of these metrics can be compiled into a dashboard as per user requirements.
Metrics can be out of the box (i.e. CPU Utilization) or there are custom metrics that can be defined and sent to CloudWatch. Standard metric resolution is to measure the variable every 1 minute, but more granular custom metrics can be provided as frequently as every second. Dashboards are global, meaning they can span across different regions and/or availability zones. The time zone and time range of the dashboards can also be changed as well as enabling auto-refresh.
Applications can either send logs to CloudWatch via a software development kit or CloudWatch can collect logs from internal applications. For the logs to function properly, IAM roles must be appropriate. By default, no logs will be sent from EC2 instances to CloudWatch. This functionality must be enabled via a CloudWatch agent. There are two types of CloudWatch logs – the Logs Agent and Unified Agent. The Logs Agent is an older version that can only send log data to the cloud watch. The Unified Agent sends log data and also collects additional system-level metrics on the EC2 instance.
CloudWatch alarms trigger notifications based on any metrics. Alarms can attach to auto-scaling groups, EC2 instances, and SNS notifications. There are three states of the alarm: OK, INSUFFICIENT DATA, and ALARM. The length of time can be customized for the alarm. High-resolution metrics can have either 10 or 30 seconds as the specified duration.
CloudWatch alarms can also be used to trigger EC2 recovery. If an EC2 instance goes down, recovery of an EC2 instance with the same private, public, elastic IP, metadata, and placement group will be spooled up. This will not recover any stored data that is attached to the EC2 instance – in most cases that data should be stored outside of the failed EC2 instance.
CloudWatch events create a small JSON document that gives information about the change. These events can react to an external event’s pattern changing or run on a regular basis.
CloudTrail
AWS CloudTrail provides governance and compliance for the AWS account. This allows users to retrieve the history of events via the console, software development kit, or other means. CloudTrail is a global service and records API calls made. Pricing for CloudTrail is parsed into three forms: management events, data events, and insights.
Config
AWSConfig is somewhat similar to CloudTrail in that it stores AWS historical records. However, these records pertain to the settings and changes within those settings rather than the output. These settings and compliance to requirements can be viewed over time. Log data can be stored in S3 and analyzed further if business needs dictate. The possibility of receiving alerts via AWS’s Simple notification service also exists. AWS Config is a per region service but can be aggregated across regions to get a global view.
Rules can be evaluated or triggered every time a rule changes, on regular time intervals, or when non-compliance occurs. AWS does not prevent actions from happening, it merely records the output. AWS Config requires a monthly charge on a per-region basis to activate.
Determining When to Use These Services
Effective use of the CloudWatch, CloudTrail, and Config depends on the needs of the enterprise. CloudWatch is the most frequently used service as it allows for additional infrastructure deployment. CloudTrail and Config are appropriate services when additional visibility or compliance requirements are needed. No matter the service that is chosen, special attention must be paid to the configuration and deployment of effective cloud infrastructure. An organization that designs, deploys, and effectively monitors a solid AWS technical infrastructure will be set up for success long into the future.
Written by Michael Nasser of punchlistzero.com