Manages an Amazon FSx for OpenZFS file system. See the FSx OpenZFS User Guide for more information.
resource "aws_fsx_openzfs_file_system" "test" {
storage_capacity = 64
subnet_ids = [aws_subnet.test1.id]
deployment_type = "SINGLE_AZ_1"
throughput_capacity = 64
}
This resource supports the following arguments:
deployment_type
- (Required) - The filesystem deployment type. Valid values: SINGLE_AZ_1
, SINGLE_AZ_2
and MULTI_AZ_1
.storage_capacity
- (Required) The storage capacity (GiB) of the file system. Valid values between 64
and 524288
.subnet_ids
- (Required) A list of IDs for the subnets that the file system will be accessible from.throughput_capacity
- (Required) Throughput (MB/s) of the file system. Valid values depend on deployment_type
. Must be one of 64
, 128
, 256
, 512
, 1024
, 2048
, 3072
, 4096
for SINGLE_AZ_1
. Must be one of 160
, 320
, 640
, 1280
, 2560
, 3840
, 5120
, 7680
, 10240
for SINGLE_AZ_2
.automatic_backup_retention_days
- (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.backup_id
- (Optional) The ID of the source backup to create the filesystem from.copy_tags_to_backups
- (Optional) A boolean flag indicating whether tags for the file system should be copied to backups. The default value is false.copy_tags_to_volumes
- (Optional) A boolean flag indicating whether tags for the file system should be copied to snapshots. The default value is false.daily_automatic_backup_start_time
- (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. Requires automatic_backup_retention_days
to be set.disk_iops_configuration
- (Optional) The SSD IOPS configuration for the Amazon FSx for OpenZFS file system. See Disk Iops Configuration below.endpoint_ip_address_range
- (Optional) (Multi-AZ only) Specifies the IP address range in which the endpoints to access your file system will be created.kms_key_id
- (Optional) ARN for the KMS Key to encrypt the file system at rest, Defaults to an AWS managed KMS Key.preferred_subnet_id
- (Optional) (Multi-AZ only) Required when deployment_type
is set to MULTI_AZ_1
. This specifies the subnet in which you want the preferred file server to be located.root_volume_configuration
- (Optional) The configuration for the root volume of the file system. All other volumes are children or the root volume. See Root Volume Configuration below.route_table_ids
- (Optional) (Multi-AZ only) Specifies the route tables in which Amazon FSx creates the rules for routing traffic to the correct file server. You should specify all virtual private cloud (VPC) route tables associated with the subnets in which your clients are located. By default, Amazon FSx selects your VPC's default route table.security_group_ids
- (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.skip_final_backup
- (Optional) When enabled, will skip the default final backup taken when the file system is deleted. This configuration must be applied separately before attempting to delete the resource to have the desired behavior. Defaults to false
.storage_type
- (Optional) The filesystem storage type. Only SSD
is supported.tags
- (Optional) A map of tags to assign to the file system. If configured with a provider default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.weekly_maintenance_start_time
- (Optional) The preferred start time (in d:HH:MM
format) to perform weekly maintenance, in the UTC time zone.iops
- (Optional) - The total number of SSD IOPS provisioned for the file system.mode
- (Optional) - Specifies whether the number of IOPS for the file system is using the system. Valid values are AUTOMATIC
and USER_PROVISIONED
. Default value is AUTOMATIC
.copy_tags_to_snapshots
- (Optional) - A boolean flag indicating whether tags for the file system should be copied to snapshots. The default value is false.data_compression_type
- (Optional) - Method used to compress the data on the volume. Valid values are LZ4
, NONE
or ZSTD
. Child volumes that don't specify compression option will inherit from parent volume. This option on file system applies to the root volume.nfs_exports
- (Optional) - NFS export configuration for the root volume. Exactly 1 item. See NFS Exports Below.read_only
- (Optional) - specifies whether the volume is read-only. Default is false.record_size_kib
- (Optional) - Specifies the record size of an OpenZFS root volume, in kibibytes (KiB). Valid values are 4
, 8
, 16
, 32
, 64
, 128
, 256
, 512
, or 1024
KiB. The default is 128
KiB.user_and_group_quotas
- (Optional) - Specify how much storage users or groups can use on the volume. Maximum of 100 items. See User and Group Quotas Below.client_configurations
- (Required) - A list of configuration objects that contain the client and options for mounting the OpenZFS file system. Maximum of 25 items. See Client Configurations Below.clients
- (Required) - A value that specifies who can mount the file system. You can provide a wildcard character (*), an IP address (0.0.0.0), or a CIDR address (192.0.2.0/24. By default, Amazon FSx uses the wildcard character when specifying the client.options
- (Required) - The options to use when mounting the file system. Maximum of 20 items. See the Linix NFS exports man page for more information. crossmount
and sync
are used by default.id
- (Required) - The ID of the user or group. Valid values between 0
and 2147483647
storage_capacity_quota_gib
- (Required) - The amount of storage that the user or group can use in gibibytes (GiB). Valid values between 0
and 2147483647
type
- (Required) - A value that specifies whether the quota applies to a user or group. Valid values are USER
or GROUP
.This resource exports the following attributes in addition to the arguments above:
arn
- Amazon Resource Name of the file system.dns_name
- DNS name for the file system, e.g., fs-12345678.fsx.us-west-2.amazonaws.com
endpoint_ip_address
- IP address of the endpoint that is used to access data or to manage the file system.id
- Identifier of the file system, e.g., fs-12345678
network_interface_ids
- Set of Elastic Network Interface identifiers from which the file system is accessible The first network interface returned is the primary network interface.root_volume_id
- Identifier of the root volume, e.g., fsvol-12345678
owner_id
- AWS account identifier that created the file system.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.vpc_id
- Identifier of the Virtual Private Cloud for the file system.create
- (Default 60m
)update
- (Default 60m
)delete
- (Default 60m
)In Terraform v1.5.0 and later, use an import
block to import FSx File Systems using the id
. For example:
import {
to = aws_fsx_openzfs_file_system.example
id = "fs-543ab12b1ca672f33"
}
Using terraform import
, import FSx File Systems using the id
. For example:
% terraform import aws_fsx_openzfs_file_system.example fs-543ab12b1ca672f33
Certain resource arguments, like security_group_ids
, 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 ignore_changes
to hide the difference. For example:
resource "aws_fsx_openzfs_file_system" "example" {
# ... other configuration ...
security_group_ids = [aws_security_group.example.id]
# There is no FSx API for reading security_group_ids
lifecycle {
ignore_changes = [security_group_ids]
}
}