I am looking to be able to share a single network storage between my fleet of Windows EC2 instances that are used as application webservers running IIS. These instances need to be able to access the drive either by UNC or a mapped drive letter. The instances are created dynamically through autoscaling, so they need to either be preconfigured to already have the connection in the AMI that they are created from, or be able to connect as part of their startup process (if they are connected as part of startup, the connection must be established quickly so they can serve webpages without much downtime between startup and ready state, 2-3 mins max). Files are created/ modified/ deleted at runtime and need to be accessible to the other instances in the fleet so preconfiguring the AMI to have all the files already loaded up will not work.
Things we have used (or attempted to use) so far are:
A separate EC2 instance that serves as a fileserver that our EC2 AMI is preconfigured to connect up to through windows fileshare. While quick and easy, this is not a great solution since it is a single point of failure.
An S3 bucket mounted through RClone to the EC2s (mounted during the startup process of the EC2). Was too slow in its initial connecting and subsequent retrieving files. It also did not appear to follow any Windows file locks set by other EC2s in the fleet (most likely due to VFS caching, my understanding of this is that every server loads up its own local version of the file for use).
Attaching to FSx through an AWS managed Active Directory. Sort of works if AMIs are preconfigired as connected to the directory, however after 30 days that connection expires, the EC2s loose access, and a new AMI needs to be configured with the connection to spin up new EC2s with since the previous connection is no longer valid. I understand that this is due to not disconnecting from the AD and sysprepping the instance before AMI creation, meaning the AD connection established is seen as the same computer account on each EC2 that was created from the AMI. However if EC2s are sysprepped and configured to connect to the AD using a "User Data" script provided in my EC2 launch template, establishing the connection to FSx takes far too long. (Set up like this blog post: https://aws.amazon.com/blogs/compute/managing-domain-membership-of-dynamic-fleet-of-ec2-instances/)