Class FileSystem
The Elastic File System implementation of IFileSystem.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EFS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class FileSystem : Resource, IFileSystem, IConnectable, IResourceWithPolicy, IResource
Syntax (vb)
Public Class FileSystem
Inherits Resource
Implements IFileSystem, IConnectable, IResourceWithPolicy, IResource
Remarks
It creates a new, empty file system in Amazon Elastic File System (Amazon EFS). It also creates mount target (AWS::EFS::MountTarget) implicitly to mount the EFS file system on an Amazon Elastic Compute Cloud (Amazon EC2) instance or another resource.
See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html
Resource: AWS::EFS::FileSystem
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.IAM;
var role = new Role(this, "ClientRole", new RoleProps {
AssumedBy = new AnyPrincipal()
});
var fileSystem = new FileSystem(this, "MyEfsFileSystem", new FileSystemProps {
Vpc = new Vpc(this, "VPC"),
AllowAnonymousAccess = true
});
fileSystem.GrantRead(role);
Synopsis
Constructors
FileSystem(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
FileSystem(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
FileSystem(Construct, String, IFileSystemProps) | Constructor for creating a new EFS FileSystem. |
Properties
Connections | The security groups/rules used to allow network connections to the file system. |
DEFAULT_PORT | The default port File System listens on. |
FileSystemArn | The ARN of the file system. |
FileSystemId | The ID of the file system, assigned by Amazon EFS. |
MountTargetsAvailable | Dependable that can be depended upon to ensure the mount targets of the filesystem are ready. |
Methods
AddAccessPoint(String, IAccessPointOptions) | create access point from this filesystem. |
AddToResourcePolicy(PolicyStatement) | Adds a statement to the resource policy associated with this file system. |
FromFileSystemAttributes(Construct, String, IFileSystemAttributes) | Import an existing File System from the given properties. |
Grant(IGrantable, String[]) | Grant the actions defined in actions to the given grantee on this File System resource. |
GrantRead(IGrantable) | Grant read permissions for this file system to an IAM principal. |
GrantReadWrite(IGrantable) | Grant read and write permissions for this file system to an IAM principal. |
GrantRootAccess(IGrantable) | As root user, grant read and write permissions for this file system to an IAM principal. |
Constructors
FileSystem(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected FileSystem(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
FileSystem(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected FileSystem(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
FileSystem(Construct, String, IFileSystemProps)
Constructor for creating a new EFS FileSystem.
public FileSystem(Construct scope, string id, IFileSystemProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IFileSystemProps
Properties
Connections
The security groups/rules used to allow network connections to the file system.
public virtual Connections_ Connections { get; }
Property Value
DEFAULT_PORT
The default port File System listens on.
public static double DEFAULT_PORT { get; }
Property Value
System.Double
FileSystemArn
The ARN of the file system.
public virtual string FileSystemArn { get; }
Property Value
System.String
Remarks
Attribute: true
FileSystemId
The ID of the file system, assigned by Amazon EFS.
public virtual string FileSystemId { get; }
Property Value
System.String
Remarks
Attribute: true
MountTargetsAvailable
Dependable that can be depended upon to ensure the mount targets of the filesystem are ready.
public virtual IDependable MountTargetsAvailable { get; }
Property Value
Constructs.IDependable
Methods
AddAccessPoint(String, IAccessPointOptions)
create access point from this filesystem.
public virtual AccessPoint AddAccessPoint(string id, IAccessPointOptions accessPointOptions = null)
Parameters
- id System.String
- accessPointOptions IAccessPointOptions
Returns
AddToResourcePolicy(PolicyStatement)
Adds a statement to the resource policy associated with this file system.
public virtual IAddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
The policy statement to add.
Returns
Remarks
A resource policy will be automatically created upon the first call to addToResourcePolicy
.
Note that this does not work with imported file systems.
FromFileSystemAttributes(Construct, String, IFileSystemAttributes)
Import an existing File System from the given properties.
public static IFileSystem FromFileSystemAttributes(Construct scope, string id, IFileSystemAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IFileSystemAttributes
Returns
Grant(IGrantable, String[])
Grant the actions defined in actions to the given grantee on this File System resource.
public virtual Grant Grant(IGrantable grantee, params string[] actions)
Parameters
- grantee IGrantable
Principal to grant right to.
- actions System.String[]
The actions to grant.
Returns
GrantRead(IGrantable)
Grant read permissions for this file system to an IAM principal.
public virtual Grant GrantRead(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant read to.
Returns
GrantReadWrite(IGrantable)
Grant read and write permissions for this file system to an IAM principal.
public virtual Grant GrantReadWrite(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant read and write to.
Returns
GrantRootAccess(IGrantable)
As root user, grant read and write permissions for this file system to an IAM principal.
public virtual Grant GrantRootAccess(IGrantable grantee)
Parameters
- grantee IGrantable
The principal to grant root access to.
Returns