Manipulate your yaml file with yq

I like to play with bash shell especially when I have to manipulate template files of some sort on the go (dynamically). yq is a great tool I just figured out that can help me to generate SAM [1] template.yaml file based on some business logic. The great thing about yq is that I don't have to install it to be able to run it with the help of docker. So, add this to my bash script

yq() {
docker run --rm -i -v ${PWD}:/workdir mikefarah/yq yq $@

and than I can use yq as if I installed it, for example:

yq d template.yaml 'Resources.AllOutboundSG'

Read [2] to know more about how to use yq.