Class FileSystem.Builder

java.lang.Object
software.amazon.awscdk.services.efs.FileSystem.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<FileSystem>
Enclosing class:
FileSystem

@Stability(Stable) public static final class FileSystem.Builder extends Object implements software.amazon.jsii.Builder<FileSystem>
A fluent builder for FileSystem.
  • Method Details

    • create

      @Stability(Stable) public static FileSystem.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of FileSystem.Builder.
    • vpc

      @Stability(Stable) public FileSystem.Builder vpc(IVpc vpc)
      VPC to launch the file system in.

      Parameters:
      vpc - VPC to launch the file system in. This parameter is required.
      Returns:
      this
    • allowAnonymousAccess

      @Stability(Stable) public FileSystem.Builder allowAnonymousAccess(Boolean allowAnonymousAccess)
      Allow access from anonymous client that doesn't use IAM authentication.

      Default: false when using `grantRead`, `grantWrite`, `grantRootAccess` or set `@aws-cdk/aws-efs:denyAnonymousAccess` feature flag, otherwise true

      Parameters:
      allowAnonymousAccess - Allow access from anonymous client that doesn't use IAM authentication. This parameter is required.
      Returns:
      this
    • enableAutomaticBackups

      @Stability(Stable) public FileSystem.Builder enableAutomaticBackups(Boolean enableAutomaticBackups)
      Whether to enable automatic backups for the file system.

      Default: false

      Parameters:
      enableAutomaticBackups - Whether to enable automatic backups for the file system. This parameter is required.
      Returns:
      this
    • encrypted

      @Stability(Stable) public FileSystem.Builder encrypted(Boolean encrypted)
      Defines if the data at rest in the file system is encrypted or not.

      Default: - If your application has the '@aws-cdk/aws-efs:defaultEncryptionAtRest' feature flag set, the default is true, otherwise, the default is false.

      Parameters:
      encrypted - Defines if the data at rest in the file system is encrypted or not. This parameter is required.
      Returns:
      this
    • fileSystemName

      @Stability(Stable) public FileSystem.Builder fileSystemName(String fileSystemName)
      The file system's name.

      Default: - CDK generated name

      Parameters:
      fileSystemName - The file system's name. This parameter is required.
      Returns:
      this
    • fileSystemPolicy

      @Stability(Stable) public FileSystem.Builder fileSystemPolicy(PolicyDocument fileSystemPolicy)
      File system policy is an IAM resource policy used to control NFS access to an EFS file system.

      Default: none

      Parameters:
      fileSystemPolicy - File system policy is an IAM resource policy used to control NFS access to an EFS file system. This parameter is required.
      Returns:
      this
    • kmsKey

      @Stability(Stable) public FileSystem.Builder kmsKey(IKey kmsKey)
      The KMS key used for encryption.

      This is required to encrypt the data at rest if

      Default: - if 'encrypted' is true, the default key for EFS (/aws/elasticfilesystem) is used

      Parameters:
      kmsKey - The KMS key used for encryption. This parameter is required.
      Returns:
      this
    • lifecyclePolicy

      @Stability(Stable) public FileSystem.Builder lifecyclePolicy(LifecyclePolicy lifecyclePolicy)
      A policy used by EFS lifecycle management to transition files to the Infrequent Access (IA) storage class.

      Default: - None. EFS will not transition files to the IA storage class.

      Parameters:
      lifecyclePolicy - A policy used by EFS lifecycle management to transition files to the Infrequent Access (IA) storage class. This parameter is required.
      Returns:
      this
    • oneZone

      @Stability(Stable) public FileSystem.Builder oneZone(Boolean oneZone)
      Whether this is a One Zone file system.

      If enabled, performanceMode must be set to GENERAL_PURPOSE and vpcSubnets cannot be set.

      Default: false

      Parameters:
      oneZone - Whether this is a One Zone file system. This parameter is required.
      Returns:
      this
    • outOfInfrequentAccessPolicy

      @Stability(Stable) public FileSystem.Builder outOfInfrequentAccessPolicy(OutOfInfrequentAccessPolicy outOfInfrequentAccessPolicy)
      A policy used by EFS lifecycle management to transition files from Infrequent Access (IA) storage class to primary storage class.

      Default: - None. EFS will not transition files from IA storage to primary storage.

      Parameters:
      outOfInfrequentAccessPolicy - A policy used by EFS lifecycle management to transition files from Infrequent Access (IA) storage class to primary storage class. This parameter is required.
      Returns:
      this
    • performanceMode

      @Stability(Stable) public FileSystem.Builder performanceMode(PerformanceMode performanceMode)
      The performance mode that the file system will operate under.

      An Amazon EFS file system's performance mode can't be changed after the file system has been created. Updating this property will replace the file system.

      Default: PerformanceMode.GENERAL_PURPOSE

      Parameters:
      performanceMode - The performance mode that the file system will operate under. This parameter is required.
      Returns:
      this
    • provisionedThroughputPerSecond

      @Stability(Stable) public FileSystem.Builder provisionedThroughputPerSecond(Size provisionedThroughputPerSecond)
      Provisioned throughput for the file system.

      This is a required property if the throughput mode is set to PROVISIONED. Must be at least 1MiB/s.

      Default: - none, errors out

      Parameters:
      provisionedThroughputPerSecond - Provisioned throughput for the file system. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public FileSystem.Builder removalPolicy(RemovalPolicy removalPolicy)
      The removal policy to apply to the file system.

      Default: RemovalPolicy.RETAIN

      Parameters:
      removalPolicy - The removal policy to apply to the file system. This parameter is required.
      Returns:
      this
    • replicationConfiguration

      @Stability(Stable) public FileSystem.Builder replicationConfiguration(ReplicationConfiguration replicationConfiguration)
      Replication configuration for the file system.

      Default: - no replication

      Parameters:
      replicationConfiguration - Replication configuration for the file system. This parameter is required.
      Returns:
      this
    • replicationOverwriteProtection

      @Stability(Stable) public FileSystem.Builder replicationOverwriteProtection(ReplicationOverwriteProtection replicationOverwriteProtection)
      Whether to enable the filesystem's replication overwrite protection or not.

      Set false if you want to create a read-only filesystem for use as a replication destination.

      Default: ReplicationOverwriteProtection.ENABLED

      Parameters:
      replicationOverwriteProtection - Whether to enable the filesystem's replication overwrite protection or not. This parameter is required.
      Returns:
      this
      See Also:
    • securityGroup

      @Stability(Stable) public FileSystem.Builder securityGroup(ISecurityGroup securityGroup)
      Security Group to assign to this file system.

      Default: - creates new security group which allows all outbound traffic

      Parameters:
      securityGroup - Security Group to assign to this file system. This parameter is required.
      Returns:
      this
    • throughputMode

      @Stability(Stable) public FileSystem.Builder throughputMode(ThroughputMode throughputMode)
      Enum to mention the throughput mode of the file system.

      Default: ThroughputMode.BURSTING

      Parameters:
      throughputMode - Enum to mention the throughput mode of the file system. This parameter is required.
      Returns:
      this
    • transitionToArchivePolicy

      @Stability(Stable) public FileSystem.Builder transitionToArchivePolicy(LifecyclePolicy transitionToArchivePolicy)
      The number of days after files were last accessed in primary storage (the Standard storage class) at which to move them to Archive storage.

      Metadata operations such as listing the contents of a directory don't count as file access events.

      Default: - None. EFS will not transition files to Archive storage class.

      Parameters:
      transitionToArchivePolicy - The number of days after files were last accessed in primary storage (the Standard storage class) at which to move them to Archive storage. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public FileSystem.Builder vpcSubnets(SubnetSelection vpcSubnets)
      Which subnets to place the mount target in the VPC.

      Default: - the Vpc default strategy if not specified

      Parameters:
      vpcSubnets - Which subnets to place the mount target in the VPC. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public FileSystem build()
      Specified by:
      build in interface software.amazon.jsii.Builder<FileSystem>
      Returns:
      a newly built instance of FileSystem.