I am trying to set up a resilient way to deploy our monolithic web app on an AWS EC2. My current setup uses Ansible to "manually" install the components for a LAMP server on the latest Amazon-Managed Ubuntu AMI.

I recently discovered AWS EC2 Image Builder, which seems like it could be used to create an AMI with Apache, MySQL (client), and PHP.

In my AWS Console, I went through these steps:

  1. EC2 Image Builder >
  2. Image pipelines >
  3. Create image pipeline >
  4. Create Recipe >
  5. Image Type: AMI >
  6. Source Image: [Amazon Linux | Ubuntu | CentOS | Redhat | Suse ] (I tried each one)

After the above 6 steps, when trying to add an (Amazon Managed) Component, I see PHP 7.1 ~ 7.3.. can be added. But I do NOT see what I would think are other basic components: Apache, Ngnix, MySQL..

How do I add Apache2 + MySQL (client) + PHP to an Amazon managed Ubuntu box via EC2 Image Builder?

1 Answer 1


You need to create build components and define a custom installation process.

Click the 'Create Build Component' button in the 'Components' section of the 'Recipe' page. Scroll down to 'Definition' and select 'Use example' to see how it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.