Open MDBeudekerCN opened 2 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hi @MDBeudekerCN ,
I understand your point as if only one subnet identifier is supported then the type should be string instead of list of strings. On my end I looked into the CloudFormation documentation to understand where the list of strings is coming from:
When it comes to the AWS::FSx::FileSystem the CF looks like below
{
"Type" : "AWS::FSx::FileSystem",
"Properties" : {
"BackupId" : String,
"FileSystemType" : String,
"FileSystemTypeVersion" : String,
"KmsKeyId" : String,
"LustreConfiguration" : LustreConfiguration,
"OntapConfiguration" : OntapConfiguration,
"OpenZFSConfiguration" : OpenZFSConfiguration,
"SecurityGroupIds" : [ String, ... ],
"StorageCapacity" : Integer,
"StorageType" : String,
"SubnetIds" : [ String, ... ],
"Tags" : [ Tag, ... ],
"WindowsConfiguration" : WindowsConfiguration
}
}
so the template supports different filesystems (ontap, openzfs, lustre). All of them have in common that subnet identifiers are needed, only the number of identifiers is different:
For Windows and ONTAP MULTI_AZ_1 deployment types,provide exactly two subnet IDs, one for the preferred file server and one for the standby file server. You specify one of these subnets as the preferred subnet using the WindowsConfiguration > PreferredSubnetID or OntapConfiguration > PreferredSubnetID properties. For more information about Multi-AZ file system configuration, see Availability and durability: Single-AZ and Multi-AZ file systems in the Amazon FSx for Windows User Guide and Availability and durability in the Amazon FSx for ONTAP User Guide.
For Windows SINGLE_AZ_1 and SINGLE_AZ_2 and all Lustre deployment types, provide exactly one subnet ID. The file server is launched in that subnet's Availability Zone.
(quoted from the provided link)
In the Go SDK v2 you find also SubnetIds []string
when it comes to CreateFileSystemInput.
I hope the explanation helps a bit to understand the origin of the list for the subnet identifiers.
Hey @MDBeudekerCN 👋 Thank you for taking the time to raise this, and thank you to @stefanfreitag for another great explanation. I'll add that part of the reason for keeping this as a list rather than a string comes from our provider design principles which guide that resources should match as close to the underlying API as possible. Doing so helps to make the provider match as closely as possible to other tools (i.e. the aws
CLI or API itself), improving interoperability.
If there are any other concerns around this, we'd be happy to continue the conversation. Otherwise, we'll get this issue closed out. Regardless, we appreciate you taking the time to raise this and any future concerns you may have!
Terraform Core Version
1.8.1
AWS Provider Version
5.51.1
Affected Resource(s)
aws_fsx_lustre_file_system has a variable named 'Subnet_ids' which should be a list of string. However when inputting the subnet IDs of my VPC module private IPs as follows:
I get the following error:
The variable
subnet_ids
should bestring
instead oflist(string)
if it supports just 1 value. Making it a string with length 1 is confusing, since AWS also only supports 1 subnetExpected Behavior
Expected: Variable name implies you being able to specify multiple subnet IDs, but reality should be that the variable subnet_id should be singular
Actual Behavior
Attribute subnet_ids supports 1 item maximum, but config has 3 declared.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
See above code and try to add more subnet ID's to the variable
subnet_ids
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None