class HostVolume
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Batch.HostVolume |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbatch#HostVolume |
Java | software.amazon.awscdk.services.batch.HostVolume |
Python | aws_cdk.aws_batch.HostVolume |
TypeScript (source) | aws-cdk-lib » aws_batch » HostVolume |
Extends
Ecs
Creates a Host volume.
This volume will persist on the host at the specified hostPath.
If the hostPath is not specified, Docker will choose the host path. In this case,
the data may not persist after the containers that use it stop running.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_batch as batch } from 'aws-cdk-lib';
const hostVolume = new batch.HostVolume({
containerPath: 'containerPath',
name: 'name',
// the properties below are optional
hostPath: 'hostPath',
readonly: false,
});
Initializer
new HostVolume(options: HostVolumeOptions)
Parameters
- options
HostVolume Options
Properties
| Name | Type | Description |
|---|---|---|
| container | string | The path on the container that this volume will be mounted to. |
| name | string | The name of this volume. |
| host | string | The path on the host machine this container will have access to. |
| readonly? | boolean | Whether or not the container has readonly access to this volume. |
containerPath
Type:
string
The path on the container that this volume will be mounted to.
name
Type:
string
The name of this volume.
hostPath?
Type:
string
(optional)
The path on the host machine this container will have access to.
readonly?
Type:
boolean
(optional, default: false)
Whether or not the container has readonly access to this volume.
Methods
| Name | Description |
|---|---|
| static is | returns true if x is a HostVolume, false otherwise. |
static isHostVolume(x)
public static isHostVolume(x: any): boolean
Parameters
- x
any
Returns
boolean
returns true if x is a HostVolume, false otherwise.

.NET
Go
Java
Python
TypeScript (