Learn

When you add a new variable to a gitlab pipeline, look at all the jobs in other pipelines that trigger this pipeline, and make sure that you pass the new variable through with a default value of empty string/as appropriate to avoid circular dependency failures for all the pipeline executions that trigger your pipeline as a child pipeline without having passed in a value for the variable.

--

--

When you have made your cloud from cloud formation templates, and when you are aware that one of the resources in it got changed/re-created outside cloud formation, then your stack has drifted. At this point, you delete and re-create the stack if you have the choice.

--

--

If your AWS resources management is done using both CloudFormation and Terraform, and if there is overlap/dependency between your team that uses CloudFormation and another team that uses Terraform, then do not just focus on your CloudFormation scripts.

Define the pre-conditions for your CloudFormation scripts.
- What are the AWS resources that should have been created prior to running your cloud formation scripts?
- What are the AWS resources that your cloud formation scripts is expected to create and hence the pre-condition is that these AWS resources should NOT have been created already with Terraform.

Know your code, but also know what the code expects as pre-conditions and whether these pre-conditions are met before starting the execution of the code.

--

--

Having started on functional programming from JavaScript, after transforming and filtering elements in a list/iterator, the approach that I tried to extract the final filtered value out of the iterator was to try reduce operations. Instead, what I needed was the headOption method.

A simple example of transforming a list and extracting one value out, and additionally being able to specify a default value if nothing is left after the filtering exercise.

println(List(1,2,3)
.map(_*2)
.filter(_%3 ==0)
.headOption
.getOrElse(100)
)
6

If we had started off with a list that would filter out everything, then we should get the default of 100.

println(List(1,2)
.map(_*2)
.filter(_%3 ==0)
.headOption
.getOrElse(100)
)
100

--

--