This guide is the first part about how to get useful information of CloudTrail to alert your system when some configuration has changed. All configurations will be done using Terraform and Go and following the PCI DSS of AWS.
Objective We are going to use an AWS service called CloudTrail to alert our team each time some high severity event happen in our infrastructure. This will be done using CloudTrail, CloudWatch, S3, KMS, Lambda and your metrics or logs system.
[Read More]
How to use CloudTrail to alert changes in your infrastructure using Terraform and Lambda PART-2
This guide is the second part about how to get useful information of CloudTrail to alert your system when some configuration has changed. All configurations will be done using Terraform and Go and following the PCI DSS of AWS.
Objective In the first parte of the guide, we learned about how to create our Trail and contect it with CloudWatch and S3. Now, we are going to process all that information using Lambda, written in Go, to alert our team each time a high severity event happen in our infrastructure.
[Read More]
Multiple JSON tags in Go
Go’s standard JSON library, encoding/json, is very thorough and is good enough for most use cases. Its most used functionalities are Marshal and Unmarshal, which respectively take care of turning a Go struct into its JSON representation and vice versa.
There are, however, situations in which the standard JSON library is simply not enough. One of these situations is wanting to handle several different tags for a single struct. Let’s take a look at an example to understand this problem better:
[Read More]
How to convert your existing indices to ElasticSearch ILM
To migrate existing indices to ILM the first thing you need to do is enabling ILM for new writes so that the existing indices are not written anymore.
Then, we will have to create a new exclusive policy for the existing indices:
PUT _ilm/policy/existing-indexes { "policy": { "phases": { "warm": { "min_age": "30d", "actions": { "allocate": { "require": { "data": "warm" } }, "forcemerge": { "max_num_segments": 1 } } } } } } It’s very important that the new policy does not define the action rollover.
[Read More]
How to use ElasticSearch ILM and save money
This in blog I’m gonna explain how to configure the automatic rotation of indexes in ElasticSearch and how to automatically move the indices to instances that don’t need high IO so it’s cheaper. I’m gonna show you how to do that using the ElasticSearch Hot-Warm architecture.
The process works by writing the data in an alias that points to the current index, when the index mets the conditions defined in the ILM policy then a new index is created and the alias is updated to point to the new index, then the previous index is eventually moved to a warm which should be cheaper.
[Read More]
How to reduce the size of your git repo
To reduce the size of your repository let’s first look at how big is it:
$ du -sh .git 5.6M .git And then counting the objects in the repository:
$ git count-objects -vH count: 181 size: 916.00 KiB in-pack: 9817 packs: 5 size-pack: 3.64 MiB prune-packable: 30 garbage: 0 size-garbage: 0 bytes Then, we can use the git gc command to reduce the size:
$ git gc --aggressive Enumerating objects: 9773, done.
[Read More]
Welcome!
This is gonna be a casual blog, where any engineer can write about any of the problems of their day to day.
It’s an experiment to increase the writing culture within the company.
This blog is part of our repositories and it’s automatically built and published to CloudFront when changes are detected.