Introduction to AWS Services used in Lab
CloudFormation is a service provided by AWS for designing our own infrastructure using code i.e infrastructure as code.
Currently, CloudFormation supports two languages JSON and YAML. You can write your code with one of the languages.
CloudFormation comes with great features being able to update your infrastructure whenever you want and also having the ability to delete the stack in case you don’t need it.
A fascinating feature of cloudFormation is that it saves more time in building infrastructure and helps in focusing on the development.
It is also possible to replicate our infrastructure in a short amount of time.
It eliminates human error and works according to the code you have written. It consists of two main components, Stack and Templates.
It consists of various sections like
AWS Template Format Version
Resources (Required Field)
It is not mandatory that the template requires all the above-mentioned sections. By using only the Resources section, we will be able to create a template.
The resources section plays an important role in the template creation.
For example, to create an EC2 instance, a template shall consist of various parameters such as key name, image id, instance type.
It is also possible to create two resources in the same template and refer to one from another i.e. attaching an elastic IP with an EC2 instance.
A stack consists of a collection of resources.
In other words, the stack consists of one or more templates.
The advantage of the stack is that it is easy to create, delete or update the collection of resources.
The advanced stacks have a nested stack which holds a collection of stacks.
This lab walks you through the steps to understand a sample CloudFormation template and update the CloudFormation stack as per the requirements.
You will practice using Amazon Machine Images to launch Amazon EC2 Instances and change the instance type as part of the update, replace port 22 with port 80 and finally display the private IP of the EC2 instance as output. All these updates will be created as Change set.
Duration: 90 minutes
AWS Region: US East (N. Virginia) us-east-1
Launching Lab Environment
Copy the S3 Object URL of the Sample template to create CloudFormation stack
Create a CloudFormation stack using a template present in an S3 bucket.
Create a Change set for the CloudFormation stack
Check the updates and changes applied
Validation of the lab.
Deleting AWS Resources.