Resource: aws_fsx_windows_file_system

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

Example Usage

Using AWS Directory Service

Additional information for using AWS Directory Service with Windows File Systems can be found in the FSx Windows Guide.

resource "aws_fsx_windows_file_system" "example" {
  active_directory_id = aws_directory_service_directory.example.id
  kms_key_id          = aws_kms_key.example.arn
  storage_capacity    = 300
  subnet_ids          = [aws_subnet.example.id]
  throughput_capacity = 1024
}

Using a Self-Managed Microsoft Active Directory

Additional information for using AWS Directory Service with Windows File Systems can be found in the FSx Windows Guide.

resource "aws_fsx_windows_file_system" "example" {
  kms_key_id          = aws_kms_key.example.arn
  storage_capacity    = 300
  subnet_ids          = [aws_subnet.example.id]
  throughput_capacity = 1024

  self_managed_active_directory {
    dns_ips     = ["10.0.0.111", "10.0.0.222"]
    domain_name = "corp.example.com"
    password    = "avoid-plaintext-passwords"
    username    = "Admin"
  }
}

Argument Reference

The following arguments are required:

The following arguments are optional:

Disk Iops Configuration

Self-Managed Active Directory

The self_managed_active_directory configuration block supports the following arguments:

Audit Log Configuration

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

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_windows_file_system.example
  id = "fs-543ab12b1ca672f33"
}

Using terraform import, import FSx File Systems using the id. For example:

% terraform import aws_fsx_windows_file_system.example fs-543ab12b1ca672f33

Certain resource arguments, like security_group_ids and the self_managed_active_directory configuation block password, do not have a FSx API method for reading the information after creation. If these arguments are 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_windows_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]
  }
}