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, IResourceWithPolicyV2, IResource, IEnvironmentAware, IConstruct, IDependable
Syntax (vb)
Public Class FileSystem Inherits Resource Implements IFileSystem, IConnectable, IResourceWithPolicy, IResourceWithPolicyV2, IResource, IEnvironmentAware, IConstruct, IDependable
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(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. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
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, params 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(Construct, string, IFileSystemProps)
Constructor for creating a new EFS FileSystem.
public FileSystem(Construct scope, string id, IFileSystemProps props)
Parameters
- scope Construct
- id string
- props IFileSystemProps
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
Properties
Connections
The security groups/rules used to allow network connections to the file system.
public virtual Connections_ Connections { get; }
Property Value
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
DEFAULT_PORT
The default port File System listens on.
public static double DEFAULT_PORT { get; }
Property Value
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
FileSystemArn
The ARN of the file system.
public virtual string FileSystemArn { get; }
Property Value
Remarks
Attribute: true
FileSystemId
The ID of the file system, assigned by Amazon EFS.
public virtual string FileSystemId { get; }
Property Value
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
IDependable
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
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
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
Methods
AddAccessPoint(string, IAccessPointOptions?)
create access point from this filesystem.
public virtual AccessPoint AddAccessPoint(string id, IAccessPointOptions? accessPointOptions = null)
Parameters
- id string
- accessPointOptions IAccessPointOptions
Returns
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
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 Construct
- id string
- attrs IFileSystemAttributes
Returns
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
Grant(IGrantable, params 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 string[]
The actions to grant.
Returns
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
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
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
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
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
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
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