{{- if and .Values.aws.secret_key .Values.aws.access_key -}}
apiVersion: v1
kind: Secret
metadata:
  labels:
    app: {{ template "kube2iam.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "kube2iam.fullname" . }}
type: Opaque
data:
  aws_access_key_id: {{ .Values.aws.access_key | b64enc | quote }}
  aws_secret_access_key: {{ .Values.aws.secret_key | b64enc | quote }}
{{- end }}
