<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Winnie Kiragu</title>
    <description>The latest articles on DEV Community by Winnie Kiragu (@winnytroy).</description>
    <link>https://dev.to/winnytroy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1104310%2Ffbb6fddf-8a71-4770-8442-79b5c3ff9a62.jpeg</url>
      <title>DEV Community: Winnie Kiragu</title>
      <link>https://dev.to/winnytroy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/winnytroy"/>
    <language>en</language>
    <item>
      <title>Configuration management (CM); It's origin, equivalence and contrast to IaC.</title>
      <dc:creator>Winnie Kiragu</dc:creator>
      <pubDate>Mon, 23 Oct 2023 13:04:43 +0000</pubDate>
      <link>https://dev.to/winnytroy/configuration-management-cm-its-origin-equivalence-and-contrast-to-iac-3dl4</link>
      <guid>https://dev.to/winnytroy/configuration-management-cm-its-origin-equivalence-and-contrast-to-iac-3dl4</guid>
      <description>&lt;p&gt;Configuration management is a technique used to support high velocity development workflow by identifying and tracking individual configuration items.&lt;/p&gt;

&lt;p&gt;Automation really is the heart of configuration management, but CM revolves around treating the underlying infrastructure with exactly as much rigor and automation as we would treat the underlying application/service.&lt;/p&gt;

&lt;p&gt;Traditionally CM was implemented to oversee physical enterprise compute and storage and network hardware, today CM is typically implemented in the form of software tools that the organization uses to enforce a desired configuration state for each item and provide timely alerts of any configuration problems. &lt;/p&gt;

&lt;p&gt;However the approach should be broadened further to systems engineering and governance to embrace ever-advancing practices such as software-driven infrastructure and it can be codified in standardized frameworks for e.g ITIL.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is the ITIL Framework?
&lt;/h4&gt;

&lt;p&gt;If you've studied/worked in tech, then this must bring some &lt;em&gt;deja-vu&lt;/em&gt; ;&lt;br&gt;
if not, it's totally okay.&lt;/p&gt;

&lt;p&gt;ITIL v3 framework is a set of best practices, processes and procedures that organizations can use for digital service management by leveraging its adaptable models and procedures for continuous improvement to end-user services. It's recognized internationally for setting the standard for IT service delivery. &lt;/p&gt;

&lt;p&gt;The dimensions, pillars and gemstones of this framework I will leave unto you dear reader, but that may extend a bit outof this post. My intention was to showcase where Configuration Management evolved from.&lt;/p&gt;

&lt;p&gt;There are multiple ways how using the configuration management practice would benefit the organization. A few are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Quick provisioning of new compute hosts&lt;/li&gt;
&lt;li&gt;Centrally modify base configurations&lt;/li&gt;
&lt;li&gt;Version control for the compute host environments.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While this may sound in an essence like Infrastructure as code, its slightly different. Most times, the two could be used inter-changibly depending on the complexity of your infrastructure. But let's take a look at them abit more closely to see when you may need to use either.&lt;/p&gt;

&lt;h4&gt;
  
  
  Infrastructure-as-Code
&lt;/h4&gt;

&lt;p&gt;Infrastructure-as-Code is used to automatically create any service or system in the cloud or on-prem with code. Infrastructure-as-Software; which is somewhat similar to IaC in a way, is defining your infrastructure (either on cloud or on-prem) with a general-purpose programming language like Python or Go or with tools such as &lt;a href="https://sst.dev/"&gt;SST&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The key differentiator with Infrastructure-as-Code and the manual way of creating systems and services is that it's done by writing code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Comparison
&lt;/h4&gt;

&lt;p&gt;Infrastructure as Code (IaC) and Configuration Management are two related but distinct techniques used to manage IT infrastructure. Below are some similarities and differences between them:&lt;/p&gt;

&lt;h5&gt;
  
  
  Similarities:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;Both approaches aim to automate infrastructure management and reduce the manual effort required to provision, configure, and manage infrastructure resources.&lt;/li&gt;
&lt;li&gt;Both approaches rely on defining infrastructure resources and configurations as code, which can be version-controlled, tested, and deployed using automation tools.&lt;/li&gt;
&lt;li&gt;Both approaches help ensure consistency and reduce the risk of configuration drift, which can lead to performance and security issues.&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  Differences:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;IaC primarily focuses on automating the creation and management of infrastructure resources, such as virtual machines, storage, and networking. Configuration Management, on the other hand, focuses on enforcing consistent configurations across multiple servers and applications.&lt;/li&gt;
&lt;li&gt;IaC tools are typically used for cloud infrastructure, while Configuration Management tools can be used for managing both cloud and on-premises infrastructure.&lt;/li&gt;
&lt;li&gt;IaC is often used for defining infrastructure as part of the application development process, while Configuration Management is typically used for ongoing maintenance of the infrastructure.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, while both techniques differ in focus and scope. IaC is primarily used for automating infrastructure creation and management, while Configuration Management is focused on enforcing consistent configurations across infrastructure resources. &lt;/p&gt;

&lt;p&gt;But keep in mind that both approaches are uniquely important for managing stable, scalable, reliable, and secure infrastructure.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Monitoring in AWS</title>
      <dc:creator>Winnie Kiragu</dc:creator>
      <pubDate>Mon, 26 Jun 2023 12:29:14 +0000</pubDate>
      <link>https://dev.to/winnytroy/monitoring-in-aws-17nk</link>
      <guid>https://dev.to/winnytroy/monitoring-in-aws-17nk</guid>
      <description>&lt;h2&gt;
  
  
  Monitoring Containers in AWS
&lt;/h2&gt;

&lt;p&gt;Monitoring is crucial for all deployments as it lets you debug and gain a deeper understanding of the application you are trying to develop/maintain. This article is meant to help you get comfortable with logging/tracing on AWS for serverless infrastructure.&lt;/p&gt;

&lt;p&gt;For AWS serverless infrastructure like Lambda/App Runner, troubleshooting may be one of the most difficult tasks, especially for those coming from a more traditional VM-based development infrastructure as you cannot log on to the VM or docker images.&lt;/p&gt;

&lt;p&gt;There are several monitoring services that you can use that are easily integrated and managed depending on your use-case or application needs. While working with container workloads on AWS, one of the easiest ways to get started with monitoring is to leverage AWS monitoring tools. You can always use these third-party services. However, be cognisant that they do not increase the operational complexity for maintaining or deploying your application.&lt;/p&gt;

&lt;p&gt;To begin, let’s be in the know that AWS CloudWatch collects monitoring and operational data in the form of logs, traces and metrics.&lt;/p&gt;




&lt;p&gt;A) Logs&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogsConcepts.html"&gt;AWS documentation of log concepts&lt;/a&gt; cant be beat. They really do capture everything in a very easy to understand way. And as always, its best practice to always refer to the official documentation.&lt;/li&gt;
&lt;li&gt;Truthfully, the most difficult thing about navigating this is finding the particular cloudwatch group/stream. To ensure you dont get into this loophole, always ensure you label your log groups properly when creating them.&lt;/li&gt;
&lt;li&gt;Enabling logging through AWS Cloudwatch is automated for you if you are working with serverless infrastructure e.g ECS, EKS, Lambda or AWS App Runner. It's as simple as clicking on a checkbox to enable logging.&lt;/li&gt;
&lt;li&gt;Self managed infrastructure requires abit more configuration, but be sure to label the log groups to also distinguish log groups for your dev environments and for your prod environments.&lt;/li&gt;
&lt;li&gt;Tagging resources is also a great way to easily track the correct log groups, so review &lt;a href="https://docs.aws.amazon.com/whitepapers/latest/tagging-best-practices/tagging-best-practices.html"&gt;AWS documentation on tagging&lt;/a&gt; and evaluate if you may need to adapt anything in your current tagging processes.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;B) Traces&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A trace collects all the segments generated by a single request. That request is typically an HTTP GET or POST request that travels through a load balancer, hits your application code, and generates downstream calls to other AWS services or external web APIs.&lt;/li&gt;
&lt;li&gt;X-Ray is also located on the AWS Cloudwatch dashboard under the Xray traces tab.&lt;/li&gt;
&lt;li&gt;AWS X-Ray provides a visual map of successes and failures and lets you drill into individual traces for an execution and drill down into the details of how long each leg of the execution took.&lt;/li&gt;
&lt;li&gt;You can only view your application traces if you had enabled your application to collect this data. Dont be weary though, AWS Xray does not incur any additional fee or committment fee for either storage of these traces or for retrieving/viewing this data.&lt;/li&gt;
&lt;li&gt;The only downside is that as of now is that it is not able to to enable tracing in quite a few AWS services, but if you are setting up your infrastructure with AWS Lambda, this is something you may want to try out.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;C) Metrics&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A metric represents a time-ordered set of data points that are published to CloudWatch.&lt;/li&gt;
&lt;li&gt;Think of a metric as a variable to monitor, and the data points as representing the values of that variable over time. For example, the CPU usage of a particular EC2 instance is one metric provided by Amazon EC2.&lt;/li&gt;
&lt;li&gt;Metrics belong to namespaces ie Ec2, Lambda. What this means is that collected metrics are available in CloudWatch automatic dashboards, and also viewable in the Metrics section of the CloudWatch console. Within these dashboards, they are organized into namespaces. Check it out...lolz (see me trying to get you to log into AWS there...haha)&lt;/li&gt;
&lt;li&gt;I've mentioned something pretty cool here that I want to also talk more about; i.e CLoudwatch container insights.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;CloudWatch Container Insights&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CloudWatch Container Insights makes it easy to collect metrics like CPU, memory, disk, and network utilization, as well as log information, in &lt;strong&gt;&lt;em&gt;one centralized location&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;AWS documentation on &lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights.html"&gt;using container insights&lt;/a&gt; defines that this service can be used for your containerized applications and microservices, meaning this AWS functionality is easily integrated with AWS ECS, EKS, Lightsail, Lambda, App Runner and most recently Kubernetes platforms on EC2.&lt;/li&gt;
&lt;li&gt;The metrics that Container Insights collects are available in CloudWatch automatic dashboards, and also viewable in the Metrics section of the CloudWatch console.&lt;/li&gt;
&lt;li&gt;SO what's different here, If I can view the metrics on the metrics page too? - I know, it seems redundant, but the difference comes in the categorization....viewing metrics on the Metrics section categorizes these into namespaces i.e Lambda, Ec2, Lightsail, but for the metrics you view on the cloudwatch container insights section, you can view all metrics for all applications running in containers across the entire AWS services.&lt;/li&gt;
&lt;li&gt;What does that even mean, right? - In simple terms, If I wanted to evaluate all applications running in all my ECS clusters, instead of viewing each applications metrics individually, Container metrics allows me to pull up all of these stats in one place. There I can evaluate how applications are fairing with resources allocated to them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All this great, but how will Cloudwatch Container insights affect my wallet?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metrics that cloudWatch container insights collects are limited i.e it does not automatically create all possible metrics from the log data, however, you can view additional metrics and additional levels of granularity to your log data then use CloudWatch Logs Insights to analyze the raw performance log events.&lt;/li&gt;
&lt;li&gt;Be careful though as additional metrics collected by Container Insights are charged as custom metrics. Always make it a point to review  &lt;a href="https://aws.amazon.com/cloudwatch/pricing/"&gt;Amazon CloudWatch Pricing&lt;/a&gt; before committing to any additional service as good practice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please take a moment to go through Cloudwatch container Insights, but remember as with any other resource on AWS to decommission your resources after testing to avoid unnecessary costs.&lt;/p&gt;

&lt;p&gt;Feel free to go through these reference materials to familiarize yourself better with AWS Cloudwatch and its offerings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html"&gt;https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/reference/logs/index.html"&gt;https://docs.aws.amazon.com/cli/latest/reference/logs/index.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cloudwatch/latest/APIReference/Welcome.html"&gt;https://docs.aws.amazon.com/cloudwatch/latest/APIReference/Welcome.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are a few of the tools I have learnt to use within the AWS eco-system to monitor the containerized applications I deploy. Thankyou for getting to the end of this section of my blog.&lt;/p&gt;




&lt;h2&gt;
  
  
  Monitoring Databases in AWS
&lt;/h2&gt;

&lt;p&gt;RDS is one of the most expensive resources you can use within the aws eco-system. Especially if not managed right.&lt;/p&gt;

&lt;p&gt;I want to recap abit before I get into this second segment of monitoring to help you understand why I felt this necessary to add this segment here.&lt;/p&gt;

&lt;p&gt;What are the 3 AWS pricing principles? - compute, storage, and outbound data transfer. Go ahead google it....go on (lolz)&lt;/p&gt;

&lt;p&gt;So&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Every database we create by default incurrs costs.
- The more data we store in each of these databases(per GB), then the more we have to cough up to AWS for costs.
- Also let's be cognisant that every production database might have atleast 1 snapshot taken ,let's say once a month for this article, but we all know we take waaaaay more snapshots per month.
- These snapshots also incur costs, esp if the snapshot also holds alot of data just like the prod db.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;What I am trying to point out here is that we need to understand how our database is performing and re-evaluate allocated resources frequently also to avoid unneccessary costs.&lt;/p&gt;

&lt;p&gt;So let's expound on this abit more, shall we?&lt;/p&gt;

&lt;h4&gt;
  
  
  What to Monitor
&lt;/h4&gt;

&lt;p&gt;There are three different types of monitoring that can be captured here: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;service monitoring via CloudWatch,&lt;/li&gt;
&lt;li&gt;database monitoring via Performance Insights (also submitted to CloudWatch),&lt;/li&gt;
&lt;li&gt;OS monitoring with Enhanced Monitoring.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;RDS as a AWS service publishes different types of metrics to CloudWatch in this respect. These broken down can be looked at as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metrics for your DB instances, e.g., CPU utilization, the number of database connections, available memory, network throughput, and read latency.&lt;/li&gt;
&lt;li&gt;Performance Insights metrics, e.g., the number of active sessions for the database engine.&lt;/li&gt;
&lt;li&gt;Real-time data about the operating system on which the DB instances are run — more on this later.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Service Monitoring via CloudWatch
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;By default, RDS sends metrics to CloudWatch in one-minute intervals. These metrics are stored for 15 days, enabling you to run analytics for historical data to gain service performance insights.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To configure your RDS instance to log to Cloudwatch, there are some things you need to do on the AWS Management console. Kindly follow &lt;a href="https://www.youtube.com/watch?v=-9_Gat9cJn4"&gt;this&lt;/a&gt; aws tutorial to set this up.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Usage metrics for RDS service quotes in your AWS account, e.g., the total allocated storage of all your database instances or the number of instances itself.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Performance Insights - Monitoring Database Load
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;RDS’s default metrics only help you to visualize and analyze the general load on the database, but it does not provide you with detailed insights about the cause of the load for certain types of workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With Performance Insights, you’re able to filter loads in a very fine-grained manner, for example, by using SQL statements. This will help you to determine major contributors to heavy loads or bottlenecks affecting your service’s performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Performance Insights need to be enabled explicitly for your DB instance or Multi-AZ cluster. If you want to keep data collected by Performance Insights for longer than seven days, you’ll receive an additional charge.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Enhanced Monitoring - Monitoring Operation System
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;In addition to monitoring your database instances, you can also monitor the underlying operating system.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The major difference between the default CloudWatch monitoring and Enhanced Monitoring lies in the collection of metrics: Enhanced Monitoring directly collects statistics via an agent running on the DB instance instead of the hypervisor that creates and runs the virtual machines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced Monitoring collects a lot of additional metrics from the OS in real time. This is useful if you’re interested in the different processes or threads that are using the CPU.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An important fact here is that Enhanced Monitoring collects its metrics in CloudWatch logs. This means the data transfer and storage of CloudWatch Logs will increase, and you’ll receive an additional charge. Shorter monitoring intervals (meaning a higher frequency of monitoring) or a higher number of DB instances will increase pricing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now that we have an inkling on what you need to review for the RDS service, kindly make a point to go and check this out and adapt effectively.&lt;/p&gt;

&lt;p&gt;It's always a pleasure to learn and walk you through my thoughts. Kindly drop a comment if you have any other thoughts or questions.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>monitoring</category>
      <category>cloudwatch</category>
      <category>containers</category>
    </item>
    <item>
      <title>AWS CUR (Cost and Usage Reporting) for beginners</title>
      <dc:creator>Winnie Kiragu</dc:creator>
      <pubDate>Mon, 26 Jun 2023 10:06:26 +0000</pubDate>
      <link>https://dev.to/winnytroy/aws-cur-cost-and-usage-reporting-for-beginners-59mh</link>
      <guid>https://dev.to/winnytroy/aws-cur-cost-and-usage-reporting-for-beginners-59mh</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--topswZAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2dqufs4vao0wv3564co.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--topswZAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2dqufs4vao0wv3564co.jpeg" alt="ec2_to_poverty" width="225" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When anyone sees this image, they instinctively laugh because we have all heard the stories. We all know how cloud platform bills like AWS bills sky rocket because of the simplest things like not decommissioning an ec2 instance.&lt;/p&gt;

&lt;p&gt;While managing costs on cloud computing platforms is a topic on every person's mind, it's not really something everyone would want to get involved with. To be honest, when it comes down to overviewing this discussion, most would rather avoid it and cross their fingers hoping for the best.&lt;/p&gt;

&lt;p&gt;I'd like to debunk this fear in this article.&lt;/p&gt;

&lt;p&gt;Cost and Usage reporting is such a broad topic that you can never really find an article/blog that is very specific to your needs.&lt;br&gt;
This shouldnt dis-hearten you, on the contratry, you simply have to envision the journey with the following steps:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Understand your cloud expenditure.
2. Data collection and analysis on existing usage
3. Presentation of your report data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;These 3 steps sum up what you need to do. But when said like that, it can still appear like an uphill task for someone new to creating CURs (Cost and Usage Reports).&lt;/p&gt;

&lt;p&gt;Let's break these steps down a little further to de-mystify the whole process, shall we?&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Understand your cloud expenditure
&lt;/h2&gt;

&lt;p&gt;This can often be challenging, esp for individuals/organizations that do not have any kind of reporting procedures in place.&lt;/p&gt;

&lt;p&gt;Ultimately this goal can be simplified into understanding these 3 areas:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. How do you govern usage?
    - Are there specified individuals who can build cloud infrastructure?
    - Are there any existing policies/processes in place for this?
2. How do you monitor usage and cost?
3. How do you decommission resources?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;If your the one establishing this new culture, you may need to evaluate the 3 areas and set up strategies around the same. If an existing cost reporting culture already exists, then you may have gotten off on a less upill task.&lt;/p&gt;

&lt;p&gt;LIke with any discussion on policies and procedures, you may need to have a conversation with relevant project/product owners to gain better understanding on reources in use, resource creation policies and of course decommissioning policies.&lt;/p&gt;

&lt;p&gt;For readers of this article that need to build these processes and procedures from scratch, have a deeper look at how current operations handle the following:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Review existing tagging strategies, if any. Cost Allocation Tags (CATs) are crucial to understand here, if they do have any in place.
2. Review existing billing alerts, if any.
3. Review decommissioning policies, if any.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;If none of the above already exists, you may need to define these before you proceed. Ensure to build these out with relevant product owners as stated earlier in this article.&lt;/p&gt;

&lt;p&gt;To learn more about best practices when creating tags to your cloud resources, see &lt;a href="https://docs.aws.amazon.com/whitepapers/latest/tagging-best-practices/tagging-best-practices.html"&gt;AWS Tagging Strategies&lt;/a&gt;. Remember, the same strategies can be applied to other cloud platforms, not just AWS, but with slight tweaks here and there.&lt;/p&gt;

&lt;p&gt;Billing alerts and decommissioning policies creation are outside the scope of this article but also play a vital role in establishing an appropriate cost reporting culture within every organisation. Look them up tafadhali.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Data collection and analysis on existing usage
&lt;/h2&gt;

&lt;p&gt;So in the first step, we were doing a high level overview for how your particular org goes about reporting. But now we need to put values to these overviews.&lt;/p&gt;

&lt;p&gt;All cloud providers provide these figures to you a billing dashboard of some sort. You can always look these up according to your preferred cloud platform.&lt;/p&gt;

&lt;p&gt;Fetching this usage data from AWS, for example, can be done in 2 ways; UI Console/ or CLI (Command Line Interface)&lt;/p&gt;

&lt;p&gt;If you are working with multiple cloud providers, you will need to aggregate cost data from the different vendors. Same logic, just different user interfaces or CLI commands.&lt;/p&gt;
&lt;h3&gt;
  
  
  Via Console
&lt;/h3&gt;

&lt;p&gt;AWS, for example, provides to help you get started:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. AWS Cost and Usage Report feature.
2. AWS Cost explorer.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;They sound the same, but they are slightly different.&lt;/p&gt;

&lt;p&gt;AWS Cost and Usage Report(CUR) tracks AWS costs and usage at the &lt;em&gt;account or organization level&lt;/em&gt; by usage type, operation, and product code.&lt;/p&gt;

&lt;p&gt;To view cost and usage breakdown by &lt;em&gt;service&lt;/em&gt;, you can view the Cost Explorer tab and generate the same report by service for whichever stipulated timeline you would need this for.&lt;/p&gt;
&lt;h3&gt;
  
  
  Via CLI
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;aws ce&lt;/code&gt; command with the appropriate directives returns your data easily. For e.g&lt;/p&gt;

&lt;p&gt;To get the daily expenses for the last X days&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ce get-cost-and-usage \
    --time-period Start=$(date +"%Y-%m-%d" --date="-240 hours"),End=$(date +"%Y-%m-%d") \
    --granularity=DAILY \
    --metrics BlendedCost UnblendedCost \
    --query "ResultsByTime[].[TimePeriod.Start, Total.BlendedCost.[Amount][0], Total.BlendedCost.[Unit][0]]" \
    --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get monthly expenses for the AWS Account&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ce get-cost-and-usage \
    --time-period Start=2023-01-01,End=2023-06-01 \
    --granularity MONTHLY \
    --metrics "BlendedCost" "UnblendedCost" "UsageQuantity"\
    --query "ResultsByTime[].[TimePeriod.Start, Total.BlendedCost.[Amount][0], Total.UnblendedCost.[Amount][0], Total.UsageQuantity.[Amount][0], Total.BlendedCost.[Unit][0]]" \
    --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two alternatives will give you an easy way to acquire the usage data you need to get started on analysis.&lt;/p&gt;

&lt;p&gt;For this, no amount of explaining will help you understand/ get a visual of what I'm saying. You just have to get your hands dirty and explore how to fetch this information from your preferred cloud provider and how to analyse the information you receive in turn. &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Presentation of your report data
&lt;/h2&gt;

&lt;p&gt;AWS documentation states that a good Cost and Usage report should offer a comprehensive details on the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metadata about AWS services,&lt;/li&gt;
&lt;li&gt;Credit,&lt;/li&gt;
&lt;li&gt;Pricing,&lt;/li&gt;
&lt;li&gt;Fees,&lt;/li&gt;
&lt;li&gt;Discounts,&lt;/li&gt;
&lt;li&gt;Taxes,&lt;/li&gt;
&lt;li&gt;Cost categories,&lt;/li&gt;
&lt;li&gt;Savings Plans&lt;/li&gt;
&lt;li&gt;Reserved Instances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But this should not get you tripping. You can always start with a simple report containing the following columns:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service in Use&lt;/th&gt;
&lt;th&gt;Spenditure category&lt;/th&gt;
&lt;th&gt;Credits&lt;/th&gt;
&lt;th&gt;Taxes&lt;/th&gt;
&lt;th&gt;Saving Opportunities&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;RDS&lt;/td&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EC2&lt;/td&gt;
&lt;td&gt;Compute&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EKS&lt;/td&gt;
&lt;td&gt;Outbount transfer&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ECS&lt;/td&gt;
&lt;td&gt;Outbount transfer&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;N.B&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The level of detail and granularity in cost and usage reporting and monitoring is dependant on your target audience, so always start simple and build according to feedback you receive from your team.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The segment detailing Saving Opportunities is also an important aspect to include in these discussions with your team, so it is essential to make room for this on the report, even if you have nothing on this segment when you are presenting the report, as this will help you easily remember this during your meeting.&lt;/p&gt;

&lt;p&gt;Some terminologies you may need to know when working with AWS Billings are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Blended costs&lt;/code&gt; - Blended costs are calculated by multiplying each account’s service usage against something called a blended rate. A blended rate is the average rate of on-demand usage, as well as Savings Plans- and reservation-related usage, that is consumed by member accounts in an organization for a particular service. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Unblended costs&lt;/code&gt; - Unblended costs represent your usage costs on the day they are charged to you.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Amortized costs&lt;/code&gt; - Amortized costs are a powerful tool if you seek to gain insight into the effective daily costs associated with your reservation portfolio or are looking for an easy way to normalize cost and usage information when operating at scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As always refer to &lt;a href="https://aws.amazon.com/blogs/aws-cloud-financial-management/understanding-your-aws-cost-datasets-a-cheat-sheet/"&gt;aws documentation on costs&lt;/a&gt; for reference. Other cloud providers may have different terminologies, so get familiar with those as well.&lt;/p&gt;

&lt;p&gt;Lastly, a Cost and Usage report may be needed weekly/monthly, so you can easily automate this process by building a simple REST API application and leveraging the AWS command line. I personally think that is a great next project for anyone who has gotten this far in myblog, don't you reader?&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloud</category>
      <category>cloudskills</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
