# Billing & Pricing

## Price Models

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><p><strong>Capex (Capital Expenses)</strong></p><ul><li>Expenses that are paid in advance.</li><li>It is a <strong>Fixed Cost</strong>, non recoverable.</li></ul></td><td></td><td></td></tr><tr><td><p><strong>Opex (Operational Expenses)</strong></p><ul><li><p>Pay for what you use.</p><ul><li><em>Like public services: water, gas, electricity.</em></li></ul></li></ul></td><td></td><td></td></tr></tbody></table>

## Price Fundaments

There are 3 fundamental cost factors in AWS:

* Computing *(More processing power = More expensive)*
* Storage *(More storage = Less cost rates)*
* Bandwidth

## Price Policies

* Pay according to use.
* Pay **less** when reserving.
  * *Like when you reserve for 1 or 3 years.*
* Pay even less by unit when using more.
  * *Like `storage` rates going down the more GB you use.*
* Pay event less with AWS growth.

Price models vary depending on the service so:

* Always optimize costs.
  * IT must not be treated as *Periodic Capital Investment* anymore, BUT as efficient use of resources.
* Maximize the power of flexibility.
  * AWS has independent ans transparent costs, so you can choose what you need and not waste.
  * AWS does not require long term contracts or minimum adhesion time, except when `reserving`.
  * You only pay if services are executing and for the time that they executed.
* Use the right price model for the work to be done.
  * AWS offers several price models like:
    * **On Demand.**
    * **Dedicated Instances.**
    * **Spot Instances. (Supply and Demand)**
    * **Reserved.**

## `EC2` Pricing

<details>

<summary>Some attributes that can change the price</summary>

* Hours used by the server.
* Type of instance.
* Price model.
* Number of instances.
* Load Balancing.
* Detailed monitoring. *(Increases prices)*
* Auto Scaling.
* Elastic IP Addresses.
* OS and packages.

</details>

### **Pricing models for EC2**

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>On Demand</strong></td><td><ul><li>Allow you to pay a fixed rate by (hour/seconds) of execution.</li><li>No fidelity terms.</li><li><p>AWS may not garantee capacity.</p><ul><li>Meaning that Reserved instances have higher priority.</li></ul></li></ul></td><td></td><td></td></tr><tr><td><strong>Reserved</strong></td><td><ul><li><p>Reserve capacity for a significant discount in the (hour/second) rate.</p><ul><li>Must have fidelity over 1 or 3 years.</li><li><strong>The more you pay up front, the more discount you can get</strong>.</li></ul></li><li>You are stuck with the hardware that you reserved. <em>(It is possible to change with Conversible Reserves)</em></li><li><p>AWS can garantee your hired capacity, but no more than that.</p><ul><li>And if you go over your hired capacity, the overload will be charged as <code>On-Demand</code>.</li></ul></li></ul></td><td><strong>Types of Reserved</strong></td><td><ul><li><p>Default Reserve:</p><ul><li>Offers up to 75% discount over on-demand instances. The longer the contratct the higher the discount.</li></ul></li><li><p>Conversible Reserve <code>(RI)</code>:</p><ul><li>Up to 54% discount over capacity on-demand to change the <code>RI</code> attributes, as long as the change results on creating reserved instances of equal or superior value.</li><li>Like if you have to get more powerful hardware.</li></ul></li><li><p>Schedule Reserve:</p><ul><li>Are available to be lauched within the specified date ranges that were reserved.</li><li>This option combines capacity reserve with recurrent predictable programming that requires a fraction of a (day, week or month).</li></ul></li></ul></td></tr><tr><td><strong>Spot</strong></td><td><ul><li><p>AWS will let you bid on the value of non used instances.</p><ul><li>Meaning that you may pay as much as you would like if available.</li></ul></li><li>These have the <strong>lowest prices</strong> available.</li><li><p>But, AWS <strong>does not garantee capacity</strong> AND <strong>may even terminate your instances at any time if needed</strong>.</p><ul><li>For this reason it is recommended for stateless work that can be done on flexible timeframes.</li></ul></li></ul></td><td></td><td></td></tr><tr><td><strong>Dedicated</strong></td><td><ul><li>Will provide you with dedicated server hardware.</li><li>The more expensive options.</li><li><p>For Enterprise solutions that:</p><ul><li>Have BYOL (Bring your Own License).</li><li>Critical need for capacity. <em>AWS won't touch your instances or prevent you from running them</em>.</li></ul></li></ul></td><td></td><td></td></tr></tbody></table>

## `Lambda` Pricing

* By requisitions:
  * Free Tier: 1 million requisitions by month.
  * $0.20 for 1 million requisitions.
* By duration:
  * 400.000 GB by second by month for free, and up to 3.2 millions of seconds of execution time.
  * $0.00001667 for each GB by second used.

Additional costs may be charged if your `lambda` functions use other services or transfer data.

## `EBS` Pricing

* Volume (by GB).
* Snapshots (by GB).
* Data transfer.

## `S3` Pricing

* Storage.
* Requisitions.
* Types of storage class.
* Data transfer.
* Transfer acceleration.
* Replication between Regions.

## `RDS` Pricing

* Server turn-on time.
* Database caracteristics.
* Database types.
* Number of instances.
* Provisioned storage.
* Additional storage.
* Requisitions.
* Data transfer.

## `Cloudfront` Pricing

* Traffic distribution.
* Requests.
* Data output.

## Free Services that AWS provides

* `Amazon VPC`.
* `Elastic Beanstalk`.
* `CloudFormation`.
* `IAM`.
* `Auto Scaling`.
* `OpsWorks`.
* `Consolidated Billing`.

**These service may be free, BUT some of them uses or creates other services that can be billed.**

For instance, `Elastic Beanstalk` may create `EC2` instances that will be billed.

## AWS Support Plans

{% embed url="<https://aws.amazon.com/pt/premiumsupport/plans/>" %}

This cards will show of the features that are **added** or **changed**, with each support plan.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Basic</strong></td><td><ul><li>Customer Service and Communities.</li><li><code>AWS Trusted Advisor</code>: <strong>core checks</strong>.</li><li><code>AWS Health</code>.</li></ul></td><td></td></tr><tr><td><strong>Developer</strong></td><td><ul><li><code>AWS Trusted Advisor</code>: <strong>service quota &#x26; basic security checks</strong>.</li><li><p>Technical Support:</p><ul><li>Business hours only.</li><li>Web access only.</li><li>To Cloud Support Associates.</li></ul></li><li>Architectural Guidance: <strong>General.</strong></li></ul></td><td></td></tr><tr><td><strong>Business</strong></td><td><ul><li><code>AWS Trusted Advisor</code>: <strong>full set of checks</strong>.</li><li><p>Technical Support:</p><ul><li>24/7.</li><li>Phone, Web, Chat and Slack App.</li><li>To Cloud Support Engineers.</li></ul></li><li>Architectural Guidance: <strong>Contextual to your use-cases</strong>.</li><li>Access to <code>AWS Support API</code>.</li><li>Third-Party Software Support.</li></ul></td><td></td></tr><tr><td><strong>Enterprise</strong></td><td><ul><li>Architectural Guidance: <strong>Reviews &#x26; guidance based on your applications.</strong></li><li><p>Technical Account Manager (TAM).</p><ul><li><em>Consultative architectural and operational guidance.</em></li></ul></li><li><p>Concierge for Billing Assistance.</p><ul><li><em>Cost optimization, analysis or questions</em>.</li></ul></li><li>Access to <code>AWS Incident Detection and Response</code>.</li><li>Access to <code>AWS Managed Services</code>.</li></ul></td><td></td></tr></tbody></table>
