<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ricardo Verhaeg on Medium]]></title>
        <description><![CDATA[Stories by Ricardo Verhaeg on Medium]]></description>
        <link>https://medium.com/@verhaeg?source=rss-f3be369dd1e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rrhWxuKWW5X82H_vGtr_kQ.jpeg</url>
            <title>Stories by Ricardo Verhaeg on Medium</title>
            <link>https://medium.com/@verhaeg?source=rss-f3be369dd1e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:54:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@verhaeg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Moltbook & Openclaw: IA, Inovação e Segurança]]></title>
            <link>https://verhaeg.medium.com/moltbook-openclaw-ia-inova%C3%A7%C3%A3o-e-seguran%C3%A7a-a089ca958e95?source=rss-f3be369dd1e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a089ca958e95</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openclaw]]></category>
            <category><![CDATA[moltbook]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[thoughts]]></category>
            <dc:creator><![CDATA[Ricardo Verhaeg]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 16:57:32 GMT</pubDate>
            <atom:updated>2026-02-10T16:57:32.238Z</atom:updated>
            <content:encoded><![CDATA[<p>Nas últimas semanas, dois nomes passaram a circular com mais intensidade nas discussões sobre agentes de IA: Moltbook e OpenClaw. Ambos chamaram atenção não por promessas vagas, mas por entregarem, na prática, aquilo que o mercado vem buscando: experimentação rápida, agentes autônomos, novas formas de interação e um forte senso de inovação aplicada.</p><p>O Moltbook, em especial, foi altamente inovador. Pode ser visto, de forma bastante justa, como a primeira “rede social de agentes de IA”. Construído com vibecoding, o projeto conseguiu acelerar desenvolvimento, validar rapidamente o produto, encantar usuários e colocar algo funcional no ar em pouco tempo. Do ponto de vista de produto e inovação, éum sucesso.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-3VRuyjzEY06ArymM38HA.png" /><figcaption>Rede social para agentes de IA. Imagem criada com nano banana</figcaption></figure><p>O problema não esteve na ideia nem na velocidade. O Moltbook falhou ao escalar porque não houve o mesmo cuidado com revisão de código, validação pós-entrega e controles básicos de segurança. A plataforma armazenava dados sensíveis, como logs de execução e chaves de API usadas para acessar serviços externos. Pesquisadores identificaram que uma dessas bases estava publicamente acessível, sem qualquer mecanismo de autenticação. O resultado foi a exposição de cerca de 1,5 milhão de chaves de API e informações internas.</p><p><strong>Esse ponto é crucial</strong>: não houve um ataque sofisticado ou exploração avançada. Foi uma falha simples, conhecida e amplamente documentada na engenharia de software. A inovação aconteceu rápido, mas a governança não acompanhou o ritmo.</p><p>Já o OpenClaw representa outro tipo de aprendizado. Ele não foi o primeiro orquestrador de agentes de IA a rodar localmente no computador do usuário, mas trouxe inovação real na forma como opera, na flexibilidade de execução e na arquitetura de agentes. Há originalidade técnica e avanços claros em sua proposta.</p><p>O risco do OpenClaw, no entanto, está menos em falhas pontuais e mais em sua configuração. Muitos dos guardrails de segurança dependem de um alto nível de conhecimento técnico para serem corretamente ajustados. As configurações padrão são mais abertas, o que pode expor usuários menos experientes a riscos como excesso de privilégios, execução não rastreada e comportamentos inesperados dos agentes — exatamente os tipos de problemas que vêm sendo discutidos pela comunidade de segurança.</p><blockquote>Quando observamos esses dois casos em conjunto, a mensagem fica mais equilibrada e mais importante. Não se trata de dizer que IA não acelera, não inova ou não deve ser usada. Pelo contrário: Moltbook e OpenClaw mostram o quanto a IA já é capaz de acelerar entregas e criar coisas genuinamente novas.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQBRKD-BUA0iTP4qsDragA.png" /><figcaption>Inovação e governança deveriam estar conectadas, mas IA ainda está mais adiantada</figcaption></figure><p>O ponto central é outro. A velocidade com que experimentamos e colocamos sistemas de IA em produção muitas vezes supera a maturidade com que tratamos segurança, governança e responsabilidade técnica. Isso não é um problema exclusivo da IA, mas a autonomia desses sistemas amplifica as consequências.</p><p>Esses casos reforçam que liderar tecnologia hoje não é apenas escolher as ferramentas mais novas ou seguir tendências. É assumir responsabilidade pelas decisões técnicas e pelos efeitos do que colocamos em produção. Inovar com IA exige curiosidade e ousadia, mas também exige revisão, validação e limites bem definidos. Segurança e governança não são o oposto da inovação — são o que permitem que ela continue acontecendo de forma sustentável.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPjtkXRu2bcNeyhnESfAvA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a089ca958e95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy ElasticSearch 7 on Azure]]></title>
            <link>https://verhaeg.medium.com/deploy-elasticsearch-7-on-azure-cf1e8019fbde?source=rss-f3be369dd1e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf1e8019fbde</guid>
            <category><![CDATA[hashicorp-packer]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Ricardo Verhaeg]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 17:18:05 GMT</pubDate>
            <atom:updated>2024-01-03T17:18:05.294Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a simple story on the issues I bumped into when trying to deploy an ElasticSearch cluster to Azure and how I managed to finally do so. Although incomplete in some terms, it works quite well and is a base for when I will dive into upgrading to version 8 and all its nuances and requirements, specially regardings certificates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gg0rl5GkRIP9rUDRPVy7A.png" /><figcaption>Pixel art at sunset with conflict between plains and glacier formations</figcaption></figure><p>I did my fare share of creating ElasticSearch clusters using VMs and VMs Groups, both in GCP and AWS but never so far in Azure. Well there is a first time for everything alright! Clouds are basically the same right? Mostly changing their service names (GCE vs EC2 vs VM) and a few peculiarities for each cloud, shouldn&#39;t be difficult… or so I though!</p><p>ElasticSearch is changing their game, favoring cloud deployments of ElasticCloud¹, but this solution is mostly for <em>logging-like </em>usage where they try to make advantage of <strong>hot-warm-cold</strong> nodes. In my use case, I needed all data available all the time, so all nodes would need to me <strong>hot</strong> nodes and to store all possible data the total cost of the cluster would sky-rocket. I reached Elastic before to see if they had some plan or solution that would attend our needs, but unfortunately it does not seem to be their current market.</p><p>To make matters worse, I couldn&#39;t find any prior solution with ElasticSearch 7 automation on Azure. The Elastic <a href="https://github.com/elastic/azure-marketplace">marketplace</a>² repository was outdated and only supported up to version 7.11.1. Tried to fiddle with it a little bit but found out that their solution to Azure was <em>hardcoding</em> the VMs IPs and whenever upscaling or downscaling of the cluster, all the VMs would restart resulting in downtime.</p><p>That&#39;s enough of chit-chat and context explanation, let&#39;s go directly to how I managed to deploy ElasticSearch 7 on Azure with scaling option (not auto-scaling due to not need it) with <em>zero-downtime</em>.</p><h4>Creating the Image</h4><p>Since working with GCP and AWS, creating an ElasticSearch VM image to be used as template was a life-saving solution. So of course I went with <a href="https://www.packer.io/">Packer</a> from Hashicorp. It provided a way to always replicate the same image creation steps, very much similar to Docker files and also allowed me to have different configuration and options depending on which cloud solution I wanted.</p><p>The main point I tried to achieve was that I wanted only one image to rule them all. Having several images (one for each instance type) would mean possible different application versions and hard cluster management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OJhd8KNbSra4Ol_c" /><figcaption>One image to rule them all!</figcaption></figure><p>Example of files for Packer configuration</p><pre>packer {<br>  required_version = &quot;&gt;= 1.8.0&quot;<br><br>  required_plugins {<br>    googlecompute = {<br>      version = &quot;&gt;= 1.1.3&quot;<br>      source  = &quot;github.com/hashicorp/googlecompute&quot;<br>    }<br>    amazon = {<br>      version = &quot;&gt;= 1.2.3&quot;<br>      source = &quot;github.com/hashicorp/amazon&quot;<br>    }<br>    azure = {<br>      source  = &quot;github.com/hashicorp/azure&quot;<br>      version = &quot;&gt;= 2.0.0&quot;<br>    }<br>  }<br>}<br><br>build {<br>  name = &quot;gcp&quot;<br>  description = &quot;Latest version of the Elastic Search image&quot;<br><br>  sources = [&quot;sources.googlecompute.debian&quot;]<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elasticsearch.yml.dist&quot;<br>    source      = &quot;configs/gcp/elasticsearch.yml.dist&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elasticsearch.yml.first.dist&quot;<br>    source      = &quot;configs/gcp/elasticsearch.yml.first.dist&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/promtail.yaml&quot;<br>    source      = &quot;configs/promtail.yaml&quot;<br>  }<br><br>  provisioner &quot;shell&quot; {<br>    environment_vars = [&quot;CLOUD_PROVIDER=gcp&quot;, &quot;ES_VERSION=${var.es_version}&quot;]<br>    script           = &quot;install-packages.sh&quot;<br>  }<br>}<br><br>build {<br>  name = &quot;aws&quot;<br>  description = &quot;Latest version of the Elastic Search image&quot;<br><br>  sources = [&quot;sources.amazon-ebs.debian&quot;]<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elasticsearch.yml.dist&quot;<br>    source      = &quot;configs/aws/elasticsearch.yml.dist&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elasticsearch.yml.first.dist&quot;<br>    source      = &quot;configs/aws/elasticsearch.yml.first.dist&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/promtail.yaml&quot;<br>    source      = &quot;configs/promtail.yaml&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elastic-credentials.json&quot;<br>    source      = &quot;elastic-credential.json&quot;<br>  }<br><br>  provisioner &quot;shell&quot; {<br>    environment_vars = [&quot;CLOUD_PROVIDER=aws&quot;, &quot;ES_VERSION=${var.es_version}&quot;]<br>    script           = &quot;install-packages.sh&quot;<br>  }<br>}<br><br>build {<br>  name = &quot;azure&quot;<br>  description = &quot;Latest version of the Elastic Search image&quot;<br><br>  sources = [&quot;sources.azure-arm.debian&quot;]<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elasticsearch.yml.dist&quot;<br>    source      = &quot;configs/azure/elasticsearch.yml.dist&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elasticsearch.yml.first.dist&quot;<br>    source      = &quot;configs/azure/elasticsearch.yml.first.dist&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/promtail.yaml&quot;<br>    source      = &quot;configs/promtail.yaml&quot;<br>  }<br><br>  provisioner &quot;file&quot; {<br>    destination = &quot;/tmp/elastic-credentials.json&quot;<br>    source      = &quot;elastic-credential.json&quot;<br>  }<br><br>  provisioner &quot;shell&quot; {<br>    environment_vars = [&quot;CLOUD_PROVIDER=azure&quot;, &quot;ES_VERSION=${var.es_version}&quot;]<br>    script           = &quot;install-packages.sh&quot;<br>  }<br>}</pre><p>For GCP and AWS we can install their respective discovery plugins, but Azure discovery plugin was deprecated and internally using the classic version for CLI which by the end of my tests, never worked.</p><p>So instead of relying on the discovery plugin, and that was the reason the ElasticSearch Azure Marketplace did not use it, I had to find some way to configure the cluster in a way to prevent it from going down on each scale up/down. But that was a step for later, the image was done!</p><h4>Launching the VM group — with Terraform</h4><p>In this case, I already had a VPC and subnet created. Private IPs only, range with enough IPs for a very large cluster. Ideally the VPC would also be created using <em>infra-as-code. </em>Consider it previously done that way, let&#39;s focus on creating the cluster only.</p><p>For ElasticSearch 7, it requires a single machine to start as master/data node. In our case, I wanted to end with a <strong>3-master-node</strong> and <strong>N-data-nodes</strong> in which the LoadBalancer would point to the data nodes.</p><pre>resource &quot;azurerm_lb&quot; &quot;main&quot; {<br>  name = var.cluster_name<br>  resource_group_name = data.azurerm_resource_group.main.name<br>  location = data.azurerm_resource_group.main.location<br><br>  sku = &quot;Standard&quot;<br><br>  frontend_ip_configuration {<br>    name = &quot;${var.cluster_name}-ip&quot;<br>    private_ip_address = var.lb_private_ip<br>    private_ip_address_allocation = &quot;Static&quot;<br>    subnet_id = data.azurerm_subnet.main.id<br>  }<br>}<br><br>resource &quot;azurerm_lb_backend_address_pool&quot; &quot;bpepool&quot; {<br>  loadbalancer_id = azurerm_lb.main.id<br>  name            = &quot;ElasticDocsBackEndAddressPool&quot;<br>}<br><br>resource &quot;azurerm_lb_probe&quot; &quot;vmss&quot; {<br>  loadbalancer_id     = azurerm_lb.main.id<br>  name                = &quot;${var.cluster_name}-ssh-running-probe&quot;<br>  port                = 9200<br>  protocol            = &quot;Tcp&quot;<br>  probe_threshold     = 3<br>}<br><br>resource &quot;azurerm_lb_rule&quot; &quot;lbnatrule&quot; {<br>  loadbalancer_id                = azurerm_lb.main.id<br>  name                           = &quot;http&quot;<br>  protocol                       = &quot;Tcp&quot;<br>  frontend_port                  = 9200<br>  backend_port                   = 9200<br>  backend_address_pool_ids       = [azurerm_lb_backend_address_pool.bpepool.id]<br>  frontend_ip_configuration_name = &quot;${var.cluster_name}-ip&quot;<br>  probe_id                       = azurerm_lb_probe.vmss.id<br>}<br><br>resource &quot;azurerm_network_interface&quot; &quot;first&quot; {<br>  count = var.create_first ? 1 : 0<br><br>  name                = &quot;es-first-nic&quot;<br>  resource_group_name = data.azurerm_resource_group.main.name<br>  location = data.azurerm_resource_group.main.location<br><br>  ip_configuration {<br>    name      = &quot;es-first-ip-config&quot;<br>    subnet_id = data.azurerm_subnet.main.id<br>    private_ip_address_allocation = &quot;Dynamic&quot;<br>  }<br>}<br><br>resource &quot;azurerm_linux_virtual_machine&quot; &quot;first&quot; {<br>  count = var.create_first ? 1 : 0<br><br>  name = &quot;docs-initial&quot;<br>  resource_group_name = data.azurerm_resource_group.main.name<br>  location = data.azurerm_resource_group.main.location<br><br>  source_image_id = data.azurerm_image.main.id<br>  size = var.vmss_master_size<br><br>  admin_username = &quot;inspira&quot;<br>  admin_ssh_key {<br>    username   = &quot;inspira&quot;<br>    public_key = var.ssh_key<br>  }<br><br>  network_interface_ids = [ azurerm_network_interface.first[0].id ]<br><br>  os_disk {<br>    caching = &quot;ReadWrite&quot;<br>    storage_account_type = &quot;StandardSSD_LRS&quot;<br>  }<br><br>  user_data = filebase64(&quot;userdata/data.json&quot;)<br>  custom_data = filebase64(&quot;customdata/first.sh&quot;)<br>}<br><br><br>resource &quot;azurerm_linux_virtual_machine_scale_set&quot; &quot;master&quot; {<br>  name = &quot;docs-master&quot;<br>  resource_group_name = data.azurerm_resource_group.main.name<br>  location = data.azurerm_resource_group.main.location<br><br>  source_image_id = data.azurerm_image.main.id<br>  sku = var.vmss_master_size<br><br>  instances = 3<br><br>  admin_username = &quot;inspira&quot;<br>  admin_ssh_key {<br>    username   = &quot;inspira&quot;<br>    public_key = var.ssh_key<br>  }<br><br>  network_interface {<br>    name = &quot;master-nic&quot;<br>    primary = true<br>    ip_configuration {<br>      name = &quot;master-ip-config&quot;<br>      primary = true<br>      subnet_id = data.azurerm_subnet.main.id<br>      version = &quot;IPv4&quot;<br>    }<br>  }<br><br>  upgrade_mode = &quot;Manual&quot;<br><br>  user_data = filebase64(&quot;userdata/data.json&quot;)<br>  custom_data = filebase64(&quot;customdata/master.sh&quot;)<br><br>  secure_boot_enabled = false<br>  zone_balance = true<br>  zones = [1, 2, 3]<br><br>  os_disk {<br>    disk_size_gb = var.os_disk_size<br>    caching = &quot;ReadWrite&quot;<br>    storage_account_type = &quot;StandardSSD_LRS&quot;<br>  }<br>}<br><br>resource &quot;azurerm_linux_virtual_machine_scale_set&quot; &quot;data&quot; {<br>  name = &quot;docs-data&quot;<br>  resource_group_name = data.azurerm_resource_group.main.name<br>  location = data.azurerm_resource_group.main.location<br><br>  source_image_id = data.azurerm_image.main.id<br>  sku = var.vmss_data_size<br><br>  instances = var.data_nodes<br><br>  network_interface {<br>    name = &quot;data-nic&quot;<br>    primary = true<br>    ip_configuration {<br>      name = &quot;data-ip-config&quot;<br>      primary = true<br>      subnet_id = data.azurerm_subnet.main.id<br>      version = &quot;IPv4&quot;<br>      load_balancer_backend_address_pool_ids = [azurerm_lb_backend_address_pool.bpepool.id]<br>    }<br>  }<br><br>  upgrade_mode = &quot;Manual&quot;<br><br>  user_data = filebase64(&quot;userdata/data.json&quot;)<br>  custom_data = filebase64(&quot;customdata/data.sh&quot;)<br><br>  secure_boot_enabled = false<br>  zone_balance = true<br>  zones = [1, 2, 3]<br><br>  os_disk {<br>    disk_size_gb = var.os_disk_size<br>    caching = &quot;ReadWrite&quot;<br>    storage_account_type = &quot;StandardSSD_LRS&quot;<br>  }<br><br>  data_disk {<br>    caching = &quot;ReadWrite&quot;<br>    storage_account_type = &quot;Premium_LRS&quot;<br>    disk_size_gb = var.data_disk_size<br>    lun = 3<br>  }<br>}</pre><p>The two main tricky points here:</p><ol><li>first node master is created with a variable (create_first) and after the cluster is initialized you can set it to false and run again so Terraform will delete that instance.</li><li>CustomData — This is the main point on how to start and configure each node type and machine. An example of custom data for the first master can be seen below</li></ol><pre>#!/usr/bin/env bash<br>#shellcheck disable=SC2016,SC2089,SC2090<br><br>service elasticsearch stop<br><br>rm -rf /etc/elasticsearch/elasticsearch.yml<br><br>echo &quot;Fetching Metadata&quot;<br>USER_DATA=$(curl -H Metadata:true --noproxy &quot;*&quot; &quot;http://169.254.169.254/metadata/instance/compute/userData?api-version=2021-01-01&amp;format=text&quot; | base64 --decode)<br><br>CLUSTER_NAME=$(echo &quot;${USER_DATA}&quot; | jq -rc &#39;.cluster_name&#39;)<br>SEED_HOSTS=docs-initial<br><br>ES_NODE_ROLES=&quot;[ master, data, ingest ]&quot;<br><br>rm -rf /var/lib/elasticsearch/*<br>rm -rf /var/log/elasticsearch/*<br>mkdir -p /var/lib/elasticsearch<br>chown elasticsearch:elasticsearch -Rf /var/lib/elasticsearch<br><br>echo &quot;Fetching Metadata&quot;<br>export CLUSTER_NAME SEED_HOSTS HOSTNAME ES_NODE_ROLES<br>envsubst &#39;$CLUSTER_NAME $SEED_HOSTS $HOSTNAME $ES_NODE_ROLES&#39; &lt; /etc/elasticsearch/elasticsearch.yml.first.dist &gt; /etc/elasticsearch/elasticsearch.yml<br><br>service elasticsearch start</pre><p>All done. Now you have a working private cluster, with a private Load Balancer, pointing to your data nodes. Possible to scale up or down with Terraform. Zero-downtime.</p><p><strong>Beware</strong>: Changing master nodes might lead to cluster downtime or fail to initialize. But you should not mess with the master nodes if all goes well!</p><p><strong>Next step</strong>: ElasticSearch 8 with its certificates requirements oO</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MtLqdItVhn4mBD__" /><figcaption>That&#39;s all folks cartoonish style!</figcaption></figure><h3>References and notes</h3><p>[1] <a href="https://cloud.elastic.co/">https://cloud.elastic.co/</a> and <a href="https://www.elastic.co/cloud">https://www.elastic.co/cloud</a></p><p>[2] <a href="https://github.com/elastic/azure-marketplace">https://github.com/elastic/azure-marketplace</a></p><p>*All images created with Dall-E</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf1e8019fbde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Little funs with Terraform]]></title>
            <link>https://awstip.com/little-funs-with-terraform-81138bed92d?source=rss-f3be369dd1e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/81138bed92d</guid>
            <category><![CDATA[tricks]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Ricardo Verhaeg]]></dc:creator>
            <pubDate>Wed, 02 Mar 2022 17:39:32 GMT</pubDate>
            <atom:updated>2022-03-08T06:03:43.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLj7t_4GA1b0TRli1ipR0Q.jpeg" /><figcaption>Terraformation - ©credits: <a href="https://whvn.cc/45y3w9">https://whvn.cc/45y3w9</a></figcaption></figure><p>Ok, so these past few weeks I’ve been working on planning and constructing a GCP infrastructure from ground zero to production. And tried to work with setting everything with Terraform. I must say that it has been a challenge and conquering of a language and tool that I admire and have yet to fully understand it.</p><p><strong>Note</strong>: There might be some better solutions or a proper way, but with some of the things here, I got the project done and am really proud \o/ Hope it helps some of you.</p><h3>Organization of projects</h3><p>There are plenty of ideas and documents on how to structure your repositories¹, but I found that with the following solution I got the best management and simplicity</p><ul><li>Different repositories for different purposes<br>- One repository for management of Terraform root (Service Accounts, state buckets, SA permissions)<br>- One repository for root infrastructure (folders, policies, network, permissions). I ended up creating a different repo for network (Shared VPC) configuration only.<br>- One repository for each project to define common structure</li><li>Extensive usage of modules and sharing of code and best practices<br>- Please do create your company modules with extensibility and proper defaults and validations</li><li>Standard names for repositories</li><li>Automation! CI/CD all projects, that way will prevent you from having unnecessary SA key or permissions in the cloud and avoid possible human errors.</li></ul><h3>Fun with locals</h3><p>Locals are a way to define common values without the need to declare them as values. They go one step further, in which they are able to get information from Data and other resources to dynamically create new values, increasing readability and reuse of code.</p><p>I will show some use cases with functions and mix-ups of variables, locals and resources that I used.</p><h4>Getting GCP folder ID from another state</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/252a03a8730003777da0375a75ce235a/href">https://medium.com/media/252a03a8730003777da0375a75ce235a/href</a></iframe><p>A little straightforward with usage of Data and Terraform state from another project. This gives us better handling of folder selection instead of passing a variable in the form folders/&lt;id&gt; so no more finding out or fetching ID from a folder and adding a comment in place!</p><p>The extra here is that I’m using <strong>locals</strong> to select a folder from the output where I might have a different set of folders: root level and environment folders. If I want a root level folder I can use for example: core , production , development , etc. And if I want a environment folder I set as variable: environment_folder/production_app and this will select my <strong>Production/App</strong> folder! \o/</p><p>And I use this at my GCP project module, so I don’t need to replicate this code everywhere!</p><h4>Terraform for and setproduct</h4><p>Rollback a little and let’s check how I created variables for each environment folder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12743304f85f08707fa8a7129f994828/href">https://medium.com/media/12743304f85f08707fa8a7129f994828/href</a></iframe><p>Terraform <strong>setproduct</strong>²<strong> </strong>method creates a list of lists with all the combinations between multiple sets. But since I don’t want to use index mapping (0, 1, etc) I created a map, iterating in this list and creating the desired format. Example output:</p><pre>production_app = {<br>  env    = &quot;production&quot;,<br>  folder = &quot;app&quot;<br>}<br>...</pre><h4>Using YAML in Terraform</h4><p>Lastly this part shows how I handled configuring DNS in a way that all developers are able to edit without the need to fully understand DNS or Terraform. Using YAML as a medium to define DNS entries and convert them to resources.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a8f54d6c30397a0971cf598efe71e47/href">https://medium.com/media/2a8f54d6c30397a0971cf598efe71e47/href</a></iframe><p>By using a common language for all developers (YAML) we were able to leave DNS configuration to them and avoid possible human errors. In this case, you can see that we are first fetching and decoding each environment file. And then create the final recordsets based on the contents of the file and some basic definitions.</p><p>I know that we have a lot of room to improve this code, like renaming from a and aaaa to ipv4 and ipv6 respectively or by adding more possible simple mappings and some extra configuration to the YAML file. But for basic usage of developers and our current needs, this is plenty already!</p><p>Hope this few little tricks and fun with Terraform locals gives you some extra hint to perform nice actions, keeping code readable and usable by all your team.</p><p>[1] Codae structure - Terraform best practices<br><a href="https://www.terraform-best-practices.com/code-structure">https://www.terraform-best-practices.com/code-structure</a></p><p>[2] setproduct - Functions<br><a href="https://www.terraform.io/language/functions/setproduct">https://www.terraform.io/language/functions/setproduct</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81138bed92d" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/little-funs-with-terraform-81138bed92d">Little funs with Terraform</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Papo rápido: SLI; SLO; SLA]]></title>
            <link>https://verhaeg.medium.com/papo-r%C3%A1pido-sli-slo-sla-c8c67202f363?source=rss-f3be369dd1e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8c67202f363</guid>
            <category><![CDATA[service-level-objectives]]></category>
            <category><![CDATA[service-level-indicator]]></category>
            <category><![CDATA[service-level-agreement]]></category>
            <dc:creator><![CDATA[Ricardo Verhaeg]]></dc:creator>
            <pubDate>Thu, 23 Sep 2021 21:38:23 GMT</pubDate>
            <atom:updated>2021-09-23T21:38:23.219Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>TL;DR;</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Q65CnFP--o-johZC" /><figcaption><a href="https://blog.newrelic.com/engineering/best-practices-for-setting-slos-and-slis-for-modern-complex-systems/">https://blog.newrelic.com/engineering/best-practices-for-setting-slos-and-slis-for-modern-complex-systems/</a></figcaption></figure><h3>Contexto e Motivação</h3><p>Sei que todos já devem ter ouvido falar de SLA, mas SLA é apenas a última parte da “brincadeira”. Todo SLA é definido em cima de um SLO e todo SLO é definido baseado em SLI. Mais abaixo, definiremos o que são SLIs, SLOs e SLAs, então não se assustem ainda (por favor)!</p><blockquote>Temos que sair da fase de achismo e mudanças as cegas e passar a ter certeza das nossas motivações quando realizamos um ajuste, mudança ou desenvolvemos uma nova funcionalidade. Precisamos de DADOS!</blockquote><p>Hoje conduzimos dezenas de serviços apenas no <em>feeling</em>. Se tem muita reclamação de cliente, arrumamos. Se estoura erro, investigamos e arrumamos. Focando muito em estar sempre a frente de concorrentes com desenvolvimento de novas funcionalidades, achamos que o que temos hoje “funciona”. Mas isso apenas não basta, é importante conseguirmos garantir a resiliência desses serviços e de cada funcionalidade que desenvolvemos e para isso, precisamos de objetivos e dados!</p><p>Uma das formas que podemos usar para trabalhar na resiliência de uma funcionalidade/aplicação é através da definição de objetivos. Ter um número preciso para determinados cenários, a este objetivo damos o nome de SLO (<em>Service Level Objective</em>). O ideal é que qualquer conversa futura sobre se o serviço está operando suficientemente confiável e quais mudanças (arquiteturais ou de fluxo) devemos fazer, devem estar representadas pelos SLOs do serviço e garantir que continuemos a atender os requisitos por ele demonstrados.</p><p>Ter SLOs irá nos ajudar a definir nossas metas, garantindo sempre que todos nossos serviços estejam entregando com o máximo de confiança e que possamos agir o mais rápido possível quando algum deles for afetado.</p><p>É fácil nos perdermos em meio de tantos termos e acrônimos, então antes de falarmos sobre como, vamos ver algumas definições.</p><h3>Definições</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*Q65CnFP--o-johZC" /><figcaption><a href="https://blog.newrelic.com/engineering/best-practices-for-setting-slos-and-slis-for-modern-complex-systems/">https://blog.newrelic.com/engineering/best-practices-for-setting-slos-and-slis-for-modern-complex-systems/</a></figcaption></figure><h4>SLI — Service Level Indicator — métricas</h4><ul><li>O que você efetivamente mede para decidir se está dentro ou fora do seu SLO definido.</li><li>Comumente métricas são usadas, mas em alguns casos, eventos também podem ser usados</li><li>Experiência do usuário pode ser usada para representar um SLI</li><li>ex.: sucesso do cliente ao pedir um relatório é até gerarmos ou até ele fazer o download? Ou ambos são casos a acompanhar?</li></ul><h4>SLO — Service Level Objective — limites</h4><blockquote>The SLO you run at becomes the SLO everyone expects</blockquote><ul><li>Seu objetivo interno, guiando seus limites de métricas.</li><li>Guiado pelos requisitos de negócio e não performance atual</li><li>Em geral, mais estrito que o SLA</li><li>Definido sobre um intervalo de tempo</li><li>“Ponto a partir do qual os usuários podem começar a abrir chamados”</li></ul><h4>SLA — Service Level Agreement — contrato</h4><blockquote>Your SLA is not your SLO</blockquote><ul><li>Qual nível de serviço prometemos ao cliente, com possíveis penalidades caso não cumpramos.</li><li>Mais “leve” que o SLO. ex:</li><li><strong>SLI</strong>: latência da API</li><li><strong>SLO</strong>: Ter <em>99,5%</em> das requisições abaixo de <em>1s</em> nos últimos <em>30 dias</em>.</li><li><strong>SLA</strong>: Responder em até <em>1s</em> em <em>95%</em> das requisições dos últimos <em>30 dias</em>.</li></ul><h3>Comparativo de Resiliências</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e47b2f8dca2c5b7b9c1e89ac010e299/href">https://medium.com/media/1e47b2f8dca2c5b7b9c1e89ac010e299/href</a></iframe><p>O como gerar SLIs, SLOs e SLAs, ficará para um segundo momento ;)</p><h3>Links</h3><ul><li><a href="https://cloud.google.com/blog/products/gcp/availability-part-deux-CRE-life-lessons">SLOs, SLIs, SLAs, oh my — CRE life lessons</a></li><li><a href="https://cloud.google.com/blog/products/management-tools/sre-error-budgets-and-maintenance-windows">SRE error budgets and maintenance windows | Google Cloud Blog</a></li><li><a href="https://cloud.google.com/blog/products/gcp/available-or-not-that-is-the-question-cre-life-lessons">Available . . . or not? That is the question — CRE life lessons</a></li><li><a href="https://www.youtube.com/watch?v=JOFYhFbrsK8">Dan “phrawzty” Maher — Better reliability through SLOs</a></li><li><a href="https://engineering.bitnami.com/articles/implementing-slos-using-prometheus.html">Implementing SLOs using Prometheus and Grafana</a></li><li><a href="https://www.openshift.com/blog/monitoring-services-like-an-sre-in-openshift-servicemesh">Monitoring Services like an SRE in OpenShift ServiceMesh</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8c67202f363" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>