# SecretPathVolumeOptions

Options for a Kubernetes SecretPath Volume.

Extends: SecretPathVolumeOptions
Extends: EksVolumeOptions

- Source: [`aws-batch/lib/eks-container-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.273.0/packages/aws-cdk-lib/aws-batch/lib/eks-container-definition.ts#L869)
- Type last changed: v2.96.0 · 13 Sep 2023

## Example

```ts
declare const jobDefn: batch.EksJobDefinition;
jobDefn.container.addVolume(batch.EksVolume.emptyDir({
  name: 'emptyDir',
  mountPath: '/Volumes/emptyDir',
}));
jobDefn.container.addVolume(batch.EksVolume.hostPath({
  name: 'hostPath',
  hostPath: '/sys',
  mountPath: '/Volumes/hostPath',
}));
jobDefn.container.addVolume(batch.EksVolume.secret({
  name: 'secret',
  optional: true,
  mountPath: '/Volumes/secret',
  secretName: 'mySecret',
}));
```

## Properties

- `mountPath`: string = the volume is not mounted — The path on the container where the volume is mounted.

- `name`: string (required) — The name of this volume.

  The name must be a valid DNS subdomain name.

- `optional`: boolean = true — Specifies whether the secret or the secret's keys must be defined.

- `readonly`: boolean = false — If specified, the container has readonly access to the volume.

  Otherwise, the container has read/write access.

- `secretName`: string (required) — The name of the secret.

  Must be a valid DNS subdomain name.

## Used as props by

- [`SecretPathVolume`](/v2/docs/aws-cdk-lib.aws_batch.SecretPathVolume)
