Skip to content
v2.273.0

EksVolume Class ​

A Volume that can be mounted to a container supported by EKS.

Example ​

ts
const jobDefn = new batch.EksJobDefinition(this, 'eksf2', {
  container: new batch.EksContainerDefinition(this, 'container', {
    image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
    volumes: [batch.EksVolume.emptyDir({
      name: 'myEmptyDirVolume',
      mountPath: '/mount/path',
      medium: batch.EmptyDirMediumType.MEMORY,
      readonly: true,
      sizeLimit: cdk.Size.mebibytes(2048),
    })],
  }),
});

Initializer ​

ts
new EksVolume(options: EksVolumeOptions)
python
EksVolume(options: EksVolumeOptions)
java
new EksVolume(EksVolumeOptions options)
csharp
new EksVolume(EksVolumeOptions options)
go
NewEksVolume(Options EksVolumeOptions)

Properties ​

containerPathstringcontainer_pathstrcontainerPathStringContainerPathstringContainerPath*string= the container is not mounted#
The path on the container where the container is mounted.
namestringnamestrnameStringNamestringName*stringrequired#
The name of this volume.

The name must be a valid DNS subdomain name.

readonlybooleanreadonlyboolreadonlyBooleanReadonlyboolReadonly*bool= false#
If specified, the container has readonly access to the volume.

Otherwise, the container has read/write access.

Methods ​

emptyDir(options: EmptyDirVolumeOptions): EmptyDirVolume@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.
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.