Skip to main content

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.

WorkflowReadsCube
Cost and Usage ReportThe CUR files in your S3 bucketAWS Cost by Resource
Cost ExplorerThe cost per day, account, and service, the coverage of Reserved Instances and Savings Plans, and the cost per resource of the last 14 daysAWS Cost Daily and AWS Rightsizing Reconciled
MetricsThe hourly CloudWatch metrics of each account: CPU, network, EBS IOPS per volume, and RDSAWS Utilisation Daily
Recommendations (optional)The recommendations of AWS Compute Optimizer, and the AWS price listAWS Rightsizing
InventoryEC2 instances, EBS volumes and their attachments, and RDS instancesAWS Storage Waste

Each cube has a view:

CubeView
AWS Cost by ResourceAWS Cost by Resource
AWS Cost DailyAWS Cost — Daily by Account and Service
AWS RightsizingAWS Rightsizing — Compute Optimizer
AWS Rightsizing ReconciledAWS Rightsizing — Reconciled Against Real Cost
AWS Storage WasteAWS Storage Waste — Unattached and Idle Volumes
AWS Utilisation DailyAWS Utilisation — Daily CPU and Network

Prerequisites​

You needDetails
AWS Organizations with all features enabledHypermeter reads the list of accounts from the organization. The member role is deployed through the organization.
A Cost and Usage ReportAn 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 accountTo deploy a CloudFormation stack and a StackSet.
The AWS CLIFor the commands on this page.
The onboarding details from ExivityThe external ID, the AWS account ID of Hypermeter, and two CloudFormation templates: the payer template and the member template.
The owner role in HypermeterTo schedule the workflows. See Roles and permissions.
External ID

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.

RoleWhereHypermeter reads
HypermeterPayerRoleThe management accountThe list of accounts of the organization, the CUR bucket, Cost Explorer, and Compute Optimizer
HypermeterMemberRoleEvery account that you want in the reportsCloudWatch, and the inventory of EC2, EBS, and RDS
  1. Check that you are signed in to the management account that you intend:

    aws sts get-caller-identity
  2. In the management account, create a CloudFormation stack from the payer template. Set CurBucketName to the bucket of your existing CUR export, and enter the external ID from Exivity. The stack creates HypermeterPayerRole, and HypermeterMemberRole for the management account itself.

  3. Allow CloudFormation StackSets to deploy to the accounts of your organization:

    aws organizations enable-aws-service-access --service-principal member.org.stacksets.cloudformation.amazonaws.com
    aws cloudformation activate-organizations-access
  4. 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 HypermeterMemberRole in each account.

  5. 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
Limit the scope of access

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:

ValueDetails
The management account IDThe 12 digits of the account with HypermeterPayerRole
The CUR exportThe S3 bucket, the prefix, and the report name
The scopeThe whole organization, or the OUs that you targeted
Compute OptimizerWhether you turned it on
No access keys required

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.

FieldValue
Role ARNarn: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 IDThe external ID from Exivity
Access key and Secret keyEmpty. Hypermeter signs in from its own AWS account
Duration secondsOptional. The temporary credentials are valid for one hour when you leave it empty
STS regionOptional. 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.
Cost Explorer API charges

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.
Empty rightsizing results

When Compute Optimizer is not turned on, AWS Rightsizing is empty. That means "not enabled", not "nothing to improve".

Schedule the workflows​

  1. Run each workflow once for one closed day, and verify the connection.
  2. 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.
  3. Schedule the Cost Explorer workflow weekly, for example 30 3 * * 1 for every Monday at 03:30.
  4. 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_CE for 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_sourceMeaning
RESOURCE_LEVEL_CEThe recommendation is matched with the real cost of the resource.
OUTSIDE_CE_WINDOWThe recommendation is more than 14 days old. Cost Explorer has no cost per resource for that period.
NO_COST_ROWSThere is no cost for the instance. It was stopped, or the collection failed.
Unreconciled savings estimates

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 seeWhat it meansWhat to do
A run fails with AccessDenied when it assumes a roleThe 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 InvalidClientTokenIdHypermeter cannot sign in to its own AWS account.Contact Exivity support.
An account has no metricsThe account is outside the OUs of the StackSet, so it has no HypermeterMemberRole.Add the OU to the StackSet.
The management account has no metricsA 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 metricsThe CUR export does not include resource IDs.Turn on resource IDs in the export.
Instances have no memory valuesThe 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 emptyCompute 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_WINDOWThe 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 highThe Cost Explorer workflow runs too often.Schedule it weekly.

If a run fails for another reason, see Troubleshooting run failures.