Embracing the Messiness in Search of Epic Solutions

Category: Programming Language

  • GitHub Copilot: 10+ Ways to Increase Productivity

    What is GitHub Copilot GitHub Copilot is dubbed “an AI pair programmer” to help us write code faster, using a generative AI model developed through a collaboration between GitHub, OpenAI, and Microsoft Azure AI. These days, there are nothing short of AI-powered tools that can do similar things in this space. For example, Tabnine, Google’s… Read More…

  • Terraform: Updating State Using “Moved” Block

    This post illustrates how you can rename existing resources or restructure the Terraform codebase without destroying and recreating the resources using moved block introduced in Terraform 1.1. It also explains some limitations using this new construct. PROBLEM: MODIFYING EXISTING RESOURCE NAME Using a simple resource block below as an example… On apply, one resource is… Read More…

  • Enabling Python VirtualEnv in JupyterLab

    This post illustrates how you can enable Python virtualenv in GCP JupyterLab so that you can organize your .ipynb files to use different virtual environments to keep track of Python package dependencies. PROBLEM You are using GCP JupyterLab. You want to adhere to the Python development best practices by not polluting the global environment with… Read More…

  • Terraform: Handling Errors with try(…)

    PROBLEM Given the following output block:- Sometimes, during an apply or destroy, we may get this error:- One way to fix this is to do conditional expressions like this, but it’s not pretty:- SOLUTION Since Terraform v0.12.20, we can solve this with try and achieve the same outcome:- Read More…

  • Terraform: Skipping Buggy Provider Version

    PROBLEM Given the following required_providers block… … it will allow the following Google provider version: >= 3.8, < 4.0. As of today (May 10), the latest Google provider is 3.20.0. A quick terraform init confirms that. However, sometimes, there’s a need to skip a buggy version. For example, 3.20.0 breaks google_compute_firewall. SOLUTION To achieve that,… Read More…

  • GCP + Terraform: Running Terraform Commands with a Service Account

    PROBLEM When running these commands… … it allows terraform apply to provision the infrastructure using your credential. However, sometimes there’s a need to run Terraform using a service account. SOLUTION First, identify the service account you want to use… for example: [email protected]. Then, create and download the private key for the service account. Command: Output:… Read More…