How to add Comments in Terraform
Terraform, a powerful Infrastructure as Code (IaC) tool, allows you to define and provision infrastructure resources. Properly commenting your …
Read Article →In-depth guides, insights, and best practices for modern software engineering
Terraform, a powerful Infrastructure as Code (IaC) tool, allows you to define and provision infrastructure resources. Properly commenting your …
Read Article →If you have Terraform reporting an error but want more information, then you can configure debug logging.
I use this when Terraform gives a vague …
Read Article →Write a program that will calculate the number of trailing zeros in a factorial of a given number.
N! = 1 * 2 * 3 * ... * N
Be careful …
Read Article →The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being …
Read Article →If you want to rename a git branch, then you have a few options, dependent on the use-case.
git branch -a …
Read Article →
Simple, given a string of words, return the length of the shortest word(s).
The string will never be empty and you do not need to …
Read Article →You are asked to square every digit of a number and concatenate them.
For example, if we run 9119 through the function, 811181 will come …
Read Article →Return the number (count) of vowels in the given string.
We will consider a, e, i, o, u as vowels for this challenge (but not y).
The …
Read Article →Given the triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 …
Read Article →
If you are using PowerShell and trying to run a terraform init, you may get an error as follows:
Error: error accessing remote module registry
Failed …
If you want to recursively delete a directory/folder using PowerShell, then you have 2 options.
I needed this when cleaning up build artifacts in a CI …
Read Article →If you get the following message, then there’s a very easy fix:
npm ERR! could not determine executable to run
This error usually means your git …
Read Article →If you get the following error and need a solution, then look no further!
npm ERR! code 1
npm ERR! path ./node_modules/node-sass
npm ERR! command …
Read Article →
You can install lodash through yarn as follows:
Lodash is one of those utility libraries that saves you from writing the same helper functions over …
Read Article →If you need to SHA256 a String in Go, then you can use the crypto/sha256 package.
package main
import ( …
Read Article →
Go ships with an encoding/base64 package that allows for encode and decoding of Base64 strings.
Import the base64 package and then start using it! …
Read Article →In short, you can just do this:
new String(Base64.getEncoder().encode(bytes));
In Java 8 and above, you …
Read Article →If you have an aws_lambda_function block that needs to make use of environment variables, then you can simply do the following:
resource …
Read Article →
You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either …
Read Article →Given a string str, reverse it omitting all non-alphabetic characters.
Examples:
For str = "krishan", the output should be …
Get the ASCII value of a character.
Option 1:
val getAscii = Char::toInt
Option 2:
fun getAscii(c: Char) = c.code …
Read Article →
You have 2 options:
I use this when starting work on a project that’s been sitting for a while and all the dependencies are outdated. The …
Read Article →Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits).
Finish the solution so that it takes an input n (integer) and returns a string that is the decimal representation of the number grouped …