ecs-fsx-sftp

andreswebs/ecs-fsx-sftp/aws

Terraform Module HCL AWS

Deploys an ECS cluster running an SFTP service as a daemon

Install
module "ecs-fsx-sftp" {
source = "andreswebs/ecs-fsx-sftp/aws"
version = "0.0.2"
}
plain text: /constructs/tfmod-andreswebs-ecs-fsx-sftp-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

terraform-aws-ecs-fsx-sftp Deploys an AWS ECS cluster running an SFTP service as a daemon. This is a proof-of-concept for how to deploy a highly-available fleet of SFTP servers with an AWS FSx Windows file share, with multiple user folders from the share mounted in ECS-optimized Amazon Linux 2 instances. This module deploys a _subset_ of the resources described in the diagram below. Namely, it deploys the ECS cluster and SFTP daemon containers in the following architecture: !Example SFTP service Pre-requisites FSx The AWS FSx for Windows file system must be configured with access for a domain user with permissions to read and write to the file share. This user's credentials will be stored in plaintext in the ECS container instance. An example module to deploy FSx with Active Directory can

Inputs (45)
NameTypeDescriptionDefault
subnet_idslist(string)Subnet IDs required
instance_role_arnstringECS container-instance IAM role ARN; overrides `instance_role_name` required
ami_idstringAMI ID for ECS container-instances required
task_role_arnstringECS 'Task Role' ARN; overrides `task_role_name` required
ssh_key_namestringECS container-instance SSH key-pair name; must be an existing key-pair required
execution_role_arnstringECS 'Task Execution Role' ARN; overrides `execution_role_name` required
cidr_whitelistlist(string)CIDR whitelist for allowed container-instance ingress traffic for SSH and SFTP required
sftp_usersstringComma-separated list of SFTP users to add required
vpc_idstringVPC ID required
sftp_volume_name_storagestringSFTP storage-volumes name prefix; user names will be added as suffixes"sftp-storage"
sftp_volume_name_hoststringSFTP host-volume name"sftp-host"
sftp_volume_name_configstringSFTP config-volume name"sftp-config"
fsx_ssm_param_prefixstringPrefix for SSM parameters used for FSx configuration"/fsx"
fsx_file_sharestringName of the Windows file share to use"share"
cluster_namestringECS cluster name"sftp"
sftp_ssm_param_config_users_confstringSSM param path for the `/etc/sftp/users.conf` file"/config/users-conf"
fsx_ssm_param_domainstringFSx domain SSM param path"/domain"
fsx_ssm_param_usernamestringFSx username SSM param path"/username"
fsx_mount_pointstringFilesystem path prefix for FSx shared stores; each SFTP user will have its own m"/mnt/fsx"
instance_profile_namestringECS container-instance IAM profile name; if `instance_role_arn` is set, this mus"ecs-sftp-instance"
sftp_volume_name_userstringSFTP user-volumes name prefix; user names will be added as suffixes"sftp-user"
fsx_smb_versionstringSMB protocol version; if in doubt, leave it as default"3.0"
task_role_namestringECS 'Task Role' name; overriden by `task_role_arn`"ecs-task"
sftp_ssm_param_user_pub_keystringSSM param path for users' public keys"/user/public-key"
sftp_volume_name_scriptsstringSFTP scripts-volume name"sftp-scripts"
sftp_main_container_imagestringMain SFTP container image"atmoz/sftp:latest"
fsx_ssm_param_passwordstringFSx password SSM param path"/password"
fsx_creds_pathstringFSx credentials filesystem path"/home/ec2-user/.fsx-credentials"
fsx_cifs_max_buf_sizestringCIFS maximum buffer size; find it with the command: `modinfo cifs | grep`"130048"
… and 5 more inputs
Outputs (3)
ecs_cluster — The aws_ecs_cluster resource
launch_template — The aws_launch_template resource
task_definition — The aws_ecs_task_definition resource
Resources (9)
aws_autoscaling_groupaws_cloudwatch_log_groupaws_ecs_capacity_provideraws_ecs_clusteraws_ecs_serviceaws_ecs_task_definitionaws_launch_templateaws_security_groupaws_ssm_parameter
Topics & Tags
ecssftpawsfsx
Details
FrameworkTerraform Module
LanguageHCL
Version0.0.2
Cloud AWS
★ Stars2
Forks1
Total downloads4.7k
Inputs45
Outputs3
Resources9
Submodules1
LicenseUnlicense
Namespaceandreswebs
Updated