---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: my-env-config
spec:
  secretStoreRef:
    kind: SecretStore
    name: staging
  target:
    creationPolicy: Owner
  data:
  - secretKey: MY_ENV_VAR1
    remoteRef:
      key: my-env-config
      property: MY_ENV_VAR1
  - secretKey: MY_ENV_VAR2
    remoteRef:
      key: my-env-config
      property: MY_ENV_VAR2
  # OR
  dataFrom:
  - extract:
      key: my-env-config
      property: MY_ENV_VAR1  # optional field Label to match exactly
  # OR
  - find:
      path: my-env-config  # optional Item Title to match exactly
      name:
        regexp: "^MY_ENV_VAR.*"
