Skip to content

Get usage data for metered service dimensions

What we're after

The services in #3285 are all gathered from querying CAPI. They are billed based on their presence or absence — i.e. the user is billed for the period of time they are running. "Metered" services are billed based on a different usage dimension than present/absent. For example:

  • RDS disk size is billed based on GB allocated over time — GB-month. This information is available in the service parameters or in AWS.
  • S3 buckets are billed based on GB storage consumed — also GB-month. This information is available in AWS.
  • SES is billed by emails sent over a given period of time.

The goal of this issue is to read usage information from these services.


Further context for those unfamiliar with what we're doing

Security considerations

Getting usage information for some services will require interconnection with, and authentication to, AWS.

Notes for implementers

  • This likely requires enqueuing additional work after taking the preliminary readings. I.e. we read an S3 bucket from CAPI and enqueue a job to read further data from AWS.
    • Alternatively, we could read data directly from AWS based on tags, but we probably want to use CAPI as the source of truth — basically, "left join" CAPI and AWS data.
  • Like the CAPI ticket, bulk requests will be our friend here. N+1 will kill performance.

Related issues/sub-projects

  • #3285