Long bill

AWS Reserved Instances and Consolidated Billing

Amazon documents how reserved instances and consolidated billing work together, but it's apparently still confusing because Bob's account has instances and is also the paying account. Our setup is different - the only resource created inside the paying account is the S3 bucket where Amazon posts our billing data. Here's my edited version of the AWS document.

Let's assume that Alice and Bob always use the same instance types, and that the normal Amazon EC2 rate for that type is $0.10 per instance-hour. Let's also assume that Alice always runs 3 instances, and Bob always runs 10 instances.

For any hour, AWS will charge Alice and Bob like this:

Account   Usage   Rate    Total   Charged
Alice     3       $0.10   $0.30   $0.30
Bob       7       $0.10   $0.70   $0.70

Now, let's assume that Reserved Instances of the same type cost $0.02 per hour, and that Alice has 5 of these Reserved Instances, but Bob has none.

For any hour, AWS will now Bob at the same rate, but Alice at a lower rate:

Account   Usage   Rate    Total   Charged
Alice     3       $0.02   $0.06   $0.06
Bob       7       $0.10   $0.70   $0.70

For billing purposes, Consolidated Billing treats all the accounts on the consolidated bill as one account. This means that all accounts on a consolidated bill can receive the hourly cost benefit of Amazon EC2 Reserved Instances purchased by any other account.

Now, assume that Dave pays for a consolidated account that pays for Alice's and Bob's accounts.

Without reserved instances, AWS will charge Dave:

Account   Usage   Rate    Total   Charged
Alice     3       $0.10   $0.30   -
Bob       7       $0.10   $0.70   -
Dave      0       -       -       $1.00

With reserved instances, one might expect AWS to charge Dave $0.66 per hour (3 x $0.02 for Alice's reserved instances + 6 x $0.10 for Bob's regular instances). However, the reserved instance pricing applies to all accounts under the paying account, so Alice's reserved instances also apply to Bob:

Account   Usage   Rate    Total   Charged
Alice     3       $0.02   $0.06   -
Bob       2       $0.02   $0.04   -
Bob       5       $0.10   $0.50   -
Dave      0       -       -       $0.60

Unfortunately, that is not how AWS reports the charge. When reserved instances are in use, AWS uses a blended rate for each instance type, which is the total cost for all instances of that type, divided by the number of instances of that type. In this case, the blended rate is $0.60 / 10 = $0.06.

Another way to look at it is in terms of cost attribution: AWS attribute a dollar amount to Bob and Alice based on each person's usage. Alice used 3 of the 10 instances (30%), and Bob used 7 (70%). Therefore on the bill, 30% of the $0.60 is attributed to Alice, and the other 70% is attributed to Bob:

Account   Usage   Rate    Total   Charged
Alice     3       $0.06   $0.18   -
Bob       7       $0.06   $0.42   -
Dave      0       -       -       $0.60

While Dave still saves $0.40 per hour, the blended rate disguises the costs Alice and Bob think they are incurring.

Note: Bob receives the cost benefit from Alice's Reserved Instances only if he launches his instances in the Availability Zone where Alice purchased her Reserved Instances. For example, if Alice specified us-west-2a when she purchased her Reserved Instances, Bob must specify us-west-2a when he launches his instances in order to get the cost benefit on his consolidated bill.

Image by Lars Plougmann