Steps To Provision EC2-instance and LAMP package Uisng AWS Cloudformation
Using AWS cloud formationCreate, we will be creating a template using which instance will be launched and the LAMP package will be installed on top of it automatically. To create AWS free tier account you can refer to Amazon Web Services (AWS) – Free Tier Account Set up.
Step 1: Go to the Cloudformation dashboard on the AWS management console. Click on Create the stack.
Step 2: You will be redirected to this webpage. We will be using a sample template of Lamp Stack in this. Select the option: Use a sample template. Select the Lamp Stack template. Click on View in Designer to view the design of the template.
Step 3: Now you will be redirected to the designer page which shows the design of the template. It shows the instance which will be created with Apache and MySQL installed over it. It also shows the security groups attached to the security purpose of the instance. Here you can design your the infrastructure accordingly.
Step 4: These are the components of the template which we discussed earlier. Rename the template accordingly.
Step 5: This is the code written in JSON format which contains all the specifications and dependencies about the infrastructure to be created.
Step 6: Now click on the cloud-shaped upload button to come out of the designer.
Step 7: We will come back to the same web page. Click on Next.
Step 8: Specify the desired stack name over here
Step 9: Mention the name of the database you want to create on the MySQL database. Also, specify the password and name of the Createdb-user.
Step 10: Choose the instance type. Select any available key pair which will be used in making an SSH connection with the instance. Click on Next.
Step 11: You don’t have to worry about the advanced settings. Click on Next.
Step 12: Click on Create a stack. The instance will be created with the LAMP package installed on it. You can easily work with PHP and MySQL on the instance.
What is AWS Cloudformation?
Amazon Web Services(AWS) offers cloud formation as a service by which you can provision and manage complicated services offered by AWS by using the code. Cloudformation will help you to manage the infrastructure and the services in the form of a declarative way.
Contact Us