- IaC stands for Infrastructure as Code. This is a process of treating your infrastructure objects, such as EC2 instances, VPC network, subnets, load balancers, storage, application deployment and orchestration, and in the form of infrastructure codes. IaC allows the infrastructure vertical to change, replicate, and roll back changes in the entire environment in a very short space of time.
- Open the CloudFormation template at https://console.aws.amazon.com/cloudformation and click on
Create Stack
button. Now create ahelloworld-cf.template
template file, using the Python file located at https://raw.githubusercontent.com/yogeshraheja/Effective-DevOps-with-AWS/master/Chapter03/EffectiveDevOpsTemplates/helloworld-cf-template-part-1.py. After doing this, upload a template to Amazon S3. Provide a name to your stack, followed by an SSH key-pair, and other additional information that can be taken as default here. Now review the information and click onCreate
. When the creation of the template is complete, click on theOutputs
tab and click onWeburl
, which will take you to the application home page.
Hint: Generate the CloudFormation template by saving the output of the script in the python helloworld-cf-template.py > helloworld-cf.template
file.
- There are multiple SCM offerings available on the market, including GitLab, BitBucket, GitHub, and even SCM offerings by public clouds. Here, we will use one of the most popular SCM offerings: GitHub. Create your free account on Github at https://github.com. Once you have done this, log into your GitHub account and create your first public repository with the name
helloworld
. - Install a Git package for your supported platform and clone the previously created GitHub repository here using
git clone <github repository URL>
, which you can find from the GitHub console for your repository. Now copy yourhelloworld-cf.template
in the repository followed by thegit add
andgit commit
operations. Now you are in a position to push your local repository file to your GitHub account. To do this, executegit push
to push your committed file and confirm this by checking your GitHub repository. Ansible is a simple, powerful, and easy-to-learn configuration management tool used by the system/cloud engineers and DevOps engineers to automate their regular repetitive tasks. The installation of Ansible is very simple and works as an agentless model.
In Ansible, modules are the fundamental building blocks for creating Ansible code files written in YAML. These files, written in YAML, are called Ansible Playbooks. Multiple Ansible playbooks are arranged in well defined directory structures, called
roles
in Ansible, where roles are the structure directories for Ansible codes that contain Ansible playbooks, variables, static/dynamic files, and so on. There are also a number of other objects in Ansible, including Ansible Vault, Ansible Galaxy, and a GUI for Ansible called Ansible Tower. You can further explore these objects at https://docs.ansible.com.