Skip to content

Resource: awsFsxLustreFileSystem

Manages a FSx Lustre File System. See the FSx Lustre Guide for more information.

\~> NOTE: autoImportPolicy, exportPath, importPath and importedFileChunkSize are not supported with the PERSISTENT_2 deployment type. Use awsFsxDataRepositoryAssociation instead.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.fsxLustreFileSystem.FsxLustreFileSystem(this, "example", {
  importPath: "s3://${aws_s3_bucket.example.bucket}",
  storageCapacity: 1200,
  subnetIds: ["${aws_subnet.example.id}"],
});

Argument Reference

The following arguments are supported:

  • storageCapacity - (Optional) The storage capacity (GiB) of the file system. Minimum of 1200. See more details at Allowed values for Fsx storage capacity. Update is allowed only for SCRATCH_2, PERSISTENT_1 and PERSISTENT_2 deployment types, See more details at Fsx Storage Capacity Update. Required when not creating filesystem for a backup.
  • subnetIds - (Required) A list of IDs for the subnets that the file system will be accessible from. File systems currently support only one subnet. The file server is also launched in that subnet's Availability Zone.
  • backupId - (Optional) The ID of the source backup to create the filesystem from.
  • exportPath - (Optional) S3 URI (with optional prefix) where the root of your Amazon FSx file system is exported. Can only be specified with importPath argument and the path must use the same Amazon S3 bucket as specified in importPath. Set equal to importPath to overwrite files on export. Defaults to s3://{importBucket}/fSxLustre{creationTimestamp}. Only supported on PERSISTENT_1 deployment types.
  • importPath - (Optional) S3 URI (with optional prefix) that you're using as the data repository for your FSx for Lustre file system. For example, s3://exampleBucket/optionalPrefix/. Only supported on PERSISTENT_1 deployment types.
  • importedFileChunkSize - (Optional) For files imported from a data repository, this value determines the stripe count and maximum amount of data per file (in MiB) stored on a single physical disk. Can only be specified with importPath argument. Defaults to 1024. Minimum of 1 and maximum of 512000. Only supported on PERSISTENT_1 deployment types.
  • securityGroupIds - (Optional) A list of IDs for the security groups that apply to the specified network interfaces created for file system access. These security groups will apply to all network interfaces.
  • tags - (Optional) A map of tags to assign to the file system. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
  • weeklyMaintenanceStartTime - (Optional) The preferred start time (in d:hh:mm format) to perform weekly maintenance, in the UTC time zone.
  • deploymentType - (Optional) - The filesystem deployment type. One of: SCRATCH_1, SCRATCH_2, PERSISTENT_1, PERSISTENT_2.
  • kmsKeyId - (Optional) ARN for the KMS Key to encrypt the file system at rest, applicable for PERSISTENT_1 and PERSISTENT_2 deployment_type. Defaults to an AWS managed KMS Key.
  • perUnitStorageThroughput - (Optional) - Describes the amount of read and write throughput for each 1 tebibyte of storage, in MB/s/TiB, required for the PERSISTENT_1 and PERSISTENT_2 deployment_type. Valid values for PERSISTENT_1 deployment_type and ssd storage_type are 50, 100, 200. Valid values for PERSISTENT_1 deployment_type and hdd storage_type are 12, 40. Valid values for PERSISTENT_2 deployment_type and ssd storage_type are 125, 250, 500, 1000.
  • automaticBackupRetentionDays - (Optional) The number of days to retain automatic backups. Setting this to 0 disables automatic backups. You can retain automatic backups for a maximum of 90 days. only valid for PERSISTENT_1 and PERSISTENT_2 deployment_type.
  • storageType - (Optional) - The filesystem storage type. Either ssd or hdd, defaults to ssd. hdd is only supported on PERSISTENT_1 deployment types.
  • driveCacheType - (Optional) - The type of drive cache used by PERSISTENT_1 filesystems that are provisioned with hdd storage_type. Required for hdd storage_type, set to either read or none.
  • dailyAutomaticBackupStartTime - (Optional) A recurring daily time, in the format HH:MM. HH is the zero-padded hour of the day (0-23), and MM is the zero-padded minute of the hour. For example, 05:00 specifies 5 AM daily. only valid for PERSISTENT_1 and PERSISTENT_2 deployment_type. Requires automaticBackupRetentionDays to be set.
  • autoImportPolicy - (Optional) How Amazon FSx keeps your file and directory listings up to date as you add or modify objects in your linked S3 bucket. see Auto Import Data Repo for more details. Only supported on PERSISTENT_1 deployment types.
  • copyTagsToBackups - (Optional) A boolean flag indicating whether tags for the file system should be copied to backups. Applicable for PERSISTENT_1 and PERSISTENT_2 deployment_type. The default value is false.
  • dataCompressionType - (Optional) Sets the data compression configuration for the file system. Valid values are lz4 and none. Default value is none. Unsetting this value reverts the compression type back to none.
  • fileSystemTypeVersion - (Optional) Sets the Lustre version for the file system that you're creating. Valid values are 2.10 for SCRATCH_1, SCRATCH_2 and PERSISTENT_1 deployment types. Valid values for 2.12 include all deployment types.
  • logConfiguration - (Optional) The Lustre logging configuration used when creating an Amazon FSx for Lustre file system. When logging is enabled, Lustre logs error and warning events for data repositories associated with your file system to Amazon CloudWatch Logs.

logConfiguration

  • destination - (Optional) The Amazon Resource Name (ARN) that specifies the destination of the logs. The name of the Amazon CloudWatch Logs log group must begin with the /aws/fsx prefix. If you do not provide a destination, Amazon FSx will create and use a log stream in the CloudWatch Logs /aws/fsx/lustre log group.
  • level - (Optional) Sets which data repository events are logged by Amazon FSx. Valid values are WARN_ONLY, FAILURE_ONLY, ERROR_ONLY, WARN_ERROR and disabled. Default value is disabled.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - Amazon Resource Name of the file system.
  • dnsName - DNS name for the file system, e.g., fs12345678FsxUsWest2AmazonawsCom
  • id - Identifier of the file system, e.g., fs12345678
  • networkInterfaceIds - Set of Elastic Network Interface identifiers from which the file system is accessible. As explained in the documentation, the first network interface returned is the primary network interface.
  • mountName - The value to be used when mounting the filesystem.
  • ownerId - AWS account identifier that created the file system.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
  • vpcId - Identifier of the Virtual Private Cloud for the file system.

Timeouts

Configuration options:

  • create - (Default 30M)
  • update - (Default 30M)
  • delete - (Default 30M)

Import

FSx File Systems can be imported using the id, e.g.,

$ terraform import aws_fsx_lustre_file_system.example fs-543ab12b1ca672f33

Certain resource arguments, like securityGroupIds, do not have a FSx API method for reading the information after creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use ignoreChanges to hide the difference, e.g.,

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsFsxLustreFileSystemExample =
  new aws.fsxLustreFileSystem.FsxLustreFileSystem(this, "example", {
    securityGroupIds: ["${aws_security_group.example.id}"],
  });
awsFsxLustreFileSystemExample.addOverride("lifecycle", [
  {
    ignore_changes: ["${security_group_ids}"],
  },
]);