EfsVolume Class
A Volume that uses an AWS Elastic File System (EFS);
this volume can grow and shrink as needed
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';
import { aws_efs as interfaces_efs } from 'aws-cdk-lib/interfaces';
declare const fileSystemRef: interfaces_efs.IFileSystemRef;
const efsVolume = new batch.EfsVolume({
containerPath: 'containerPath',
fileSystem: fileSystemRef,
name: 'name',
// the properties below are optional
accessPointId: 'accessPointId',
enableTransitEncryption: false,
readonly: false,
rootDirectory: 'rootDirectory',
transitEncryptionPort: 123,
useJobRole: false,
});
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_batch as batch
from aws_cdk.interfaces import aws_efs as interfaces_efs
# file_system_ref: interfaces_efs.IFileSystemRef
efs_volume = batch.EfsVolume(
container_path="containerPath",
file_system=file_system_ref,
name="name",
# the properties below are optional
access_point_id="accessPointId",
enable_transit_encryption=False,
readonly=False,
root_directory="rootDirectory",
transit_encryption_port=123,
use_job_role=False
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.batch.*;
import software.amazon.awscdk.interfaces.efs.*;
IFileSystemRef fileSystemRef;
EfsVolume efsVolume = EfsVolume.Builder.create()
.containerPath("containerPath")
.fileSystem(fileSystemRef)
.name("name")
// the properties below are optional
.accessPointId("accessPointId")
.enableTransitEncryption(false)
.readonly(false)
.rootDirectory("rootDirectory")
.transitEncryptionPort(123)
.useJobRole(false)
.build();
// 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.AWS.Batch;
using Amazon.CDK.Interfaces.EFS;
IFileSystemRef fileSystemRef;
var efsVolume = new EfsVolume(new EfsVolumeOptions {
ContainerPath = "containerPath",
FileSystem = fileSystemRef,
Name = "name",
// the properties below are optional
AccessPointId = "accessPointId",
EnableTransitEncryption = false,
Readonly = false,
RootDirectory = "rootDirectory",
TransitEncryptionPort = 123,
UseJobRole = false
});
// 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 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var fileSystemRef IFileSystemRef
efsVolume := awscdk.Aws_batch.NewEfsVolume(&EfsVolumeOptions{
ContainerPath: jsii.String("containerPath"),
FileSystem: fileSystemRef,
Name: jsii.String("name"),
// the properties below are optional
AccessPointId: jsii.String("accessPointId"),
EnableTransitEncryption: jsii.Boolean(false),
Readonly: jsii.Boolean(false),
RootDirectory: jsii.String("rootDirectory"),
TransitEncryptionPort: jsii.Number(123),
UseJobRole: jsii.Boolean(false),
})
Initializer
new EfsVolume(options: EfsVolumeOptions)
EfsVolume(options: EfsVolumeOptions)
new EfsVolume(EfsVolumeOptions options)
new EfsVolume(EfsVolumeOptions options)
NewEfsVolume(Options EfsVolumeOptions)
Properties
accessPointIdmay be undefinedstringaccess_point_idmay be undefinedstraccessPointIdmay be undefinedStringAccessPointIdmay be undefinedstringAccessPointIdmay be undefined*string#Default: no accessPointId
If an access point is specified, rootDirectory must either be omitted or set to / which enforces the path set on the EFS access point. If an access point is used, enableTransitEncryption must be true.
enableTransitEncryptionmay be undefinedbooleanenable_transit_encryptionmay be undefinedboolenableTransitEncryptionmay be undefinedBooleanEnableTransitEncryptionmay be undefinedboolEnableTransitEncryptionmay be undefined*bool= false#fileSystemIFileSystemfile_systemIFileSystemfileSystemIFileSystemFileSystemIFileSystemFileSystemIFileSystem#readonlymay be undefinedbooleanreadonlymay be undefinedboolreadonlymay be undefinedBooleanReadonlymay be undefinedboolReadonlymay be undefined*bool= false#rootDirectorymay be undefinedstringroot_directorymay be undefinedstrrootDirectorymay be undefinedStringRootDirectorymay be undefinedstringRootDirectorymay be undefined*string#Default: root of the EFS File System
If this parameter is omitted, the root of the Amazon EFS volume is used instead. Specifying / has the same effect as omitting this parameter. The maximum length is 4,096 characters.
transitEncryptionPortmay be undefinednumbertransit_encryption_portmay be undefinedint | floattransitEncryptionPortmay be undefinedNumberTransitEncryptionPortmay be undefineddoubleTransitEncryptionPortmay be undefined*float64#Default: chosen by the EFS Mount Helper
The value must be between 0 and 65,535.
useJobRolemay be undefinedbooleanuse_job_rolemay be undefinedbooluseJobRolemay be undefinedBooleanUseJobRolemay be undefinedboolUseJobRolemay be undefined*bool= false#If specified, enableTransitEncryption must be true.
Methods
efs(options: EfsVolumeOptions): EfsVolume // chainable@staticmethod def efs(options: EfsVolumeOptions) -> EfsVolumepublic static EfsVolume efs(EfsVolumeOptions options)public static EfsVolume Efs(EfsVolumeOptions options)func Efs(Options EfsVolumeOptions) EfsVolumestatic#this volume can grow and shrink as needed
host(options: HostVolumeOptions): HostVolume@staticmethod def host(options: HostVolumeOptions) -> HostVolumepublic static HostVolume host(HostVolumeOptions options)public static HostVolume Host(HostVolumeOptions options)func Host(Options HostVolumeOptions) HostVolumestatic#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.
isEfsVolume(x: any): boolean@staticmethod def is_efs_volume(x: Any) -> boolpublic static Boolean isEfsVolume(Object x)public static bool IsEfsVolume(object x)func IsEfsVolume(X interface{}) *boolstatic#