AWS FOCUS export
Have AWS Data Exports write FOCUS 1.2 files to an S3 bucket, give Costfluent an IAM user that may only read them, and connect the bucket to Costfluent.
AWS Data Exports can write your cost as FOCUS files into an S3 bucket of yours, and Costfluent reads that bucket as a FOCUS bucket. It is the optional second path: Connect AWS is the recommended one, through a role Costfluent assumes, with no long-lived key to store. Connect one of the two, because each imports the same cost and the second counts it twice.
Before you start
- The Costfluent access under Prerequisites.
- An AWS account that may create a data export and an IAM user. A management account's export holds every member account; a member account's holds only that account.
- An S3 bucket for the export, or a name for a new one.
Turn on the export
- In the Billing and Cost Management console, choose "Data Exports", then "Create export".
- Under "Export type", choose "Standard data export", and enter an "Export name" of letters, digits, hyphens and underscores.
- Under "Data table configurations", choose the table "FOCUS 1.2 with AWS columns".
- Under "Data table delivery options", choose "gzip - text/csv" or "Parquet - Parquet" as the compression type and file format, and "Create new data export file" as the file versioning.
- Under "Data export storage settings", choose "Configure", select or create the bucket, and acknowledge the bucket policy Data Exports writes to it.
- Enter an "S3 path prefix", such as
focus, then choose "Create".
"Create new data export file" writes each delivery into a folder of its own, so Costfluent always reads one whole delivery. With "Overwrite existing data export file", a delivery replaces the previous one's files in place, and a sync in the middle of it could read files of both.
Create a read-only key
Costfluent reads the bucket with an IAM user whose policy allows only listing the bucket and reading
its objects. With the AWS CLI, save this policy as policy.json with your bucket's name:
Code
Then create the user, give it the policy, and create its access key:
Code
The last command prints the AccessKeyId and the SecretAccessKey, which AWS shows once.
Connect in Costfluent
- Open Settings, then Integrations, select FOCUS bucket, open the Connect tab and select Add access key.
- Choose Other S3-compatible storage as the Provider. Enter the bucket's regional endpoint
in Endpoint and its region in Region, such as
https://s3.eu-central-1.amazonaws.comandeu-central-1for a bucket in eu-central-1. - Enter the bucket's name in Bucket, and in Prefix the S3 path prefix, the export's name and
data, such asfocus/<export name>/data. - Enter the
AccessKeyIdin Access key ID and theSecretAccessKeyin Secret access key. - Select Test connection to see each check, or Connect to save.
You can connect before the first delivery: Costfluent accepts a prefix that holds no file yet.
How it behaves
- Data Exports refreshes the export at least once a day, until the billing period ends, and may update a closed month within the first two weeks after it.
- Each delivery holds the month so far, in a folder of its own below the month's
BILLING_PERIOD=YYYY-MMfolder. Costfluent reads the newest delivery of each month in each sync's window (Data and freshness). - Every delivery stays in the bucket, so it grows by one copy of the month so far with each delivery.
- Data Exports writes its manifests under
metadata, besidedata; with the prefix ending indata, Costfluent never sees them.
Troubleshooting
- The endpoint "is not the endpoint of the bucket". The Endpoint is not the bucket's
region's, such as
https://s3.us-east-1.amazonaws.comfor a bucket in eu-central-1. Enter the endpoint and the region of the bucket's own region. - AWS cost is counted twice. An AWS connection imports the same cost. Remove one of the two connections.
- Every other message: Troubleshooting on the FOCUS bucket page.