{{- if and .Values.externalSecrets.enabled .Values.externalSecrets.manageEDPInstallSecrets }}
{{- $secretStore := include "edp-install.secretStoreName" . }}
{{- $awsSecretName := .Values.externalSecrets.manageEDPInstallSecretsName }}
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: keycloak-client-headlamp-secret
spec:
  refreshInterval: 1h
  secretStoreRef:
    kind: SecretStore
    name: {{ $secretStore }}
  data:
  - secretKey: clientSecret
    remoteRef:
      key: {{ $awsSecretName }}
      property: keycloak-client-headlamp-secret
{{- end }}
