# Storing s3 accessKeyID and secretAccessKey securely

**URL:** <https://community.grafana.com/t/storing-s3-accesskeyid-and-secretaccesskey-securely/92133>\
**Category:** Grafana Loki\
**Tags:** helm, configuration, kubernetes\
**Created:** [July 24, 2023, 6:01pm UTC](https://community.grafana.com/t/storing-s3-accesskeyid-and-secretaccesskey-securely/92133 "2023-07-24T18:01:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![hibaos](https://avatars.discourse-cdn.com/v4/letter/h/7cd45c/32.png) [@hibaos](https://community.grafana.com/u/hibaos)\
**Post date:** [July 28, 2023, 12:35pm UTC](https://community.grafana.com/t/storing-s3-accesskeyid-and-secretaccesskey-securely/92133/3 "2023-07-28T12:35:33Z")

</div>

Thanks @b0b!

I have now something like this in my Helm values file for deploying Loki and it works nicely 🙂

```auto
loki:
  ...
  storage:
    ...
    s3:
      endpoint: "${GRAFANA-LOKI-S3-ENDPOINT}"
      accessKeyId: "${GRAFANA-LOKI-S3-ACCESKEYID}"
      secretAccessKey: "${GRAFANA-LOKI-S3-SECRETACCESSKEY}"
      ...
backend:
  ...
  extraArgs:
    - '-config.expand-env=true'
  extraEnv:
    - name: GRAFANA-LOKI-S3-ENDPOINT 
      valueFrom:
        secretKeyRef:
          name: loki-secrets
          key: grafana-loki-s3-endpoint
    - name: GRAFANA-LOKI-S3-ACCESKEYID 
      valueFrom:
        secretKeyRef:
          name: loki-secrets
          key: grafana-loki-s3-accessKeyId
    - name: GRAFANA-LOKI-S3-SECRETACCESSKEY
      valueFrom:
        secretKeyRef:
          name: loki-secrets
          key: grafana-loki-s3-secretAccessKey
  ...

```

---

_[View the full topic](https://community.grafana.com/t/storing-s3-accesskeyid-and-secretaccesskey-securely/92133)._
