{{- if and ( .Values.localstack.enabled) (not .Values.localstack.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ printf "%s-%s" .Release.Name "localstack"  }}
  namespace: {{ .Release.Namespace | quote }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
    {{- end }}
    app.kubernetes.io/component: backend
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
  {{- end }}
type: Opaque
data:
  endpoint:  {{ "http://localhost:4566" | b64enc | quote }}
  bucketName: {{ "novu-local"  | b64enc | quote }}
  region: {{ "us-east-1" | b64enc | quote }}
  accessKey: {{ "test" | b64enc | quote }}
  secretKey: {{ "test" | b64enc | quote }}
{{- end }}
