Skip to content

Resource: awsFsxFileCache

Terraform resource for managing an Amazon File Cache cache. See the Create File Cache for more information.

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.fsxFileCache.FsxFileCache(this, "example", {
  dataRepositoryAssociation: [
    {
      dataRepositoryPath: "nfs://filer.domain.com",
      dataRepositorySubdirectories: ["test", "test2"],
      fileCachePath: "/ns1",
      nfs: [
        {
          dnsIps: ["192.168.0.1", "192.168.0.2"],
          version: "NFS3",
        },
      ],
    },
  ],
  fileCacheType: "LUSTRE",
  fileCacheTypeVersion: "2.12",
  lustreConfiguration: [
    {
      deploymentType: "CACHE_1",
      metadataConfiguration: [
        {
          storageCapacity: 2400,
        },
      ],
      perUnitStorageThroughput: 1000,
      weeklyMaintenanceStartTime: "2:05:00",
    },
  ],
  storageCapacity: 1200,
  subnetIds: ["${aws_subnet.test1.id}"],
});

Argument Reference

The following arguments are required:

  • fileCacheType - The type of cache that you're creating. The only supported value is lustre.
  • fileCacheTypeVersion - The version for the type of cache that you're creating. The only supported value is 212.
  • storageCapacity - The storage capacity of the cache in gibibytes (GiB). Valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.
  • subnetIds - A list of subnet IDs that the cache will be accessible from. You can specify only one subnet ID.

The following arguments are optional:

  • copyTagsToDataRepositoryAssociations - A boolean flag indicating whether tags for the cache should be copied to data repository associations. This value defaults to false.
  • dataRepositoryAssociation - See the dataRepositoryAssociation configuration block. Max of 8. A list of up to 8 configurations for data repository associations (DRAs) to be created during the cache creation. The DRAs link the cache to either an Amazon S3 data repository or a Network File System (NFS) data repository that supports the NFSv3 protocol. The DRA configurations must meet the following requirements: 1) All configurations on the list must be of the same data repository type, either all S3 or all NFS. A cache can't link to different data repository types at the same time. 2) An NFS DRA must link to an NFS file system that supports the NFSv3 protocol. DRA automatic import and automatic export is not supported.
  • kmsKeyId - Specifies the ID of the AWS Key Management Service (AWS KMS) key to use for encrypting data on an Amazon File Cache. If a KmsKeyId isn't specified, the Amazon FSx-managed AWS KMS key for your account is used.
  • lustreConfiguration - See the lustreConfiguration block. Required when fileCacheType is lustre.
  • securityGroupIds - A list of IDs specifying the security groups to apply to all network interfaces created for Amazon File Cache access.
  • tags - (Optional) A map of tags to assign to the file cache. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Data Repository Association arguments

The following arguments are supported for dataRepositoryAssociation configuration block:

  • fileCachePath - (Required) A path on the cache that points to a high-level directory (such as /ns1/) or subdirectory (such as /ns1/subdir/) that will be mapped 1-1 with DataRepositoryPath. The leading forward slash in the name is required. Two data repository associations cannot have overlapping cache paths. For example, if a data repository is associated with cache path /ns1/, then you cannot link another data repository with cache path /ns1/ns2. This path specifies where in your cache files will be exported from. This cache directory can be linked to only one data repository, and no data repository other can be linked to the directory. Note: The cache path can only be set to root (/) on an NFS DRA when DataRepositorySubdirectories is specified. If you specify root (/) as the cache path, you can create only one DRA on the cache. The cache path cannot be set to root (/) for an S3 DRA.
  • dataRepositoryPath - (Optional) The path to the S3 or NFS data repository that links to the cache.
  • dataRepositorySubdirectories - (Optional) A list of NFS Exports that will be linked with this data repository association. The Export paths are in the format /exportpath1. To use this parameter, you must configure DataRepositoryPath as the domain name of the NFS file system. The NFS file system domain name in effect is the root of the subdirectories. Note that DataRepositorySubdirectories is not supported for S3 data repositories. Max of 500.
  • nfs - (Optional) - (Optional) See the nfs configuration block.

NFS arguments

The following arguments are supported for nfs configuration block:

  • version - (Required) - The version of the NFS (Network File System) protocol of the NFS data repository. The only supported value is NFS3, which indicates that the data repository must support the NFSv3 protocol. The only supported value is nfs3.
  • dnsIps - (Optional) - A list of up to 2 IP addresses of DNS servers used to resolve the NFS file system domain name. The provided IP addresses can either be the IP addresses of a DNS forwarder or resolver that the customer manages and runs inside the customer VPC, or the IP addresses of the on-premises DNS servers.

Lustre Configuration arguments

The following arguments are supported for lustreConfiguration configuration block:

  • deploymentType - (Required) Specifies the cache deployment type. The only supported value is CACHE_1.
  • metadataConfiguration - (Required) The configuration for a Lustre MDT (Metadata Target) storage volume. See the metadataConfiguration block.
  • perUnitStorageThroughput - (Required) Provisions the amount of read and write throughput for each 1 tebibyte (TiB) of cache storage capacity, in MB/s/TiB. The only supported value is 1000.
  • weeklyMaintenanceStartTime - (Optional) A recurring weekly time, in the format d:hh:mm. d is the day of the week, for which 1 represents Monday and 7 represents Sunday. hh is the zero-padded hour of the day (0-23), and mm is the zero-padded minute of the hour. For example, 1:05:00 specifies maintenance at 5 AM Monday. See the ISO week date for more information.

Metadata Configuration arguments

The following arguments are supported for metadataConfiguration configuration block:

  • storageCapacity - (Required) The storage capacity of the Lustre MDT (Metadata Target) storage volume in gibibytes (GiB). The only supported value is 2400 GiB.

Attributes Reference

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

  • arn - The Amazon Resource Name (ARN) for the resource.
  • dataRepositoryAssociationIds - A list of IDs of data repository associations that are associated with this cache.
  • dnsName - The Domain Name System (DNS) name for the cache.
  • fileCacheId - The system-generated, unique ID of the cache.
  • id - The system-generated, unique ID of the cache.
  • networkInterfaceIds - A list of network interface IDs.
  • vpcId - The ID of your virtual private cloud (VPC).

Timeouts

Configuration options:

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

Import

Amazon File Cache cache can be imported using the resource id.

$ terraform import aws_fsx_file_cache.example fc-8012925589