Connect Amazon Web Services (AWS)
This guide explains how to prepare your AWS environment and establish a connection with Hypermeter.
Hypermeter reads the cost from the Cost and Usage Report (CUR) that your payer organization already exports, and the utilization from CloudWatch in every member account. The rightsizing cubes then compare the recommendations of AWS with the real cost.
All access is read-only. Hypermeter assumes two IAM roles in your accounts.
What Hypermeter collects
Five workflows do the work. This guide assumes that they are in your organization. If they are not, contact Exivity support.
| Workflow | Reads | Cube |
|---|---|---|
| Cost and Usage Report | The CUR files in your S3 bucket | AWS Cost by Resource |
| Cost Explorer | The cost per day, account, and service, the coverage of Reserved Instances and Savings Plans, and the cost per resource of the last 14 days | AWS Cost Daily and AWS Rightsizing Reconciled |
| Metrics | The hourly CloudWatch metrics of each account: CPU, network, EBS IOPS per volume, and RDS | AWS Utilisation Daily |
| Recommendations (optional) | The recommendations of AWS Compute Optimizer, and the AWS price list | AWS Rightsizing |
| Inventory | EC2 instances, EBS volumes and their attachments, and RDS instances | AWS Storage Waste |
Each cube has a view:
| Cube | View |
|---|---|
| AWS Cost by Resource | AWS Cost by Resource |
| AWS Cost Daily | AWS Cost — Daily by Account and Service |
| AWS Rightsizing | AWS Rightsizing — Compute Optimizer |
| AWS Rightsizing Reconciled | AWS Rightsizing — Reconciled Against Real Cost |
| AWS Storage Waste | AWS Storage Waste — Unattached and Idle Volumes |
| AWS Utilisation Daily | AWS Utilisation — Daily CPU and Network |
Prerequisites
| You need | Details |
|---|---|
| AWS Organizations with all features enabled | Hypermeter reads the list of accounts from the organization. The member role is deployed through the organization. |
| A Cost and Usage Report | An existing CUR export of the payer organization: the classic (legacy) format, hourly, with resource IDs. Know its S3 bucket, its prefix, and its report name. |
| Administrator access to the management account | To deploy a CloudFormation stack and a StackSet. |
| The AWS CLI | For the commands on this page. |
| The onboarding details from Exivity | The external ID, the AWS account ID of Hypermeter, and two CloudFormation templates: the payer template and the member template. |
| The owner role in Hypermeter | To schedule the workflows. See Roles and permissions. |
Exivity creates the external ID, one for each payer organization. Never choose this value yourself.
Good to know:
- Use the CUR export that you already have. Do not create a new one for Hypermeter: AWS limits the number of exports.
- The export must include resource IDs. Without them, Hypermeter cannot match the cost with the metrics.
Configure AWS access
Hypermeter uses two roles with fixed names. Both trust the AWS account of Hypermeter, and both need the external ID.
| Role | Where | Hypermeter reads |
|---|---|---|
HypermeterPayerRole | The management account | The list of accounts of the organization, the CUR bucket, Cost Explorer, and Compute Optimizer |
HypermeterMemberRole | Every account that you want in the reports | CloudWatch, and the inventory of EC2, EBS, and RDS |
-
Check that you are signed in to the management account that you intend:
aws sts get-caller-identity -
In the management account, create a CloudFormation stack from the payer template. Set
CurBucketNameto the bucket of your existing CUR export, and enter the external ID from Exivity. The stack createsHypermeterPayerRole, andHypermeterMemberRolefor the management account itself. -
Allow CloudFormation StackSets to deploy to the accounts of your organization:
aws organizations enable-aws-service-access --service-principal member.org.stacksets.cloudformation.amazonaws.comaws cloudformation activate-organizations-access -
Create a StackSet from the member template. Target the whole organization, or only the organizational units (OUs) that you want in the reports. The StackSet creates
HypermeterMemberRolein each account. -
Optional: turn on AWS Compute Optimizer for the organization. Hypermeter then also collects its recommendations.
aws compute-optimizer update-enrollment-status --status Active --include-member-accounts
If your security team does not accept a role in every account of the organization, target selected OUs in step 4.
Connect AWS to Hypermeter
Have the details ready
The workflows need these values:
| Value | Details |
|---|---|
| The management account ID | The 12 digits of the account with HypermeterPayerRole |
| The CUR export | The S3 bucket, the prefix, and the report name |
| The scope | The whole organization, or the OUs that you targeted |
| Compute Optimizer | Whether you turned it on |
None of these values is a secret. Hypermeter needs no access key from you.
Check the authenticator
The Extract jobs sign in with an AWS STS authenticator. It assumes a role in your account and receives temporary credentials.
| Field | Value |
|---|---|
| Role ARN | arn:aws:iam::<account-id>:role/HypermeterPayerRole for cost and recommendations. arn:aws:iam::<account-id>:role/HypermeterMemberRole for metrics and inventory, once for each account |
| External ID | The external ID from Exivity |
| Access key and Secret key | Empty. Hypermeter signs in from its own AWS account |
| Duration seconds | Optional. The temporary credentials are valid for one hour when you leave it empty |
| STS region | Optional. The region of the STS endpoint to use |
To create or change an authenticator, see Connections and authentication.
Cost
- The Cost and Usage Report is the main source of cost. It is the only source with the cost of every resource.
- Cost Explorer adds the cost per day, account, and service, and the coverage of Reserved Instances and Savings Plans. It has the cost per resource only for EC2 compute, and only for the last 14 days.
- AWS Rightsizing Reconciled needs the Cost Explorer workflow and the recommendations workflow.
AWS charges for Cost Explorer: $0.01 for each request, and each page of a result is a request. Run the Cost Explorer workflow once a week, not every day.
Metrics
- The CloudWatch metrics need only
HypermeterMemberRole. Nothing depends on Compute Optimizer. - Hypermeter collects the average, the maximum, and the 95th percentile of each hour. The percentile comes from CloudWatch itself, so it is a true hourly 95th percentile.
- Memory values exist only for instances where the CloudWatch agent publishes them.
When Compute Optimizer is not turned on, AWS Rightsizing is empty. That means "not enabled", not "nothing to improve".
Schedule the workflows
- Run each workflow once for one closed day, and verify the connection.
- Add a schedule to each workflow. Give the workflows start times one hour apart, between 00:30 and 04:00 UTC. See Schedule a workflow.
- Schedule the Cost Explorer workflow weekly, for example
30 3 * * 1for every Monday at 03:30. - Turn on Enabled for each schedule.
CloudWatch keeps hourly values for 455 days. You do not have to collect the history on the first day.
Verify the connection
Check that:
- Every workflow can assume its role. In the trust policy of each role, the external ID is required: without it, AWS must refuse the request.
- The cost rows of the Cost and Usage Report have a resource ID (
lineItem/ResourceId). - At least one instance in each account has hourly CPU and network values.
- You know whether Compute Optimizer is turned on, so that you can read an empty AWS Rightsizing cube.
- AWS Rightsizing Reconciled shows
RESOURCE_LEVEL_CEfor recent recommendations.
How to read the numbers
AWS Rightsizing Reconciled puts each recommendation next to the real cost of the instance, over the period that the recommendation looks back on. The field cost_source tells where the cost comes from:
cost_source | Meaning |
|---|---|
RESOURCE_LEVEL_CE | The recommendation is matched with the real cost of the resource. |
OUTSIDE_CE_WINDOW | The recommendation is more than 14 days old. Cost Explorer has no cost per resource for that period. |
NO_COST_ROWS | There is no cost for the instance. It was stopped, or the collection failed. |
Compute Optimizer calculates savings with on-demand list prices. Rows keep the mark RETAIL_UNRECONCILED until Hypermeter has collected the coverage of Reserved Instances and Savings Plans. Do not present those savings as final.
Good to know:
- The memory values of Compute Optimizer and of the CloudWatch agent come from the same instances. Do not count them as two sources.
- The literal names of the cubes and views use the spelling "Utilisation".
Troubleshooting
| What you see | What it means | What to do |
|---|---|---|
A run fails with AccessDenied when it assumes a role | The external ID does not match, the role is not in that account, or the role trusts another account. | Compare the external ID with the one from Exivity. Check that the stack or the StackSet reached the account. |
A run fails with aws_sts: missing base credentials or InvalidClientTokenId | Hypermeter cannot sign in to its own AWS account. | Contact Exivity support. |
| An account has no metrics | The account is outside the OUs of the StackSet, so it has no HypermeterMemberRole. | Add the OU to the StackSet. |
| The management account has no metrics | A StackSet does not deploy to the management account. | Check that the payer stack created HypermeterMemberRole. |
| Cost rows have no resource ID, or cost does not match the metrics | The CUR export does not include resource IDs. | Turn on resource IDs in the export. |
| Instances have no memory values | The CloudWatch agent is not installed, or it does not publish memory. | Install the CloudWatch agent on the instances that you want to rightsize on memory. |
| AWS Rightsizing is empty | Compute Optimizer is not turned on, or it has no recommendations yet. | Turn on Compute Optimizer. See step 5 of Configure AWS access. |
Many rows show OUTSIDE_CE_WINDOW | The recommendations are more than 14 days old, and Cost Explorer has no cost per resource for that period. | Check that the schedules of the recommendations workflow and the Cost Explorer workflow are enabled, and that their runs succeed. |
| The Cost Explorer charge on your AWS invoice is high | The Cost Explorer workflow runs too often. | Schedule it weekly. |
If a run fails for another reason, see Troubleshooting run failures.