Provides an Elastic File System (EFS) File System resource.
resource "aws_efs_file_system" "foo" {
creation_token = "my-product"
tags = {
Name = "MyProduct"
}
}
resource "aws_efs_file_system" "foo_with_lifecyle_policy" {
creation_token = "my-product"
lifecycle_policy {
transition_to_ia = "AFTER_30_DAYS"
}
}
This resource supports the following arguments:
availability_zone_name
- (Optional) the AWS Availability Zone in which to create the file system. Used to create a file system that uses One Zone storage classes. See user guide for more information.creation_token
- (Optional) A unique name (a maximum of 64 characters are allowed)
used as reference when creating the Elastic File System to ensure idempotent file
system creation. By default generated by Terraform. See Elastic File System
user guide for more information.encrypted
- (Optional) If true, the disk will be encrypted.kms_key_id
- (Optional) The ARN for the KMS encryption key. When specifying kms_key_id, encrypted needs to be set to true.lifecycle_policy
- (Optional) A file system lifecycle policy object. See lifecycle_policy
block below for details.protection
- (Optional) A file system protection object. See protection
block below for details.performance_mode
- (Optional) The file system performance mode. Can be either "generalPurpose"
or "maxIO"
(Default: "generalPurpose"
).provisioned_throughput_in_mibps
- (Optional) The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode
set to provisioned
.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.throughput_mode
- (Optional) Throughput mode for the file system. Defaults to bursting
. Valid values: bursting
, provisioned
, or elastic
. When using provisioned
, also set provisioned_throughput_in_mibps
.lifecycle_policy
BlockDescribes a policy used by Lifecycle management that specifies when to transition files into and out of storage classes. For more information, see Managing file system storage.
The lifecycle_policy
block supports the following arguments:
transition_to_archive
- (Optional) Indicates how long it takes to transition files to the archive storage class. Requires transition_to_ia, Elastic Throughput and General Purpose performance mode. Valid values: AFTER_1_DAY
, AFTER_7_DAYS
, AFTER_14_DAYS
, AFTER_30_DAYS
, AFTER_60_DAYS
, AFTER_90_DAYS
, AFTER_180_DAYS
, AFTER_270_DAYS
, or AFTER_365_DAYS
.transition_to_ia
- (Optional) Indicates how long it takes to transition files to the IA storage class. Valid values: AFTER_1_DAY
, AFTER_7_DAYS
, AFTER_14_DAYS
, AFTER_30_DAYS
, AFTER_60_DAYS
, AFTER_90_DAYS
, AFTER_180_DAYS
, AFTER_270_DAYS
, or AFTER_365_DAYS
.transition_to_primary_storage_class
- (Optional) Describes the policy used to transition a file from infequent access storage to primary storage. Valid values: AFTER_1_ACCESS
.protection
BlockDescribes the protection on a file system.
The protection
block supports the following arguments:
replication_overwrite
- (Optional) Indicates whether replication overwrite protection is enabled. Valid values: ENABLED
or DISABLED
.This resource exports the following attributes in addition to the arguments above:
arn
- Amazon Resource Name of the file system.availability_zone_id
- The identifier of the Availability Zone in which the file system's One Zone storage classes exist.id
- The ID that identifies the file system (e.g., fs-ccfc0d65).dns_name
- The DNS name for the filesystem per documented convention.name
- The value of the file system's Name
tag.number_of_mount_targets
- The current number of mount targets that the file system has.owner_id
- The AWS account that created the file system. If the file system was createdby an IAM user, the parent account to which the user belongs is the owner.size_in_bytes
- The latest known metered size (in bytes) of data stored in the file system, the value is not the exact size that the file system was at any point in time. See Size In Bytes.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.value
- The latest known metered size (in bytes) of data stored in the file system.value_in_ia
- The latest known metered size (in bytes) of data stored in the Infrequent Access storage class.value_in_standard
- The latest known metered size (in bytes) of data stored in the Standard storage class.In Terraform v1.5.0 and later, use an import
block to import the EFS file systems using the id
. For example:
import {
to = aws_efs_file_system.foo
id = "fs-6fa144c6"
}
Using terraform import
, import the EFS file systems using the id
. For example:
% terraform import aws_efs_file_system.foo fs-6fa144c6