AWS Amazon FSx Windows File System
This page shows how to write Terraform and CloudFormation for Amazon FSx Windows File System and write them securely.
aws_fsx_windows_file_system (Terraform)
The Windows File System in Amazon FSx can be configured in Terraform with the resource name aws_fsx_windows_file_system
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_fsx_windows_file_system" "my_system" {
storage_capacity = 300
subnet_ids = ["fake"]
throughput_capacity = 1024
deployment_type = "MULTI_AZ_1"
storage_type = "HDD"
resource "aws_fsx_windows_file_system" "example" {
active_directory_id = var.ad_directory_id
kms_key_id = var.kms_key_arn
storage_capacity = var.storage_capacity
subnet_ids = var.subnet_ids
throughput_capacity = 1024
resource "aws_fsx_windows_file_system" "pass" {
active_directory_id = aws_directory_service_directory.test.id
kms_key_id = aws_kms_key.test1.arn
skip_final_backup = true
storage_capacity = 32
subnet_ids = [aws_subnet.test1.id]
resource "aws_fsx_windows_file_system" "pass" {
active_directory_id = aws_directory_service_directory.test.id
kms_key_id = aws_kms_key.test1.arn
skip_final_backup = true
storage_capacity = 32
subnet_ids = [aws_subnet.test1.id]
resource "aws_fsx_windows_file_system" "pass" {
active_directory_id = aws_directory_service_directory.test.id
kms_key_id = aws_kms_key.test1.arn
skip_final_backup = true
storage_capacity = 32
subnet_ids = [aws_subnet.test1.id]
Parameters
-
active_directory_id
optional - string -
arn
optional computed - string -
automatic_backup_retention_days
optional - number -
copy_tags_to_backups
optional - bool -
daily_automatic_backup_start_time
optional computed - string -
deployment_type
optional - string -
dns_name
optional computed - string -
id
optional computed - string -
kms_key_id
optional computed - string -
network_interface_ids
optional computed - set of string -
owner_id
optional computed - string -
preferred_file_server_ip
optional computed - string -
preferred_subnet_id
optional computed - string -
remote_administration_endpoint
optional computed - string -
security_group_ids
optional - set of string -
skip_final_backup
optional - bool -
storage_capacity
required - number -
storage_type
optional - string -
subnet_ids
required - list of string -
tags
optional - map from string to string -
throughput_capacity
required - number -
vpc_id
optional computed - string -
weekly_maintenance_start_time
optional computed - string -
self_managed_active_directory
list block-
dns_ips
required - set of string -
domain_name
required - string -
file_system_administrators_group
optional - string -
organizational_unit_distinguished_name
optional - string -
password
required - string -
username
required - string
-
-
timeouts
single block
Explanation in Terraform Registry
Manages a FSx Windows File System. See the FSx Windows Guide for more information.
NOTE: Either the
active_directory_id
argument orself_managed_active_directory
configuration block must be specified.
AWS::FSx::FileSystem WindowsConfiguration (CloudFormation)
The FileSystem WindowsConfiguration in FSx can be configured in CloudFormation with the resource name AWS::FSx::FileSystem WindowsConfiguration
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
ActiveDirectoryId
The ID for an existing AWS Managed Microsoft Active Directory (AD) instance that the file system should join when it's created.
Required: Conditional
Type: String
Minimum: 12
Maximum: 12
Pattern: ^d-[0-9a-f]{10}$
Update requires: Replacement
Aliases
An array of one or more DNS alias names that you want to associate with the Amazon FSx file system. Aliases allow you to use existing DNS names to access the data in your Amazon FSx file system. You can associate up to 50 aliases with a file system at any time.
For more information, see Working with DNS Aliases and Walkthrough 5: Using DNS aliases to access your file system, including additional steps you must take to be able to access your file system using a DNS alias.
An alias name has to meet the following requirements:
- Formatted as a fully-qualified domain name (FQDN),
hostname.domain
, for example,accounting.example.com
. - Can contain alphanumeric characters, the underscore (_), and the hyphen (-).
- Cannot start or end with a hyphen.
- Can start with a numeric.
For DNS alias names, Amazon FSx stores alphabetic characters as lowercase letters (a-z), regardless of how you specify them: as uppercase letters, lowercase letters, or the corresponding letters in escape codes.
Required: No
Type: List of String
Maximum:50
Update requires: No interruption
AuditLogConfiguration
The configuration that Amazon FSx for Windows File Server uses to audit and log user accesses of files, folders, and file shares on the Amazon FSx for Windows File Server file system.
Required: No
Type: AuditLogConfiguration
Update requires: No interruption
AutomaticBackupRetentionDays
The number of days to retain automatic backups. The default is to retain backups for 7 days. Setting this value to 0 disables the creation of automatic backups. The maximum retention period for backups is 90 days.
Required: No
Type: Integer
Minimum: 0
Maximum: 90
Update requires: No interruption
CopyTagsToBackups
A boolean flag indicating whether tags for the file system should be copied to backups. This value defaults to false. If it's set to true, all tags for the file system are copied to all automatic and user-initiated backups where the user doesn't specify tags. If this value is true, and you specify one or more tags, only the specified tags are copied to backups. If you specify one or more tags when creating a user-initiated backup, no tags are copied from the file system, regardless of this value.
Required: No
Type: Boolean
Update requires: Replacement
DailyAutomaticBackupStartTime
The preferred time to take daily automatic backups, formatted HH:MM in the UTC time zone.
Required: No
Type: String
Update requires: No interruption
DeploymentType
Specifies the file system deployment type, valid values are the following:
MULTI_AZ_1
- Deploys a high availability file system that is configured for Multi-AZ redundancy to tolerate temporary Availability Zone (AZ) unavailability. You can only deploy a Multi-AZ file system in AWS Regions that have a minimum of three Availability Zones. Also supports HDD storage typeSINGLE_AZ_1
- (Default) Choose to deploy a file system that is configured for single AZ redundancy.SINGLE_AZ_2
- The latest generation Single AZ file system. Specifies a file system that is configured for single AZ redundancy and supports HDD storage type. For more information, see Availability and Durability: Single-AZ and Multi-AZ File Systems.
Required: No
Type: String
Allowed values:MULTI_AZ_1 | SINGLE_AZ_1 | SINGLE_AZ_2
Update requires: Replacement
PreferredSubnetId
Required when DeploymentType
is set to MULTI_AZ_1
. This specifies the subnet in which you want the preferred file server to be located. For in-AWS applications, we recommend that you launch your clients in the same Availability Zone (AZ) as your preferred file server to reduce cross-AZ data transfer costs and minimize latency.
Required: Conditional
Type: String
Update requires: Replacement
SelfManagedActiveDirectoryConfiguration
The configuration that Amazon FSx uses to join a FSx for Windows File Server file system to a self-managed (including on-premises) Microsoft Active Directory (AD) directory. For more information, see Using Amazon FSx with your self-managed Microsoft Active Directory.
Required: No
Type: SelfManagedActiveDirectoryConfiguration
Update requires: No interruption
ThroughputCapacity
The throughput of an Amazon FSx file system, measured in megabytes per second, in 2 to the nth increments, between 2^3 (8) and 2^11 (2048).
Required: Conditional
Type: Integer
Minimum: 8
Maximum: 2048
Update requires: No interruption
WeeklyMaintenanceStartTime
The preferred start time to perform weekly maintenance, formatted d:HH:MM in the UTC time zone, where d is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday.
Required: No
Type: String
Update requires: No interruption
Explanation in CloudFormation Registry
The Microsoft Windows configuration for the file system being created.
Frequently asked questions
What is AWS Amazon FSx Windows File System?
AWS Amazon FSx Windows File System is a resource for Amazon FSx of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon FSx Windows File System?
For Terraform, the gilyas/infracost, shaikis/terraform-aws-fsx and bridgecrewio/checkov source code examples are useful. See the Terraform Example section for further details.