We need to set up an Elastic File System in AWS to store the WordPress files and share it with the WordPress ECS tasks.
Create an EFS file system and add mount points to mount the filesystems in the private subnets.
EFS > Create >
Name: wp-stack-files (fs-e2c523a2) > Select the VPC > Customize > Next > Network Access
Add mount targets for the 2 private subnets > select the SG: wp-stack-efs-sg > Next > Create
(Optional) Mount the EFS file system from the bastion host
sudo yum install -y amazon-efs-utils mkdir efs sudo mount -t efs -o tls fs-f06684b0:/ efs
(Optional) Create an EFS Access Point where you may specify the root folder within the EFS filesystem to use for the WordPress files. All files will be created within that root folder.
Select wp-stack-files > Access Points > Create
Name: www > Root directory path: /www
POSIX user > User ID: 33 > Group ID: 33
Root directory creation permissions > Owner user ID: 33 > Owner group ID: 33 > Permissions: 755 > Create