# EmptyDirVolume

A Kubernetes EmptyDir volume.

Extends: [EksVolume](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.EksVolume.html) › EmptyDirVolume
Obtainable from: [EksVolume.emptyDir](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.EksVolume.html#emptydir)

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

## Example

TypeScript:

```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,
});
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_batch as batch

# size: cdk.Size

empty_dir_volume = batch.EmptyDirVolume(
    name="name",

    # the properties below are optional
    medium=batch.EmptyDirMediumType.DISK,
    mount_path="mountPath",
    readonly=False,
    size_limit=size
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.batch.*;

Size size;

EmptyDirVolume emptyDirVolume = EmptyDirVolume.Builder.create()
        .name("name")

        // the properties below are optional
        .medium(EmptyDirMediumType.DISK)
        .mountPath("mountPath")
        .readonly(false)
        .sizeLimit(size)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.Batch;

Size size;

var emptyDirVolume = new EmptyDirVolume(new EmptyDirVolumeOptions {
    Name = "name",

    // the properties below are optional
    Medium = EmptyDirMediumType.DISK,
    MountPath = "mountPath",
    Readonly = false,
    SizeLimit = size
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var size Size

emptyDirVolume := awscdk.Aws_batch.NewEmptyDirVolume(&EmptyDirVolumeOptions{
	Name: jsii.String("name"),

	// the properties below are optional
	Medium: awscdk.*Aws_batch.EmptyDirMediumType_DISK,
	MountPath: jsii.String("mountPath"),
	Readonly: jsii.Boolean(false),
	SizeLimit: size,
})
```

## Initializer

TypeScript:

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

Python:

```python
EmptyDirVolume(options: EmptyDirVolumeOptions)
```

Java:

```java
new EmptyDirVolume(EmptyDirVolumeOptions options)
```

C# / .NET:

```csharp
new EmptyDirVolume(EmptyDirVolumeOptions options)
```

Golang:

```go
NewEmptyDirVolume(Options EmptyDirVolumeOptions)
```

## Properties

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

  **Default:** the container is not mounted

- `medium`: [EmptyDirMediumType](https://docs.aws.amazon.com/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](https://docs.aws.amazon.com/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.
