wordpressamazon-web-servicesamazon-ec2amazon-elbamazon-efs

AWS Auto Scaling Group & EFS


I created an ec2 instance with a wordpress. The wordpress is installed on a AWS EFS attached to the EC2 instance. I attached the EC2 running instance to the autoscaling group and configure it to have 2 instance as a desired number of instances. Another instance is created but without the EFS attached to. I can't understand why ?

Do you have any ideas ?


Solution

  • The AutoScaling Group will not automatically attach an EFS volume to new instances. You can either build a custom AMI that automatically attaches to the EFS, and then tell the AutoScaling Group to use that AMI, or you can configure the AutoScaling Group to pass a cloud-init command to new instances that will attach the volume. Both approaches are documented here.