Show / Hide Table of Contents

Class EfsVolumeOptions

Options for configuring an EfsVolume.

Inheritance
object
EfsVolumeOptions
Implements
IEfsVolumeOptions
IEcsVolumeOptions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EfsVolumeOptions : IEfsVolumeOptions, IEcsVolumeOptions
Syntax (vb)
Public Class EfsVolumeOptions Implements IEfsVolumeOptions, 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

Constructors

EfsVolumeOptions()

Options for configuring an EfsVolume.

Properties

AccessPointId

The Amazon EFS access point ID to use.

ContainerPath

the path on the container where this volume is mounted.

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.

Name

the name of this volume.

Readonly

if set, the container will have readonly access to the 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.

Constructors

EfsVolumeOptions()

Options for configuring an EfsVolume.

public EfsVolumeOptions()
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
                })
            });

Properties

AccessPointId

The Amazon EFS access point ID to use.

public string? AccessPointId { get; set; }
Property Value

string

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

ContainerPath

the path on the container where this volume is mounted.

public string ContainerPath { get; set; }
Property Value

string

Remarks

ExampleMetadata: infused

EnableTransitEncryption

Enables encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server.

public bool? EnableTransitEncryption { get; set; }
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.

public IFileSystem FileSystem { get; set; }
Property Value

IFileSystem

Remarks

ExampleMetadata: infused

Name

the name of this volume.

public string Name { get; set; }
Property Value

string

Remarks

ExampleMetadata: infused

Readonly

if set, the container will have readonly access to the volume.

public bool? Readonly { get; set; }
Property Value

bool?

Remarks

Default: false

RootDirectory

The directory within the Amazon EFS file system to mount as the root directory inside the host.

public string? RootDirectory { get; set; }
Property Value

string

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.

public double? TransitEncryptionPort { get; set; }
Property Value

double?

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.

public bool? UseJobRole { get; set; }
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

Implements

IEfsVolumeOptions
IEcsVolumeOptions
Back to top Generated by DocFX