Enable AWS cost attribution system#
The AWS cost attribution system, referenced as the system in this document,
consists of the aws-ce-grafana-backend
Helm chart and a Grafana dashboard
using the backend as a data source.
Checkout the docs at Cost Attribution System for more information on the system.
Steps#
2. (optional) Backfill billing data#
You can optionally backfill billing data to tags having been around for a while but not enabled as cost allocation tags.
You can request this to be done once a day, and it takes a several hours to process the request. Make a request through the AWS web console by navigating to “Cost allocation tags” under “Billing and Cost Management”, then from there click the “Backfill tags” button.
3. Install aws-ce-grafana-backend
#
In the cluster’s terraform variables, make sure the following is present:
enable_aws_ce_grafana_backend_iam = true
After applying this, look at the terraform output named aws_ce_grafana_backend_k8s_sa_annotation
:
terraform output -raw aws_ce_grafana_backend_k8s_sa_annotation
Open the cluster’s support.values.yaml file and update add a section like below,
updating clusterName
and add the annotation (key and value) from the terraform
output.
aws-ce-grafana-backend:
enabled: true
envBasedConfig:
clusterName: <declare cluster name to the value of cluster_name in the cluster's .tfvars file>
serviceAccount:
annotations:
<declare annotation key and value here>
Finally deploy the support chart:
deployer deploy-support $CLUSTER_NAME
Troubleshooting#
If you don’t see data in the cost attribution dashboard, you may want to look to
ensure the aws-ce-grafana-backend
deployment’s pod is running in the support
namespace, or if it reports errors in its logs.