{{- $operatorValues :=  index .Values "reporting-operator" -}}
{{- if $operatorValues.spec.config.aws.createSecret -}}
apiVersion: v1
kind: Secret
metadata:
  name: reporting-operator-aws-credentials
  labels:
    app: reporting-operator
type: Opaque
data:
{{- if $operatorValues.spec.config.aws.accessKeyID }}
  aws-access-key-id: {{ $operatorValues.spec.config.aws.accessKeyID | b64enc | quote}}
{{- end}}
{{- if $operatorValues.spec.config.aws.secretAccessKey }}
  aws-secret-access-key: {{ $operatorValues.spec.config.aws.secretAccessKey | b64enc | quote}}
{{- end}}
{{- end -}}
