Interface IEfsVolumeOptions
Options for configuring an EfsVolume.
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IEfsVolumeOptions : IEcsVolumeOptions
Syntax (vb)
Public Interface IEfsVolumeOptions Inherits IEcsVolumeOptions
Remarks
ExampleMetadata: infused
Examples
IFileSystem myFileSystem;
Role myJobRole;
myFileSystem.GrantRead(myJobRole);
var jobDefn = new EcsJobDefinition(this, "JobDefn", new EcsJobDefinitionProps {
Container = new EcsEc2ContainerDefinition(this, "containerDefn", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest"),
Memory = Size.Mebibytes(2048),
Cpu = 256,
Volumes = new [] { EcsVolume.Efs(new EfsVolumeOptions {
Name = "myVolume",
FileSystem = myFileSystem,
ContainerPath = "/Volumes/myVolume",
UseJobRole = true
}) },
JobRole = myJobRole
})
});
Synopsis
Properties
| AccessPointId | The Amazon EFS access point ID to use. |
| EnableTransitEncryption | Enables encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. |
| FileSystem | The EFS File System that supports this volume. |
| RootDirectory | The directory within the Amazon EFS file system to mount as the root directory inside the host. |
| TransitEncryptionPort | The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. |
| UseJobRole | Whether or not to use the AWS Batch job IAM role defined in a job definition when mounting the Amazon EFS file system. |
Properties
AccessPointId
The Amazon EFS access point ID to use.
string? AccessPointId { get; }
Property Value
Remarks
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.
Default: - no accessPointId
See: https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html
EnableTransitEncryption
Enables encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server.
bool? EnableTransitEncryption { get; }
Property Value
bool?
Remarks
Default: false
See: https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html
FileSystem
The EFS File System that supports this volume.
IFileSystem FileSystem { get; }
Property Value
Remarks
ExampleMetadata: infused
RootDirectory
The directory within the Amazon EFS file system to mount as the root directory inside the host.
string? RootDirectory { get; }
Property Value
Remarks
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.
Default: - root of the EFS File System
TransitEncryptionPort
The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server.
double? TransitEncryptionPort { get; }
Property Value
Remarks
The value must be between 0 and 65,535.
Default: - chosen by the EFS Mount Helper
See: https://docs.aws.amazon.com/efs/latest/ug/efs-mount-helper.html
UseJobRole
Whether or not to use the AWS Batch job IAM role defined in a job definition when mounting the Amazon EFS file system.
bool? UseJobRole { get; }
Property Value
bool?
Remarks
If specified, enableTransitEncryption must be true.
Default: false
See: https://docs.aws.amazon.com/batch/latest/userguide/efs-volumes.html#efs-volume-accesspoints