Content

                                                  Content How to create an AWS free Account? Lab 1: To launch amazon Linux EC2 instance Lab 2: To Connect to the instance from Linux client Operating System Lab 3:To Launch amazon windows instance Lab 4: Installing apache in EC2 instance Lab 5: Installing Nginx in EC2 instance Lab 6: Changing Host Name Lab 7: Creating a user and making as a sudoer Lab 8:Assigning an Elastic ip Lab 9:Creating ebs,attach and detach the volumn to the instance Lab 10:Creating an S3 Bucket and creating cross replication in another region Lab 11:Load Balancer Lab 12:Two instances with Application Load Balancer Lab 13:Launching two instances with load Balancer Lab:14 Creating Own VPC  Lab 15: Two instances which classic load Balance with own VPC Lab 16:Two instances with Application load Balancer with own VPC Lab 17: Relational Data B...

Lab 30 : Cloud Formation

                                           Cloud Formation



What is  Cloud Formation and why we use?

   Cloud Formation is a automation tools which allows you to create the infrastructure of the aws services in less time and manage those resources and we can many times.

Lab:Step 1: Pick a template

First, you’ll need a template that specifies that you want in your stack.For this step,you use a sample template that is already prepared.The sample template creates a basic wordpress blog that uses a single amazon EC2 instance which a local mysql data base for storage.The template also creates an amazon EC2 security group to control firewall settings the amazon EC2 instance.

Step 2:Make sure you have prepared any required items for the stack

Before you create a stack from a template,you must ensure that all dependent resources that template requires are available,A template can use or refer to both existing aws resources and resources declared in the template itself,AWS Cloud Formation takes care of checking references to resources in the template and also checks references to existing resources to Ensure that they exist in the region where you are creating in the stack.If your template refers to a dependent resource that does not Exist,Stack creation fails .

The Example wordpress template contains an input parameters ,key name ,that specifies the key pair used for the amazon  EC2 instance that is declared in the template.The template depends on the user who creates a stack from the template to supply a valid amazon EC2 key pair for the key name parameter.If you supply a valid key pair name,the stack creates successfully if you don’t supply a valid key pair name ,the stack is rolled back.

Make sure you have a valid amazon EC2 key pair and record the key pair name before you create the stack.

Go to the EC2 dashboard Click on key pair

Create a key pair

 



Then click on Create

Step 3:Create the stack

Go to the cloud formation dashboard

Click create a stack

 

 



Select specify an amazon S3 template URL

https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/wordpress single instance.template

Paste this URL

 


Click on Next


 

Give a stack name

Give a DB password should contain Alpha numeric

DB root password should contain Alpha numeric

DB user as root

Select key pair wordpress

 


Click on Next


 


Then Click on Next


 


You will get a review page

 

 

Then click on Create

 

Stack Created

To view events of the stack

Click on Events

 

Execrise: Write a simple script for launching an EC2 instance and security groups create through cloud formation.


Comments

Popular posts from this blog

Lab 21:Installing docker in instance and build an image

Lab 22:Pushing a docker image to docker hub

Lab 5: Installing Nginx in EC2 instance