{{- $reportingValues :=  index .Values "openshift-reporting" -}}
{{- if $reportingValues.spec.awsBillingReportDataSource.enabled }}
---
apiVersion: metering.openshift.io/v1
kind: ReportDataSource
metadata:
  name: "aws-billing"
  labels:
    operator-metering: "true"
spec:
  awsBilling:
    source:
      bucket: "{{ $reportingValues.spec.awsBillingReportDataSource.bucket }}"
      prefix: "{{ $reportingValues.spec.awsBillingReportDataSource.prefix }}"
      region: "{{ $reportingValues.spec.awsBillingReportDataSource.region }}"

---

apiVersion: metering.openshift.io/v1
kind: ReportDataSource
metadata:
  name: "aws-ec2-billing-data-raw"
  labels:
    operator-metering: "true"
spec:
  reportQueryView:
    queryName: "aws-ec2-billing-data-raw"
{{- end }}
