> ## Documentation Index
> Fetch the complete documentation index at: https://sariva.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS SSM Parameter Store

> Store Kafka admin and observability credentials as SecureString parameters with separate CI and runtime permissions.

> [!NOTE]
>
> Written for the EKS paths, where the pod's AWS identity reads the parameter. The VM path's documented route is [`file://` or `env://`](https://sariva.mintlify.site/connecting-clusters/file-env). On a VM the code would read SSM Parameter Store with the VM's own AWS credentials (for example an EC2 instance role), but that is not yet proven live.

Use this page when Kafka credentials for a cluster live in AWS SSM Parameter Store.

There are two different parameter leaves:

| Leaf | Used by | Who can read it |
| - | - | - |
| `/<stage>/<env>/clusters/<cluster>/kafka-admin` | GitHub Actions / Terraform | GitHub Actions OIDC role only |
| `/<stage>/<env>/clusters/<cluster>/observability-reader` | Sariva runtime monitoring | Sariva pod AWS identity only |

⚠WARNING

Do not grant the Sariva platform pod access to the `kafka-admin` parameter. The pod reads only `observability-reader` at runtime.

## Admin Kafka key — customer-created

```bash theme={null}
aws ssm put-parameter \
  --region <region> \
  --name /<stage>/<env>/clusters/<cluster>/kafka-admin \
  --type SecureString \
  --description "Terraform admin Kafka credential for <cluster>" \
  --value '{"api_key":"<admin-kafka-api-key>","api_secret":"<admin-kafka-api-secret>"}'
```

GitHub Actions reads this parameter during Terraform apply. The pod does not.

## Observability key — Sariva-created path

Ask Sariva to create the observability credential and store it in AWS SSM:

```text theme={null}
@sariva-platform create observability credential for cluster <cluster>, store in AWS SSM
```

Sariva opens a GitOps PR. GitHub Actions applies Terraform and writes the runtime credential to:

```text theme={null}
/<stage>/<env>/clusters/<cluster>/observability-reader
```

The parameter value is a single JSON object:

```json theme={null}
{
  "api_key": "<observability-kafka-api-key>",
  "api_secret": "<observability-kafka-api-secret>"
}
```

⚠WARNING

The resolver expects the single-parameter JSON shape above. Multi-parameter shapes such as `<path>/api_key` and `<path>/api_secret` are not supported.

## Runtime read permission

Grant the pod AWS identity read access only to the observability leaf:

```json theme={null}
{
  "Sid": "ReadKafkaObservabilityParameter",
  "Effect": "Allow",
  "Action": ["ssm:GetParameter"],
  "Resource": "arn:aws:ssm:<region>:<account>:parameter/<stage>/*/clusters/*/observability-reader"
}
```

If the parameter uses a customer-managed KMS key, also grant `kms:Decrypt` on that key.

## Attach the credential reference

After the parameter exists and the pod can read it, patch the Kafka cluster if the watcher did not already attach the reference:

```bash theme={null}
sariva cluster patch \
  --alias <cluster> \
  --credentials-ref arn:aws:ssm:<region>:<account>:parameter/<stage>/<env>/clusters/<cluster>/observability-reader \
  --api-url "$SARIVA_PLATFORM_URL"
```

## Gate failures

| Reason code | Cause | Fix |
| - | - | - |
| `credentials_resolve_failed: AccessDeniedException` | Missing `ssm:GetParameter` or `kms:Decrypt` | Verify both statements are present |
| `credentials_resolve_failed: ParameterNotFound` | Path typo, wrong region | `aws ssm get-parameter --name <path>` |
| `credentials_payload_shape_mismatch` | Value is not valid JSON, or missing keys | Use the single-parameter JSON shape |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.