<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anders Bjørnestad on Medium]]></title>
        <description><![CDATA[Stories by Anders Bjørnestad on Medium]]></description>
        <link>https://medium.com/@abjoerne?source=rss-cbea9e8939d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bZOzhp2jWoPGWft-OYTmdg.jpeg</url>
            <title>Stories by Anders Bjørnestad on Medium</title>
            <link>https://medium.com/@abjoerne?source=rss-cbea9e8939d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:37:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abjoerne/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Manage your custom Billing Views as code]]></title>
            <link>https://abjoerne.medium.com/manage-your-custom-billing-views-as-code-5fb92e98672f?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fb92e98672f</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cost-management]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 11:03:01 GMT</pubDate>
            <atom:updated>2025-04-07T11:03:01.113Z</atom:updated>
            <content:encoded><![CDATA[<p>The <em>custom billing view</em> was <a href="https://aws.amazon.com/blogs/aws-cloud-financial-management/introducing-custom-billing-views-tailored-cost-and-usage-view-relevant-for-your-stakeholders/">introduced by AWS back in December 2024</a>, but still a lot of customers have not discovered it. Make sure to take a look if this is new to you and your teams care about the AWS bill.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8rts9C-pVNFiS4xmfquJpA.png" /></figure><h3>Background</h3><p>Earlier the billing view in AWS was only visible for two different areas, single account view and organizational view (all accounts in an AWS organization). That goes for both the dashoboard as well as the cost explorer. You could filter on accounts in the cost explorer, but that required access to the management account.</p><h3>Custom billing views are here</h3><p>This new feature let us create and share separate views for different purposes. This is a very noce feature in an environment where you for example have different accounts for different teams and environments.</p><p>A custom billing view contain a dashboard and cost-explorer with access to what you define for that view. You can create views (in the management account) which are either account-based or cost-tag-based filters, and they look like this (with a selector in the upper left corner).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*v3-kTneUXaB0I_EY.png" /></figure><p>After creating a view you can share it with one or more AWS accounts within your organization. This sharing is done with RAM (Resource Access Manager)</p><h3>Managing billing views with CLI</h3><p>Because we do not want to do click-ops, we need a way to automate this. Here we can use the AWS CLI.</p><p>Let us have some variables to make things easier:</p><ul><li>$teamName = name of team</li><li>$teamAccounts = account(s) where the team view their billingdata (example &quot;123456789012 123456789999&quot;)</li><li>$dataFilter = list of accounts to include in the report, for example dev, stage and prod accounts. The dataFilter must be on the following format</li></ul><pre>{<br>  &quot;dimensions&quot;: {<br>    &quot;key&quot;: &quot;LINKED_ACCOUNT&quot;,<br>    &quot;values&quot;: [<br>      &quot;123456789012&quot;,<br>      &quot;210987654321&quot;,<br>      &quot;121314151616&quot;<br>    ]<br>  }<br>}</pre><h3>Create a view</h3><p>Here we create a view and keep the ARN in a variable for later use</p><p>billingviewARN=$(aws billing create-billing-view --name &#39;$teamName&#39; --source-views arn:aws:billing::123456789012:billingview/primary --data-filter-expression $dataFilter --query arn)<br>Note that a billing-view need a &quot;parent&quot; view, which has to be primary</p><p>A billing-view can also be tagged, and the tag can be <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsbilling.html#awsbilling-actions-as-permissions">used in a policy</a> if you like to restrict access to a view.</p><h3>Share the view with one or more accounts</h3><p>For sharing the billing-view with one or more accounts, a persmisson policy is required — for billingview you use <br> arn:aws:ram::aws:permission/AWSRAMDefaultPermissionBillingView<br>If you like to alter the permissions yourself you can also make your own policy in RAM.</p><p>Sharing is done like this:<br> aws --region us-east-1 ram create-resource-share --name &quot;$teamName&quot; --resource-arns $billingviewARN --principals $teamAccounts --permission-arns arn:aws:ram::aws:permission/AWSRAMDefaultPermissionBillingView --no-allow-external-principals</p><p>To avoid shareing with external account I use no-allow-external-principals. This specifies that principals outside your organization can not be associated with this resource share.</p><p><strong>IMPORTANT</strong> Everything related to billing is in us-east-1 so make sure you use the CLI with the correct region when using RAM</p><h3>Summary</h3><p>You should now be able to automate the creation and sharing of custom billing views in your AWS organization. This is much more scalable if you have multiple teams, and you add a script to the on-baording-process. Let the cost be visible to different teams so each team can be better equiped to keep the cost down.</p><p>References:</p><ul><li>AWS CLI billing <a href="https://awscli.amazonaws.com/v2/documentation/api/latest/reference/billing/index.html#cli-aws-billing">https://awscli.amazonaws.com/v2/documentation/api/latest/reference/billing/index.html#cli-aws-billing</a></li><li>AWS CLI RAM <a href="https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ram/index.html#cli-aws-ram">https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ram/index.html#cli-aws-ram</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fb92e98672f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS price and cost — multi account setup]]></title>
            <link>https://abjoerne.medium.com/aws-price-and-cost-multi-account-setup-754966723049?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/754966723049</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Wed, 28 Sep 2022 10:02:26 GMT</pubDate>
            <atom:updated>2022-10-03T06:44:33.228Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS price and cost — multi account setup</h3><p>(This is part 4 of a series of blog posts related to pricing and cost in AWS.)</p><p>In the first three blog posts I have looked into how AWS price and cost relates to a single AWS account. But what if we start using multiple accounts? Will we get a lot of invoices, and will it be very complex to have an overview? The simple answer is no — there are tools and features helping you deal with this.</p><h3>Multiple accounts</h3><p>If you are deploying a little bit more than a small service on AWS, it is often recommended to use multiple AWS-accounts to separate different environments, workloads, access control and more. This makes it more complex to have control on your cost, and will for some also result in multiple AWS invoices unless you use some more advanced services like AWS Organizations.</p><figure><img alt="AWS Organizations illustrated" src="https://cdn-images-1.medium.com/max/1024/0*J9plSQF6I0W8-mIS" /><figcaption>(Illustration from <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html">AWS organizations documentation</a>)</figcaption></figure><p>In addition to simplifying management of your AWS accounts in general, AWS Organizations is also simplifying the cost control by offering consolidated billing for all your accounts. This means that you get a combined invoice (or multiple invoices — see <a href="https://medium.com/webstep/aws-price-and-cost-billing-35b0954a2aff">blog part 2</a>) covering all accounts that are part of the Organization.</p><p>In the following sections I will highlight some of the tools and features mentioned in <a href="https://medium.com/webstep/aws-price-and-cost-billing-35b0954a2aff">part 2</a> and <a href="https://abjoerne.medium.com/graph-on-a-saws-price-and-cost-analysing-and-monitoring-479fb860843f">part 3</a> and how they work when you are using consolidated billing.</p><h3>Consolidated billing</h3><p>If you have multiple accounts within your organisation you should definitely look into AWS Organizations from a cost and billing perspective. When setting up AWS Organizations you need to designate one of your accounts as your management account. I would highly recommend to spin up a brand new account and use that as a starting point. Do not use an existing account for this, as it will probably bite you later. In addition to a lot of other features, your management account will be the one account controlling the invoices and other billing-related features for all your accounts within your Organization. The following description is based on my experiences in Europe — you might see variations around invoices and tax in other regions like the US or India. Please refer to the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/consolidated-billing.html">documentation</a> for regional details.</p><h3><strong>Payments, invoicing and billing</strong></h3><p>Payments work the same way as you are used to in a single account. As you grow, the spend is increasing, so it might be worth checking if you are eligible to opt in to a regular PDF-invoice from AWS to avoid charging your credit card.</p><p>In general the invoices will look more or less the same as the single account use case. in the management account you will see the invoices broken down by services, and by account. You will also have an “per account view” in the billing console of the management account. Each individual account will only see their own spend in the console, but they will not see any invoices.</p><figure><img alt="Screen shot of Billing console" src="https://cdn-images-1.medium.com/max/1017/0*hL1cBdnjoNVkvASj" /><figcaption>Billing console view</figcaption></figure><h3><strong>Adding, removing and moving accounts</strong></h3><p>Accounts can be created/added to an organisation and deleted or removed from an organisation at any time. The main rule is that the change in the way billing behaves is following the time the membership status was changed. So if an account is added to AWS organizations on the 10th of the month all spend up until that point will be billed to the individual account. The spend from that point in time and onwards will be within the organisation billing cycle.</p><p>Have in mind that if you move an account from one organisation to another you can see that you get a small invoice for the amount of time the account is in transition. If adding or moving accounts, remember to check for any individual invoices linked directly to the account in question at the end of the month to avoid surprises.</p><h3><strong>Tax settings</strong></h3><p>Tax settings can be managed from the management account by turning on “tax inheritance”. If you have a lot of different tax settings, you can edit individual account tax settings from the management account. Remember to review this when you start using AWS Organizations. Note that if you have tax inheritance enabled, and turn it off, settings on all accounts will revert to the values they were before you enabled the feature.</p><h3><strong>Volume discount and free tiers</strong></h3><p>From <a href="https://medium.com/webstep/aws-price-and-cost-introduction-73b7957e8321">part 1</a> you might remember the volume/request based pricing. Some AWS services have a tiered pricing model where you get a discount as usage grows. For example as your volume on S3 grows, you can get a lower price. Data transfer pricing is also priced like this. When AWS is generating a bill for your organisation, all the usage is added before they calculate the cost. This means that if each of your accounts have less than 50TB of data is S3, but the total is more than 50TB, the discount above 50TB will be applied. This is a benefit when using AWS Organizations and you have a lot of accounts.</p><p>One difference to have in mind when setting up an organisation are the free tiers, which is a minor drawback. As you might know from <a href="https://medium.com/webstep/aws-price-and-cost-introduction-73b7957e8321">part 1</a> there are three types of free tier, and these are handled different when you use AWS Organizations:</p><ul><li><strong>First 12 months free: </strong>The 12 months are counted from the first day the <em>management</em> account is created.</li><li><strong>Free trials</strong>: Only one account within the organisation can benefit from the Free Tier offers, so the first account to start using a new service with free trials, will benefit from that</li><li><strong>Alway free:</strong> There is only one free tier per organisation, so one free usage quota is applied at the organisational level. (You do not get more free usage by adding more accounts)</li></ul><h3><strong>Credits</strong></h3><p>In AWS Organizations you decide how AWS credits will be handled, and you have two options; credit sharing or no credit sharing.</p><ul><li><em>Credit sharing:</em> Credits are shared across the entire organisation regardless of which account they are added to and where the spend is.</li><li><em>No credit sharing:</em> Credits are used only on the account where the credit code is added.</li></ul><p>The setting for credit sharing is under Billing Preferences in the billing console. For most customers, enabling this is the natural choice to be able to add credits to the entire organisation. If you do not share credits, you can end up with unused credits in an account because your spending is too low.</p><p>NOTE: If you add or remove accounts during a month, credits for that account are handled in different ways that month — see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilling-credits.html#credits-for-orgs">documentation</a> for details.</p><h3><strong>Reservations and Compute Savings Plans</strong></h3><p>Instance Reservations and Compute Savings Plans has not been discussed in detail here, but was mentioned briefly in &lt;&lt;part 1&gt;&gt; under <em>Discounts</em>. A huge benefit with AWS Organizations is the option to consolidate instance reservations and compute saving plans. Sharing these across the organisation is almost like credit sharing, with the exception that you can have a pool of accounts that do not share Reservations and Savings Plans. You can also opt out of this for all new accounts if needed (default is opt in).</p><p>The advantage in larger organisations is that you can optimise reserved instances and also benefit from Compute Savings Plans across your entire organisation. This makes it easier to get a good utilisation of those benefits.</p><figure><img alt="Screen showing Discount sharing setup in the Billing console" src="https://cdn-images-1.medium.com/max/930/0*mXknBSq-7F8aBryb" /><figcaption>Discount sharing setup in the Billing console</figcaption></figure><h3><strong>Cost explorer, budgets and anomaly detection</strong></h3><p>Cost explorer, budgets and anomaly detection works as earlier in the individual accounts. In the management you will see all costs for the entire organisation in the cost explorer and you can also drill down and filter on individual accounts. You can create budgets for single accounts or for a group of accounts, and anomaly detection will tell you in which account(s) there is an anomaly. Have in mind that the cost for each account might not be accurate as discounts across the entire organisation have not been applied. (In other words, the cost you see might be a bit higher that what the invoice will show)</p><h3><strong>Cost and Usage Report (CUR)</strong></h3><p>Cost and Usage (CUR) reports work the same way in the individual accounts inside and outside AWS Organizations. Also creation of CUR is the same in all account types. The difference is that in the management account is that you get a complete view of all accounts and you might sometimes see discounts applied on the organisational level and not on individual accounts. If you are using CUR to see exact costs across your organisation and on individual accounts, you should read the documentation for <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/consolidated-billing.html">Consolidated Billing</a> and <a href="https://docs.aws.amazon.com/cur/latest/userguide/data-dictionary.html">CUR</a> to get everything correct. This is especially important when it comes to handling discounts, reservations, etc. across all accounts.</p><p>For CUR, Cost Explorer and more tools AWS operates with “blended rate/cost” and “unblended rate/cost”. The unblended rate/cost is the rate/cost associated with an individual account’s service usage. The blended rate/cost is the average rate/cost incurred for each product across an organisation (takes total volume discount/reservations into account).</p><h3><strong>Support</strong></h3><p>AWS Support is charged as a variable cost based on your monthly AWS charge. The support plan and cost is individual to your account(s) and the charge is based on spend on the individual account. So if you have a support-plan on your management account, only the AWS charge for the management account is used when calculating your support cost for that account (not the charge on the entire organisation).</p><h3><strong>Summary</strong></h3><p>Below you can see a table with a short summary of the differences between singel account usage and AWS Organizations</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78bfa95c4f31722b62537ee7f28a5555/href">https://medium.com/media/78bfa95c4f31722b62537ee7f28a5555/href</a></iframe><p>Pricing, cost and invoicing works very well when you have multiple AWS accounts and you are using AWS Organizations. Each account has insights into its own spend, and the management account can monitor all spend across all accounts.</p><p>Just remember a few things:</p><ul><li>When starting with AWS Organizations — use a fresh new account as the management account.</li><li>Consider enabling credit sharing.</li><li>Update the tax-settings and inheritance for the organisation.</li><li>Use CUR in the management account if you need to create some accounting statements for splitting cost or your own BI-tool for analysing the cost.</li></ul><p>Unfortunately for those getting their AWS invoice through a third party provider, access to AWS Organizations and some billing-tools might be limited or replaced by tools provided by the services provider. This is currently a limitation from AWS which I personally hope will be solved in the future.</p><p><em>The content in this blog-post series “AWS price and cost” is based on the main topics I am facing at AWS customer sites and doing AWS training.</em></p><ul><li><em>Part 1 — </em><a href="https://medium.com/webstep/aws-price-and-cost-introduction-73b7957e8321"><em>Introduction</em></a></li><li><em>Part 2 — </em><a href="https://medium.com/webstep/aws-price-and-cost-billing-35b0954a2aff"><em>Billing</em></a></li><li><em>Part 3 — </em><a href="https://abjoerne.medium.com/graph-on-a-saws-price-and-cost-analysing-and-monitoring-479fb860843f"><em>Analysing and monitoring</em></a></li></ul><p><em>Next blog posts will cover more advanced topics and tools related to Price and Cost.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=754966723049" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS price and cost — analysing and monitoring]]></title>
            <link>https://abjoerne.medium.com/graph-on-a-saws-price-and-cost-analysing-and-monitoring-479fb860843f?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/479fb860843f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Thu, 22 Sep 2022 04:02:23 GMT</pubDate>
            <atom:updated>2022-10-03T06:44:17.421Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS price and cost — analysing and monitoring</h3><p>(This is part 3 of a series of blog posts related to pricing and cost in AWS.)</p><p>You are up and running on AWS, and the bills are trickling in (and money out). Now it is time to start being proactive about spending, as a bad design or bugs in your programs could lead to significant increase in spend. To be able to have a proactive approach to billing you need to monitor and analyse your usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hyun-wKtwSo_qVLORkzJjA.png" /><figcaption>(Photo by <a href="https://unsplash.com/@markuswinkler">Markus Winkler</a> on Unsplash)</figcaption></figure><h3>Analysing your usage with Cost Explorer (CE)</h3><p>The <a href="https://us-east-1.console.aws.amazon.com/billing/home?region=eu-west-1">billing dashboard</a> (which got a new design in June 2022) should be your first place to look for up to date information on spend. Here you will find an overview and access to details in your bill.</p><figure><img alt="Screenshot of billing dashboard" src="https://cdn-images-1.medium.com/max/1024/0*T_xBNm38hk8bWaxI" /><figcaption>AWS billing dash board</figcaption></figure><p>When you need to dive into more details, <a href="https://us-east-1.console.aws.amazon.com/cost-management/home">Cost Explorer</a> is the place to go next. In Cost Explorer you have some pre-build views of your spend, and you can also create and save your own views.</p><p>Cost explorer is an interactive tool where you can drill down into extreme details, split cost into groups and include/exclude services and other fees.</p><figure><img alt="Cost Explorer screen" src="https://cdn-images-1.medium.com/max/1024/0*qpanLHdLmrE3JwNg" /><figcaption>Cost explorer — cost by service</figcaption></figure><p>When you are analysing your cost one of the important features is the <em>“Group by”</em> feature. Note however that you can only group by one dimension.</p><p>The filters on the right is a very good tool to exclude things you do not need to look into, or include the thing you like to investigate. There are some filters I recommend you add to avoid noise and clutter in your report if you are investigating regular service usage.</p><p>Have a look at the following graph — what is going on here?</p><figure><img alt="Cost explorer screen" src="https://cdn-images-1.medium.com/max/1024/0*rNsAxjLeCQifmHFx" /><figcaption>Cost explorer — cost by day</figcaption></figure><p>The high “cost” on August 1st is actually tax, which is applied after the previous month has been calculated. This is irrelevant in most cases. The missing part in September is because we got some service-credits being subtracted from our usage so the total is 0 (zero). If you are using the cost explorer to investigate spend related to usage, use the filter and only include <em>“Usage”</em> to avoid random financial transactions. Other random transactions might be discounts, one-time-fees, up front one-time payments, etc.</p><figure><img alt="Cost explorer with filters" src="https://cdn-images-1.medium.com/max/1024/0*sY33aVX59MgHqSOU" /><figcaption>Cost explorer — cost by day with filters</figcaption></figure><p>If you are not using the group by function, you can get a forecast for the upcoming days or months. This forecast is based on previous usage and is also depending on your filter settings of course, so remember to remove irregular transactions.</p><figure><img alt="Cost Explorer forecast" src="https://cdn-images-1.medium.com/max/1024/0*G4FbdD4JPdy4FGWz" /><figcaption>Cost explorer — forecast</figcaption></figure><p>Cost explorer also lets you save reports you have created, and it also has an API if you like to get data programmatically.</p><h3>Analysing your invoice with Cost and Usage Report (CUR)</h3><p>If you like to analyse your invoice in detail or understand all aspects and details about your spend and billing, you can get the underlying billing data delivered into an S3-bucket at regular intervals. Have in mind that this can be a huge amount of data as you can get one item (record) of information per resource per hour. You can get it in Apache Parquet format, or CSV (ZIP/gzip).</p><figure><img alt="Cost and Usage Report setup" src="https://cdn-images-1.medium.com/max/765/0*nuqGBhDGbg9CPH4V" /><figcaption>Configuration of Cost and Usage Report</figcaption></figure><p><a href="https://us-east-1.console.aws.amazon.com/billing/home?region=eu-west-1#/reports">This feature</a> is for more advanced users of AWS, but is sometimes nice to look into to really understand how billing is done if you want to dive deep into the details.</p><h3>Monitoring and alarms with budgets</h3><p>Another important aspect is to monitor for costs that you really do not need. This can be related to services you are not using, regions you are not using, or simply someone else obtaining access to your account and spinning up some workloads.</p><p><a href="https://us-east-1.console.aws.amazon.com/billing/home?region=eu-west-1#/budgets/overview">Budgets</a> are a nice way to both get alerts about your current spending, as well as the forecasted total in the current month. There are different types of budget, and I will focus on <em>“Cost budget”</em> here. A budget can be daily, monthly, quarterly or annually. Personally I prefer monthly, as it aligns well with the AWS invoices and are easy to track and relate to.</p><p>When you set up a budget you can set up the same fixed amount for every period (in my examples I use monthly), you can add different numbers to your budget from month to month, or the budget can auto adjust based on previous period(s).</p><figure><img alt="Budget screen" src="https://cdn-images-1.medium.com/max/872/0*RzvvZv1MhHeVDw_Z" /><figcaption>Different amount for each month. Increase by 5%</figcaption></figure><p>If you like, you can create a filter and only set up a budget for some services, regions, etc. Then under <em>“advanced options”</em> you can add/remove different charges. As mentioned earlier you would normally not create a budget looking at for example discount, taxes and credits as they will make the budgeting harder.</p><p>Next step is to add alarm(s). Then you would need to think about when and how to be notified. Add a trigger on actual or forecasted spend. In many cases I prefer forecasted to be notified as early as possible. AWS is making a forecast when the month starts and adjusts it continuously.</p><figure><img alt="Budget alarm trigger" src="https://cdn-images-1.medium.com/max/802/0*jeW5EfESafcUNSCI" /><figcaption>Budget alarm trigger</figcaption></figure><p>You can add multiple alarms, so if you also like to get notified when the actual spend is for example 100% of the budget, you can easily add that too. Each alarm can have a separate notification-list, and notifications can be sent via email, to SNS and to the Amazon Chatbot (Slack and Amazon Chime). The more advanced users can also stop an EC2 or RDS-instance when an alarm is triggered.</p><p>In the example above I made a budget to keep track of cost on our production workload, but you can also use budgets to monitor for usage you do not want to happen. In my case I am not using regions outside the US and EU, so I create an almost zero budget for the regions I am not using. In that way I can get a notification if someone is starting to use services in those regions, intentionally or not.</p><figure><img alt="A zero-budget for monitoring unwanted activity" src="https://cdn-images-1.medium.com/max/674/0*pL4T1cDmoP4qe6MV" /><figcaption>An almost zero-budget for monitoring unwanted activity in non-used regions</figcaption></figure><p><strong>NOTE!</strong> AWS does not have any other ready made solution to stop/terminate/remove services/content when you reach your budget than stopping EC2 or RDS instances. It is of course possible to automate such features, but be very careful if doing so. It might be hard to test, and you might be in for surprises when your entire S3-bucket is suddenly emptied.</p><h3>Cost Anomaly detection</h3><p>When your usage grows with multiple services and perhaps in multiple regions it is very hard to spot changes that are relatively small compared to your current spend by using the budgets and other reports. This is when Cost Anomaly detection comes into play. This feature will spot unusual changes in spend compared to your historical spend and alert you when it happens.</p><p>You can find Cost Anomaly detection in the <a href="https://us-east-1.console.aws.amazon.com/cost-management/home#/dashboard">Cost Management Console</a> where you also have a dashboard listing the activities found.</p><figure><img alt="Anpmaly detetction screen" src="https://cdn-images-1.medium.com/max/1024/0*kVneuVlevjCuDNLu" /><figcaption>Cost Anomaly Dashboard</figcaption></figure><p>You must first create a monitor and there are four different options. Let us start with “AWS services” which is the easiest one. After that you set up where your alerts should go. Daily and weekly alerts are sent via email, while individual alerts are published on SNS. My suggestion is to start with daily alerts to see how it works.</p><figure><img alt="Sample Cost Anomaly email alert" src="https://cdn-images-1.medium.com/max/1024/0*EAz3HWKvzN6Ibbvm" /><figcaption>Cost Anomaly email alert</figcaption></figure><p>It is also possible to set up SNS as a subscriber if you like to automate the actions yourself.</p><h3>Summary</h3><p>It is important to keep an eye on the cost in your AWS-account. In this part we looked at Cost explorer which is a good tool for drilling down into the cost. Budgets and Cost Anomaly detection are tools for getting alerted when you cross defined thresholds. When looking at cost, remember to filter out factors that are not directly related to your running services like tax, one-time-fees, AWS credits etc.</p><p>—</p><p><em>The content in this blog-post series “AWS price and cost” is based on the main topics I am facing at AWS customer sites and doing AWS training.</em></p><ul><li><em>Part 1 —</em><a href="https://medium.com/webstep/aws-price-and-cost-introduction-73b7957e8321"><em> Introduction</em></a></li><li><em>Part 2 —</em><a href="https://medium.com/webstep/aws-price-and-cost-billing-35b0954a2aff"><em> Billing</em></a></li><li><em>Part 4 — </em><a href="https://abjoerne.medium.com/aws-price-and-cost-multi-account-setup-754966723049"><em>Multi account</em></a></li></ul><p><em>Next blogposts will cover more advanced topics and tools related to Price and Cost.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=479fb860843f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS price and cost — billing]]></title>
            <link>https://abjoerne.medium.com/aws-price-and-cost-billing-35b0954a2aff?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/35b0954a2aff</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Mon, 19 Sep 2022 12:25:28 GMT</pubDate>
            <atom:updated>2022-09-28T15:13:52.498Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS price and cost — billing</h3><p>(This is part 2 of a series of blog posts related to pricing and cost in AWS.)</p><p>Using AWS-services most likely means that you have to pay for them, or at least relate to the cost of using them (see <a href="https://abjoerne.medium.com/aws-price-and-cost-introduction-73b7957e8321">part 1</a> for intro to cost). AWS invoices customers on a monthly basis based on the usage last month. The billing-cycle follows UTC and starts at the first second of the month, and AWS issues an invoice which you will have to pay.</p><h3><strong>Payments</strong></h3><p>For new AWS accounts there are in general only one way to pay your bill; you will have to add a credit card to your account.</p><figure><img alt="Creditcard on keyboard" src="https://cdn-images-1.medium.com/max/1024/0*7CEDJSpK6GrNdEhk" /><figcaption>(Photo by CardMapr.nl on <a href="https://unsplash.com/@cardmapr">Unsplash</a>)</figcaption></figure><p>Another option - if you are an established business - is to find an AWS-partner which can act as a reseller/proxy for you, and then you can get your AWS-invoice through them instead.</p><p>If you are using your credit card and have been running for some time, and your spend is growing from small to medium to large, you <em>might</em> be eligible to pay the invoice by bank (wire transfer) or by direct debit. Check the <a href="https://docs.aws.amazon.com/account-billing/index.html">documentation</a> for direct debit and talk to your AWS account-manager about wire-transfer.</p><p>USD is the default currency for the invoices. If you prefer you can switch to another supported currency. Note that this setting is in the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-account-payment.html#manage-account-payment-change-currency">“accounts”-page</a>, not on the billing page.</p><p>The invoice will show all details in USD as well as the exchange rate and totals. The totals and the amount to pay will be in your chosen currency. The rate used is Amazon’s own rate at the time of invoicing, and might be the same or even better than your credit card company’s rate. You also can check today’s rate in the console when you switch currency if you would like to compare.</p><h3><strong>Invoices</strong></h3><p>AWS operates globally, which means they also have a lot of legal entities. Normally you will get one invoice from a “regional” AWS company for your usage. I am getting mine from Amazon Web Services EMEA SARL (AWS Europe). For some services AWS will issue a separate invoice from another company like Amazon Web Services Inc. (AWS Inc.). This has no big impact to you, except that you will have multiple payments and invoices and not one for each month.</p><p>AWS invoices are visible and possible to download in the console. You can also get them via email as soon as they are ready at the start of each month (normally during day 2–4 of the month). Set up email-alerts (with or without PDF from day one) — see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/emailed-invoice.html">documentation</a>.</p><p>Depending on your location and account settings you will get a legal VAT-invoice from AWS, which you can use in your accounting system. One important thing to remember is to set the correct tax information <a href="https://us-east-1.console.aws.amazon.com/billing/home?region=eu-west-1#/tax">in your account</a> from the start. This can save you (or your accountant) some work with reversed VAT later. If you do not add tax info, AWS will collect the local sales tax in your country and you will have to sort things out later.</p><figure><img alt="Sample AWS invoice" src="https://cdn-images-1.medium.com/max/843/0*t8SCKyCA_XSv8NGC" /><figcaption>(Sample: Invoice in NOK from AWS Europe payable by bank)</figcaption></figure><p>In the billing console you also have a page with payments due, payment transactions etc.</p><h3><strong>Understanding your bill</strong></h3><p>Spend some time reading your bill in the console or in the PDF. The invoice is detailed and split down on services, regions and features. It also show you the amount consumed (time and/or volume) like hours, requests, etc.</p><figure><img alt="Sample AWS bill" src="https://cdn-images-1.medium.com/max/1024/0*EVi_8Fy9v1lD-7US" /></figure><p>In the console you will get an almost up to date view of your spend during the month. Remember that tax, discounts and service credits are also added to the invoice, making it a bit harder to compare your usage from month to month. AWS Credits are normally added under each service so your bill will read only “0” until you expand the service-lines.</p><p>I highly recommend looking at the monthly bills to understand which parts of your architecture that might be cost drivers, and also to spot potential savings and spot unexpected changes/anomalies in cost.</p><p>If you need to correlate AWS cost with purchase orders, AWS has a feature in the billing console to facilitate this. Check the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-purchaseorders.html">documentation</a> for more details.</p><h3><strong>Summary</strong></h3><p>In part one we talked about the pricing of services, in this part we have talked about the basics of billing and payments. There are different ways to pay your bill depending on your spend, and also a lot of information about your resources to be found in the bills. Set the correct tax-information on your account and have in mind that you might get more than one invoice per month.</p><p>—</p><p><strong><em>The content in this blog-post series is based on the main topics I am facing at AWS customer sites and doing AWS training.</em></strong></p><ul><li><em>Part 1 — </em><a href="https://medium.com/webstep/aws-price-and-cost-introduction-73b7957e8321"><em>Introduction</em></a></li><li><em>Part 3— </em><a href="https://abjoerne.medium.com/graph-on-a-saws-price-and-cost-analysing-and-monitoring-479fb860843f"><em>Analysing and monitoring</em></a></li><li><em>Part 4 — </em><a href="https://abjoerne.medium.com/aws-price-and-cost-multi-account-setup-754966723049"><em>Multi account</em></a></li></ul><p><strong><em>In later blogposts we will look into more aspects of this topic; monitoring, alarms and other tools for cost control.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35b0954a2aff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS price and cost —  introduction]]></title>
            <link>https://abjoerne.medium.com/aws-price-and-cost-introduction-73b7957e8321?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b7957e8321</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[governance]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 06:01:16 GMT</pubDate>
            <atom:updated>2022-09-28T15:13:53.816Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS price and cost — introduction</h3><p>(This is part 1 of a series of blogposts related to pricing and cost in AWS)</p><p>I wanted to highlight this topic as I get a lot of questions related to this. It is important to understand all aspects of cost for both business and technical architects when starting to use AWS, and also in the further process of defining governance. I am based in Norway so my focus on this is from a European point of view and especially for those starting to use AWS from scratch with a single account. In a later blog-post I will describe some of the features for larger companies with multiple accounts.</p><p>The pricing in AWS is complex, which also makes it hard to know what it will cost to use AWS. It is important to understand the price lists and how billing works in AWS. It is possible to build high quality low cost solutions in AWS, and also possible to build low quality high cost solutions. A major concern for some are unwanted activity on your account, like crypto-miners etc.</p><p>The best way forward is to know and understand the pricing of the services and learn how to read the cost-information, monitor the spend and create cost-related alerts. You can also check out the <a href="https://calculator.aws/">pricing calculator</a> to estimate your workload and understand more how the pricing works.</p><figure><img alt="Dollar bills" src="https://cdn-images-1.medium.com/max/1024/0*SLcGEtMSkbuD6fZp" /><figcaption>(Photo by <a href="https://unsplash.com/@alexandermils">Alexander Mils</a> on Unsplash)</figcaption></figure><p>Designing the right architecture and choosing the right services is not something that we will look into here. What I will try to do is give you a better understanding of the pricing model and tools related to billing and cost that you have in AWS.</p><p>You should also be aware that the price might vary depending on which AWS region you are using, for example eu-central-1 is a bit higher in price on some services than eu-north-1. The variations are small and you should in general look at the region best related to your other requirements (latency, compliance, etc.) before looking at cost related to region.</p><h4>Basics of pricing and cost</h4><p>The prices in AWS normally reflect what you are actually consuming of resources. The pricing might be compared to other areas you are familiar with like hotels. If you stay at a hotel-room for one night, you are charged for one night. If you need to park your car you might be charged per hour. And if you consume something for the mini-bar you are charged for your consumption of those items. If you are a regular customer (with high spend with the hotel) you might be eligible for some discounts or you might get a credit voucher for a future stay.</p><p>When using AWS-services you will get a variation of your spend from month to month. both because your workload is varying, and also because the months are not equal (January has 31 days, and February has 28.25 days…on average)</p><p>AWS publishes price lists for each service and sometimes there are multiple lists for the same service as the price is broken down into features. You can access the price list and look at pricing examples for each service, for example <a href="https://aws.amazon.com/s3/pricing/">https://aws.amazon.com/s3/pricing/</a></p><figure><img alt="View of S3 pricing page from AWS webpage with region selector" src="https://cdn-images-1.medium.com/max/949/0*mzW7ytQiOXu8XORl" /><figcaption>S3 price list. Price might vary between regions</figcaption></figure><p>Charges can be per month, per million or per other unit, but are normally pro-rated to single requests or shorter timespan. For example the price could be “per month”, but might be prorated to a daily price when the bill is calculated so you only pay for the part of the month you are using the service.</p><p>There are different types of charges you need to think and know about when you are designing your solution or just using your AWS sandbox account to test new services.</p><h4>Free tiers</h4><p>There are three categories of free tiers in AWS. All categories have some limits to volume/size/usage so check it out. All free tiers are listed on <a href="https://aws.amazon.com/free/">https://aws.amazon.com/free/</a> as well as in the individual price lists.</p><ul><li><strong>First 12 months free:</strong> When you sign up to an AWS account you get to use <em>some services</em> for free <em>the first 12 months</em> after signing up. For example you can store 5GB of data in S3 for free the first 12 months.</li><li><strong>Free trials:</strong> <em>The first time you start using a service</em>, you can use it for free for a defined period of time (<a href="https://aws.amazon.com/free/">check conditions</a>). For example the first time you start using <a href="https://aws.amazon.com/guardduty/pricing/">GuardDuty</a> on an account, you get the first 30 days for free.</li><li><strong>Always free:</strong> A lot of services have a free tier for low consumption regardless if you have a new or old account. For example the first 25 GB of storage in <a href="https://aws.amazon.com/dynamodb/pricing/">DynamoDB</a> is always free.</li></ul><p>The “always free” tier is important to look at if you are doing estimations, the other two are important when it comes to testing new services etc.</p><h4><strong>Volume/request based cost</strong></h4><p>You are paying for the volume/requests you use, and typically you are paying nothing if you are consuming nothing. When a system is not used/idle, this category will normally not incur any cost. A <em>request-based</em> cost could for example be the number of mobile push notifications sent via <a href="https://aws.amazon.com/sns/pricing/">SNS</a> (after the 1M free tier).</p><h4><strong>Time based cost</strong></h4><p>You are paying for a service for a period of time regardless of how much you use the service. The charge is in most cases prorated which means that if pricing-page are stating the monthly fee and you are using the service less than a month you are charged the proportional amount. When a system is not used/idle, this category will in a lot of cases incur cost. It is important to have control of services with this billing-structure as it is easy to forget resources and they will be running forever, and make you pay forever. For example a running <a href="https://aws.amazon.com/ec2/pricing/on-demand/">EC2-server</a> has a time-based cost priced per hour.</p><h4><strong>Time and volume based cost</strong></h4><p>Sometimes you will see a combination of v<em>olume and time. </em>This is again a category which is also adding to the bill even if a system is not being used. Normally there are ways to reduce this, but it is still important to have control of such services. For example storage used in <a href="https://aws.amazon.com/s3/pricing/">S3</a> is priced as GiB per month.</p><h4><strong>Discounts</strong></h4><p>For some services you will get a volume discount and for others you can get a discount if you commit to certain levels over a period of time (for example committing to pay for 10 servers for 1 year could give you ≈25% discount). more on this in a later blog post.</p><h4><strong>Summary</strong></h4><p>It is important to understand how AWS is pricing their services and also to know that the architecture you are designing is affecting the price. Services are priced at timed intervals and/or requests, and price might vary between regions.</p><p><strong><em>I am based in Norway so my focus on this is from a European point of view and especially for those starting to use AWS from scratch with a single account. In a later blog-post I will describe some of the features for larger companies with multiple accounts.</em></strong></p><ul><li><em>Part 2 — </em><a href="https://medium.com/webstep/aws-price-and-cost-billing-35b0954a2aff"><em>Billing</em></a></li><li><em>Part 3 — </em><a href="https://abjoerne.medium.com/graph-on-a-saws-price-and-cost-analysing-and-monitoring-479fb860843f"><em>Analysing and monitoring</em></a></li><li><em>Part 4 — </em><a href="https://abjoerne.medium.com/aws-price-and-cost-multi-account-setup-754966723049"><em>Multi account</em></a></li></ul><p><strong><em>In later blogposts I will look into more aspects of this topic; billing, estimation, monitoring and alarms and other tools for cost control.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b7957e8321" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Import existing resources into an AWS CloudFormation-stack]]></title>
            <link>https://abjoerne.medium.com/import-existing-resources-into-an-aws-cloudformation-stack-960bda369483?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/960bda369483</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cdk]]></category>
            <category><![CDATA[cloudformation]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Wed, 10 Aug 2022 09:21:07 GMT</pubDate>
            <atom:updated>2022-08-23T14:06:32.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzqbP7YoWNvP2aJjJIazgQ.png" /></figure><p>Working with infrastructure as code is the recommended way to provision resources in AWS. The native AWS-way of doing it is via <a href="https://aws.amazon.com/cloudformation/">CloudFormation</a> or <a href="https://aws.amazon.com/cdk/">CDK</a> (Cloud Development Kit), and you should of course do this from day one. But there are cases where you have started using an S3-bucket or DynamoDB-table which you provisioned via the console, or some day down the line you need to refactor your code and split your stack into multiple stacks.</p><p>It is not very often I have cases where I need to import resources. It is usually in a production environment, and where the resource can not easily be deleted and recreated (for example a resource that contains a lot of data like an S3-bucket).</p><h4>Before you start</h4><p>There are some things you should have in mind and consider before you look into importing existing resources:</p><ul><li><strong>Not all resources can be imported</strong> into CloudFormation. For example you <strong><em>can not</em></strong> import EC2-instances, RDS-instances and SNS-topics which is a pain some times, as these are resources which are hard to remove and recreate from scratch without a lot of pain. The current list is available in the documentation here <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html</a></li><li>If you have resources that do not contain data, consider removing them and just add them to the stack as new resources (for example a Lambda function), this could save you a lot of manual work.</li><li>Double-check that your resource-type(s) can be imported and test it in a sandbox-account. This is very important when refactoring so you do not remove a resource from a stack which you can not import later.</li><li>Do not design your infrastructure with the assumption that you can move resources between stacks. There are a lot of resources that can not be imported, and there are also risks and a lot of work involved in doing this.</li><li>You can not import resources and do other updates to your stack at the same time so make sure your stack is up to date with no changes pending.</li><li>You can not import resources that are in another stack, so it need to be detached from it’s existing stack if needed.</li></ul><h4>Existing resource</h4><p>If your existing resource belong to an existing stack you must first remove it from that stack. To remove a resource from a stack without deleting it you must add a <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html">deletion policy</a> to the resource in your cloud formation template like this</p><pre>Resources:<br>  myS3Bucket:<br>    Type: AWS::S3::Bucket<br>    <strong>DeletionPolicy: Retain<br></strong>      BucketName: myExistingbucket-123-abc</pre><p>Make sure this is in place and update your stack with it before removing the resource from the stack.</p><h4>Import you resource into the new CloudFormation stack</h4><p>Add the existing resource to your new CloudFormation-template in the same way you would add a new resource.</p><pre>Resources:<br>  myExistingS3Bucket:<br>    Type: AWS::S3::Bucket<br>      BucketName: myExistingbucket-123-abc</pre><p>Go to the CloudFormation-console, select your new stack, go to <em>Stack actions</em> and <em>Import resources into stack </em>and follow the wizard where you will have the option to add resource parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIkOl2ZtmH4j2QkkTbLPwQ.png" /><figcaption>CloudFormation import wizard</figcaption></figure><p>After completing the wizard, your resource(s) should be available in the stack.</p><h4>Importing in a CDK-stack</h4><p>Importing a resources into a CDK-stack is done more or less as described above.</p><p>If you have a resource in an existing CDK-stack you need to set the removal-policy and clean up your code. Remember to check that the policy is being applied to the stack before removing any code (use cdk diff to check when code has been removed).</p><pre>myResource.apply_removal_policy(RemovalPolicy.RETAIN)</pre><p>Update your existing CDK-stack with the no-version-reportingparameter. This removes the cdk-metadata-resource from your stack temporarily (CDK Metadata-resource makes it impossible to import your new resource(s))</p><pre>cdk <strong>--no-version-reporting</strong> deploy</pre><p>Add your new resource to the CDK-app and run a synth (and a cdk diff if you like)</p><pre>cdk <strong>--no-version-reporting</strong> synth </pre><p>In the cdk.out-folder you will find an updated CloudFormation-template with the new resource(s) (file is named <em>stackname</em>.template.json). Use this template to import the resource(s) manually in CloudFormation as described above.</p><p>When you have imported you can run deploys as earlier.</p><pre>cdk deploy</pre><p>See this for information about CDK Metadata and version reporting: <a href="https://docs.aws.amazon.com/cdk/v2/guide/cli.html#version_reporting">https://docs.aws.amazon.com/cdk/v2/guide/cli.html#version_reporting</a></p><h4>Conclusion</h4><p>Importing resources into an existing CloudFormation-stack is a manual process which can be nice to have when needed. A big drawback are all the resource-types that are not supported. My experience is that a lot of cases contain unsupported resource-types so I have to find other work-around, and I do hope more resource-types will be supported later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=960bda369483" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s confirm you are human]]></title>
            <link>https://abjoerne.medium.com/lets-confirm-you-are-human-5c3341012187?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c3341012187</guid>
            <category><![CDATA[firewall]]></category>
            <category><![CDATA[captcha]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Thu, 27 Jan 2022 11:33:57 GMT</pubDate>
            <atom:updated>2024-01-31T10:00:41.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vncXLrUCOtjfWOJXb1_RBA.png" /></figure><h4>AWS WAF now have support for Captcha</h4><p>Captcha-support for AWS <a href="https://aws.amazon.com/waf/">WAF</a> (Web Application Firewall) was announced recently. Most of us are seeing captchas when we are registering new accounts, making orders online or simply want to check the flight-times to Paris.</p><figure><img alt="AWS WAF Captcha" src="https://cdn-images-1.medium.com/max/430/1*HDg7Fjg0ywrS-7gcyahowA.png" /><figcaption>AWS WAF Captcha</figcaption></figure><blockquote>A <strong>CAPTCHA</strong> (<a href="https://en.wikipedia.org/wiki/Help:IPA/English">/kæp.tʃə/</a>, a <a href="https://en.wikipedia.org/wiki/Contrived_acronym">contrived acronym</a> for “Completely Automated Public <a href="https://en.wikipedia.org/wiki/Turing_test">Turing test</a> to tell Computers and Humans Apart”) is a type of <a href="https://en.wikipedia.org/wiki/Challenge%E2%80%93response_authentication">challenge–response</a> test used in <a href="https://en.wikipedia.org/wiki/Computing">computing</a> to determine whether the user is human.</blockquote><blockquote>(source: <a href="https://en.wikipedia.org/wiki/CAPTCHA">Wikipedia</a>)</blockquote><p>There are a different providers of Captcha solutions out there, and a lot requires you to alter your applications to implement their solution. AWS WAF has this integrated, and if you are using WAF already you can configure this in minutes without the need to change your solution. The captchas presented here are (from what I have seen) either a slider where you match a figure or a “car path” where you have to point to the end. The user can also select a voice-message where you have to recognise one of two words spoken (in English).</p><p>If you are not using AWS WAF you could, without much change, set up a <a href="https://aws.amazon.com/cloudfront/">CloudFront</a> distribution (AWS service for content delivery) and add WAF to the distribution.</p><p>Let us skip the part of setting up CloudFront (or another supported AWS services) and see how Captcha is configured.</p><h4>Set up AWS Web ACL</h4><p>Go to WAF in the <a href="https://console.aws.amazon.com/wafv2/homev2/web-acls?region=global">AWS-console</a> and select “Web ACLs” in the menu. Make sure to select the correct region, or “Global” if you are using a global service like CloudFront.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*ICws756ZHiPVF-Ns9VbE0w.png" /><figcaption>WFA ACL page</figcaption></figure><p>You press “Create web ACL” and give your ACL a good name, and add an AWS resource (for example CloudFront).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*dfDWE3Fdl855NUnXJmsShg.png" /><figcaption>Step 1</figcaption></figure><p>Then you need to define a rule for your ACL. This can be a custom rule or a managed rule. Managed rules can be AWS-provided or you can purchase rules from security-vendors. In my case I make a custom rule, and check that the query-string in the request does not matches “mysecretdoor”. This will then trigger an action unless are are accessing via the “secret door”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*98_5zGENvvObDqRVA820Sg.png" /><figcaption>Step 2 — Rule</figcaption></figure><p>Next is to define the action to perform when the rule is “true”. We select Captcha and for this demo I use 60 seconds as the immunity time (time before captcha is triggered for the user again). 300 sec is the default value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*HYSBazCwkfWx2iyVACcw1w.png" /><figcaption>Step 2 — Action</figcaption></figure><p>You can leave the other value as is if you are just experimenting. Then it is just to hit your webpage(s) to see if it works.</p><p>WAF also give you metrics and a list of requests being served.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*NNn1JGllrz22arMMhPAdFg.png" /><figcaption>Dashboard</figcaption></figure><p>AWS WAF is priced per WEB ACL, per rule and per request (<a href="https://aws.amazon.com/waf/pricing/">see pricing</a>). On top of that you pay $0.40 per thousand challenge attempts.</p><p>To save money it is possible just to send some requests to WAF (path-based) and add Captcha to only some URLs, but that routing is up to the service WAF is hooked into.</p><h4>Conclusion</h4><p>There are a lot of captcha solutions out there with a lot of different pricing and technical requirements. If you are already using AWS, their solution is really quick to get going and does not require any major changes to your application. The cost depends on the traffic, and of course you need to look at the price related to the value it is to stop spammers and bots. Captchas presented are not to annoying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c3341012187" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you relying on automated upgrades of your SQLServer in AWS?]]></title>
            <link>https://abjoerne.medium.com/are-you-relying-on-automated-upgrades-of-your-sqlserver-in-aws-4a355532f10b?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a355532f10b</guid>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Fri, 21 May 2021 10:01:03 GMT</pubDate>
            <atom:updated>2022-06-14T11:21:22.247Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kilcpJG14mZumcSZQGUXFw.png" /></figure><p><strong>UPDATE:</strong> <em>As of August 16, 2021, </em><a href="https://aws.amazon.com/about-aws/whats-new/2021/08/amazon-rds-sql-server-supports-automatic-minor-version-upgrades/"><em>Amazon RDS for SQL Server now supports Automatic Minor Version Upgrades</em></a><em> This does NOT apply to all versions of SQL-server — you can use the CLI-</em>command aws rds describe-db-engine-version <em>to check for availability.</em></p><p>Amazon Web Services (AWS) Relational Database Service (RDS) covers PostgreSQL, MySQL, MariaDB, Oracle and SQLServer in addition to Amazon Aurora with PostgreSQL and MySQL compatibility.</p><p>When you spin up one of these databases AWS is doing the heavy lifting for you like setting up a server, installing software and making sure you get your data backed up daily and giving you point in time recovery. Patching and upgrading is also done in minutes and can be automatically applied by AWS <em>in most cases</em>.</p><h3>How do you upgrade minor versions?</h3><p>A minor version upgrade is not hard in RDS, all you need to do is trigger a <em>modify-db-instance</em> with the CLI or schedule an update in the console. Then you wait for AWS to do the rest.</p><p>Most customers rely on automated upgrades of minor version, <strong>but there is one exception a lot is unaware of — automated upgrades of SQLServer is not supported.</strong></p><p>As described in <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Upgrading.html">RDS-documentation</a> there are two categories of upgrades; minor and major</p><blockquote>There are two kinds of upgrades: major version upgrades and minor version upgrades. In general, a <em>major engine version upgrade</em> can introduce changes that are not compatible with existing applications. In contrast, a <em>minor version upgrade</em> includes only changes that are backward-compatible with existing applications.</blockquote><p>Major upgrades will never happen without your interaction. A minor upgrade can happen automatically, if you opt in to it, according to the RDS-documentation.</p><blockquote>For minor version upgrades, you can manually modify the engine version, or you can choose to enable auto minor version upgrades.</blockquote><p>This statement is only true for all databases <strong>except SQL Server</strong>. For SQLServer you must trigger the upgrade yourself (or find a way to automate the trigger)</p><p>Be aware that even if the RDS-service say that automated upgrades are turned on — <strong>it is not for SQLServer</strong></p><p>In the CLI you can run aws rds describe instances with this result</p><pre>...<br>&quot;AutoMinorVersionUpgrade”: true<br>...</pre><p>This is what the console is showing for SQL Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*pnbmqmh4iVfBelXXOs6tXg.png" /><figcaption>RDS console with upgrade enabled</figcaption></figure><h3>How to automate minor upgrades of SQLServer?</h3><p>If you try to automate — be aware that the event “<a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html">RDS-EVENT-0155</a> (The DB instance has a DB engine minor version upgrade available.)” is not available for SQLServer. This is not documented AFAIK, but has been confirmed by AWS Support.</p><p>According to support the only way to “automate” an alert is to check the “Recommendations”-menu in the RDS-console. Unfortunately this option is not available in all regions, like my “home region” eu-north-1.</p><p>If you want to do the job of checking it manually, you can check the version you are running in the console and see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html">list of available versions in the documentation</a>.</p><p>If you would like to follow AWS recommendation, and automate everything, you would need to know the value of EngineVersion and Engineof your SQLServer. Then query the RDS service for any updates</p><pre>rds describe-db-engine-versions — engine-version $YOURVERSION -engine $YOURENGINE</pre><p>If you get an empty array of ValidUpgradeTarget you are on the latest minor and major version. If you get an array back, you would need to check for IsMajorVersionUpgrade=true<em> </em>to avoid kicking of a major upgrade which can have unwanted side-effects.</p><pre>&gt; <em>rds describe-db-engine-versions — engine-version 14.00.3049.1.v1 — engine sqlserver-web</em></pre><pre>...<br>&quot;ValidUpgradeTarget&quot;: [<br>    {<br>        &quot;Engine&quot;: &quot;sqlserver-web&quot;,<br>        &quot;EngineVersion&quot;: &quot;14.00.3281.6.v1&quot;,<br>        &quot;Description&quot;: &quot;SQL Server 2017 14.00.3281.6.v1&quot;,<br>        &quot;AutoUpgrade&quot;: false,<br>        <strong>&quot;IsMajorVersionUpgrade&quot;: false</strong><br>    },<br>    {<br>        &quot;Engine&quot;: &quot;sqlserver-web&quot;,<br>        &quot;EngineVersion&quot;: &quot;14.00.3294.2.v1&quot;,<br>        &quot;Description&quot;: &quot;SQL Server 2017 14.00.3294.2.v1&quot;,<br>        &quot;AutoUpgrade&quot;: false,<br><strong>        &quot;IsMajorVersionUpgrade&quot;: false</strong><br>    },<br>    {<br>        &quot;Engine&quot;: &quot;sqlserver-web&quot;,<br>        &quot;EngineVersion&quot;: &quot;14.00.3356.20.v1&quot;,<br>        &quot;Description&quot;: &quot;SQL Server 2017 14.00.3356.20.v1&quot;,<br>        &quot;AutoUpgrade&quot;: false,<br><strong>        &quot;IsMajorVersionUpgrade&quot;: false</strong><br>    },<br>    {<br>        &quot;Engine&quot;: &quot;sqlserver-web&quot;,<br>        &quot;EngineVersion&quot;: &quot;15.00.4043.16.v1&quot;,<br>        &quot;Description&quot;: &quot;SQL Server 2019 15.00.4043.16.v1&quot;,<br>        &quot;AutoUpgrade&quot;: false,<br>        <strong>&quot;IsMajorVersionUpgrade&quot;: true</strong><br>    },<br>    {<br>        &quot;Engine&quot;: &quot;sqlserver-web&quot;,<br>        &quot;EngineVersion&quot;: &quot;15.00.4073.23.v1&quot;,<br>        &quot;Description&quot;: &quot;SQL Server 2019 15.00.4073.23.v1&quot;,<br>        &quot;AutoUpgrade&quot;: false,<br><strong>        &quot;IsMajorVersionUpgrade&quot;: true</strong><br>    }<br>],</pre><h3>Summary</h3><p>If you are running SQLServer be sure someone or something is checking your database-version and apply pending minor upgrades if any. They can be applied during your maintenance window or immediately.</p><p>Always make sure your list of “Alternate Contacts” under “My account” in the console is up to date. Then you will get an email if your RDS minor version is coming to end of life.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a355532f10b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Save AWS-cost on CloudFront]]></title>
            <link>https://abjoerne.medium.com/save-aws-cost-on-cloudfront-dd87e105856e?source=rss-cbea9e8939d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd87e105856e</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[pricing]]></category>
            <dc:creator><![CDATA[Anders Bjørnestad]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 10:04:22 GMT</pubDate>
            <atom:updated>2021-02-09T14:47:29.471Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS have again announced a form of price reduction on one of their services (or actually multiple services). This time based on an old service, <a href="https://aws.amazon.com/cloudfront/">Amazon CloudFront</a>, and this is through a savings plan.</p><p>As most savings plans in AWS you would need to commit to a year, and think about your future use. In this case it is probably easy to look at historical data and use that as a basis.</p><figure><img alt="CloudFront Security Savings Bundle" src="https://cdn-images-1.medium.com/max/607/1*ihHvHfUFm46W7SX7rGF9EA.png" /><figcaption>CloudFront Security Savings Bundle</figcaption></figure><blockquote>The CloudFront Security Savings Bundle is a flexible self-service pricing plan that helps you save up to 30% on your CloudFront bill in exchange for a monthly spend commitment for a 1 year term. This savings is not limited to data delivered by CloudFront, but applies to all CloudFront usage types including Lambda@Edge. The CloudFront Security Savings Bundle also includes free AWS WAF (Web Application Firewall) usage up to 10% of your committed amount.</blockquote><p>Since this plan also cover transfer-cost, you will get an even greater benefit of sending your traffic through CloudFront and not directly to your ALBs, EC2s or S3-bukcets.</p><p>You will find the tool in the <a href="https://console.aws.amazon.com/cloudfront/">CloudFront section of the AWS console</a> (not in the billing/cost-section!) As always there are things to look into before you commit here — read the docs and the FAQ!</p><h4>Recommendations for suggested savings</h4><p>AWS is giving you a recommendations for suggested savings, but it does not look like it grabs all the data (correct?) which might lead to a low recommendation than you would need. What I have seen is that the first month looks like it is missing cost compared to the bill (November), and our WAF charges are not reflected either. We are steady on ≈USD20 (ex vat) on CloudFront spend so I was expecting a higher recommendation. In this case we are using WAF Classic, which might be a reason for WAF charges showing as $0.00 (not been able to get it confirmed yet)</p><p>Below you can see the suggestion and the actual cost from Cost Explorer.</p><figure><img alt="Savings suggestion" src="https://cdn-images-1.medium.com/max/949/1*dHPCzFvQ_aLzZ1B-I_ojoQ.png" /><figcaption>Suggested savings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*zJTElj3zc74qkXN0WRHAzA.png" /><figcaption>CloudFront and WAF usage</figcaption></figure><h4>Savings calculator</h4><p>There is a calculator in the savings tool, where you enter the expected size in GB pr month and average size of the requests. Be aware that you are paying for the requests going through CloudFront so you would need to enter the average size carefully as it is used to calculate the number of requests. If you set the object-size to large, your cost will likely be too low.</p><figure><img alt="Savings Calculator" src="https://cdn-images-1.medium.com/max/959/1*VZmQM4C-uQ2Tjd4XxnlOCg.png" /><figcaption>Calculator</figcaption></figure><h4><strong>Other things to have in mind</strong></h4><ul><li>The savings are given as credits on your account, applied only to the relevant services. If you are using credit-sharing or are doing analysis on your billing-data you might have to look into this up front.</li><li>Managed WAF rules subscribed through the AWS Marketplace are not covered by the CloudFront Security Savings Bundle.</li><li>This feature is not (yet) available through any API/CLI (console only)</li><li>It is located in the CloudFront console, and not in the billing-part of the console like the other savings-plan.</li></ul><h4><strong>Resources</strong></h4><ul><li>News release <a href="https://aws.amazon.com/about-aws/whats-new/2021/02/introducing-amazon-cloudfront-security-savings-bundle/">https://aws.amazon.com/about-aws/whats-new/2021/02/introducing-amazon-cloudfront-security-savings-bundle/</a></li><li>FAQ: <a href="https://aws.amazon.com/cloudfront/faqs/#CloudFront_Security_Savings_Bundle">https://aws.amazon.com/cloudfront/faqs/#CloudFront_Security_Savings_Bundle</a></li><li>Docs: <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/savings-bundle.html">https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/savings-bundle.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd87e105856e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>