class EksVolume
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Batch.EksVolume |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbatch#EksVolume |
Java | software.amazon.awscdk.services.batch.EksVolume |
Python | aws_cdk.aws_batch.EksVolume |
TypeScript (source) | aws-cdk-lib » aws_batch » EksVolume |
Implemented by
Empty
, Host
, Secret
A Volume that can be mounted to a container supported by EKS.
Example
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
new EksVolume(options: EksVolumeOptions)
Parameters
- options
Eks
Volume Options
Properties
Name | Type | Description |
---|---|---|
name | string | The name of this volume. |
container | string | The path on the container where the container is mounted. |
readonly? | boolean | If specified, the container has readonly access to the volume. |
name
Type:
string
The name of this volume.
The name must be a valid DNS subdomain name.
See also: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
containerPath?
Type:
string
(optional, default: the container is not mounted)
The path on the container where the container is mounted.
readonly?
Type:
boolean
(optional, default: false)
If specified, the container has readonly access to the volume.
Otherwise, the container has read/write access.
Methods
Name | Description |
---|---|
static empty | Creates a Kubernetes EmptyDir volume. |
static host | Creates a Kubernetes HostPath volume. |
static secret(options) | Creates a Kubernetes Secret volume. |
Dir(options)
static emptypublic static emptyDir(options: EmptyDirVolumeOptions): EmptyDirVolume
Parameters
- options
Empty
Dir Volume Options
Returns
Creates a Kubernetes EmptyDir volume.
See also: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
Path(options)
static hostpublic static hostPath(options: HostPathVolumeOptions): HostPathVolume
Parameters
- options
Host
Path Volume Options
Returns
Creates a Kubernetes HostPath volume.
See also: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
static secret(options)
public static secret(options: SecretPathVolumeOptions): SecretPathVolume
Parameters
- options
Secret
Path Volume Options
Returns
Creates a Kubernetes Secret volume.
See also: https://kubernetes.io/docs/concepts/storage/volumes/#secret