๐๐จ๐ด๐ณ SIMPLIFIED โ ๐ฐ๐๐๐๐๐๐๐๐ ๐ฎ๐๐๐ ๐
In this blog letโs explore YAML
โ Important of YAML
Yamal file is used to represent data, in this case configuration data
Ansible play books, Cloud Formation, aws, azure resources, Kubernetes etc are written in yaml.
Same data has been represented in xml / Jason / Yamal, here is the Quick comparison of how simple Yamal is to understand
โ Close look at YAML:
In Yaml data is taken to the simplest form ( key: value pair )
Key and value separated by colon ( : )
There is a space after colon ( : ) differentiating key and value
โ Representing Array / lists in yaml:
We are listing fruits and vegetable with a colon ( ; ) followed by enter & dash ( โ )at the front.
The dash indicates itโs an element of the array ex: for fruits= orange, apple, banana
Its ordered collection of data, so the properties should be defined in order.
Get Ajay-bjโs stories inย yourย inbox
Join Medium for free to get updates fromย thisย writer.
โ Representing Dictionary in yaml:
Dictionary is the set of properties grouped together under an item.
ex: here we have grouped nutritional information of banana and crapes.
Blank space should be given before each item in dictionary.
Unordered collection of data, so properties can be defined in any order
โ Importance of space & indentation in YAML:
Like in python we have to maintain indentation by providing space in YAML
From above image we can see Fat & carbs came under calories due to space(indentation)
Number of spaces before each property is key in yaml, so we have to be carful in spacing to represent the data.
โ Mixing list & dictionary in YAML:
Here we take 3 car and represent respective information in list & dictionary
We have 3 similar cars but different color- so we can make color as list/array in dash (-)
Then inside each list we group items and feed to it as dictionary (model, prize, transition).
๐จFollow me on Medium & LinkedIn Ajay Bj
https://www.linkedin.com/in/ajay-bj/ for interesting information and Quick Learnings. ๐จ
Letโs keep the conversation going! Your engagement through learning ๐and comments โ๏ธ helps build a vibrant community of like-minded individuals.









