# EmptyDirVolume

A Kubernetes EmptyDir volume.

Extends: EksVolume › EmptyDirVolume

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

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_batch as batch } from 'aws-cdk-lib';

declare const size: cdk.Size;
const emptyDirVolume = new batch.EmptyDirVolume({
  name: 'name',

  // the properties below are optional
  medium: batch.EmptyDirMediumType.DISK,
  mountPath: 'mountPath',
  readonly: false,
  sizeLimit: size,
});
```

## Initializer

```ts
new EmptyDirVolume(options: EmptyDirVolumeOptions)
```

## Properties

- `containerPath`: string — The path on the container where the container is mounted.

  **Default:** the container is not mounted

- `medium`: [EmptyDirMediumType](/cdk/api/v2/docs/aws-cdk-lib.aws_batch.EmptyDirMediumType.html) = `EmptyDirMediumType.DISK` — The storage type to use for this Volume.

- `name`: string — The name of this volume.

  The name must be a valid DNS subdomain name.

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

  Otherwise, the container has read/write access.

- `sizeLimit`: [Size](/cdk/api/v2/docs/aws-cdk-lib.Size.html) — The maximum size for this Volume.

  **Default:** no size limit

## Methods

- `emptyDir(options: EmptyDirVolumeOptions): EmptyDirVolume // chainable` (static) — Creates a Kubernetes EmptyDir volume.

- `hostPath(options: HostPathVolumeOptions): HostPathVolume` (static) — Creates a Kubernetes HostPath volume.

- `isEmptyDirVolume(x: any): boolean` (static) — Returns `true` if `x` is an EmptyDirVolume, `false` otherwise.

- `secret(options: SecretPathVolumeOptions): SecretPathVolume` (static) — Creates a Kubernetes Secret volume.
