Skip to content
v2.274.0

EmptyDirVolume Class ​

A Kubernetes EmptyDir volume.

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,
});
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
// 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();
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
});
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 ​

ts
new EmptyDirVolume(options: EmptyDirVolumeOptions)
python
EmptyDirVolume(options: EmptyDirVolumeOptions)
java
new EmptyDirVolume(EmptyDirVolumeOptions options)
csharp
new EmptyDirVolume(EmptyDirVolumeOptions options)
go
NewEmptyDirVolume(Options EmptyDirVolumeOptions)

Properties ​

containerPathmay be undefinedstringcontainer_pathmay be undefinedstrcontainerPathmay be undefinedStringContainerPathmay be undefinedstringContainerPathmay be undefined*string#
The path on the container where the container is mounted.

Default: the container is not mounted

mediummay be undefinedEmptyDirMediumTypemediummay be undefinedEmptyDirMediumTypemediummay be undefinedEmptyDirMediumTypeMediummay be undefinedEmptyDirMediumTypeMediummay be undefinedEmptyDirMediumType= `EmptyDirMediumType.DISK`#
The storage type to use for this Volume.
namestringnamestrnameStringNamestringName*stringrequired#
The name of this volume.

The name must be a valid DNS subdomain name.

readonlymay be undefinedbooleanreadonlymay be undefinedboolreadonlymay be undefinedBooleanReadonlymay be undefinedboolReadonlymay be undefined*bool= false#
If specified, the container has readonly access to the volume.

Otherwise, the container has read/write access.

sizeLimitmay be undefinedSizesize_limitmay be undefinedSizesizeLimitmay be undefinedSizeSizeLimitmay be undefinedSizeSizeLimitmay be undefinedSize#
The maximum size for this Volume.

Default: no size limit

Methods ​

emptyDir(options: EmptyDirVolumeOptions): EmptyDirVolume // chainable@staticmethod def empty_dir(options: EmptyDirVolumeOptions) -> EmptyDirVolumepublic static EmptyDirVolume emptyDir(EmptyDirVolumeOptions options)public static EmptyDirVolume EmptyDir(EmptyDirVolumeOptions options)func EmptyDir(Options EmptyDirVolumeOptions) EmptyDirVolumestatic#
Creates a Kubernetes EmptyDir volume.
hostPath(options: HostPathVolumeOptions): HostPathVolume@staticmethod def host_path(options: HostPathVolumeOptions) -> HostPathVolumepublic static HostPathVolume hostPath(HostPathVolumeOptions options)public static HostPathVolume HostPath(HostPathVolumeOptions options)func HostPath(Options HostPathVolumeOptions) HostPathVolumestatic#
Creates a Kubernetes HostPath volume.
isEmptyDirVolume(x: any): boolean@staticmethod def is_empty_dir_volume(x: Any) -> boolpublic static Boolean isEmptyDirVolume(Object x)public static bool IsEmptyDirVolume(object x)func IsEmptyDirVolume(X interface{}) *boolstatic#
Returns `true` if `x` is an EmptyDirVolume, `false` otherwise.
secret(options: SecretPathVolumeOptions): SecretPathVolume@staticmethod def secret(options: SecretPathVolumeOptions) -> SecretPathVolumepublic static SecretPathVolume secret(SecretPathVolumeOptions options)public static SecretPathVolume Secret(SecretPathVolumeOptions options)func Secret(Options SecretPathVolumeOptions) SecretPathVolumestatic#
Creates a Kubernetes Secret volume.