asdf and terraform (or vault or packer)

Using the asdf version manager to manage versions of various binaries like terraform, vault or packer is easily done by following the instructions below:

  1. Download and install asdf if you haven’t got it already (https://asdf-vm.com/#/core-manage-asdf)
  2. If you want to install the latest version of terraform for example do the following:

Renaming multiple files in linux

Problem

You would like to rename multiple files, replacing some text with something else (like replacing Pixies_The with Pixies).

Solution

Install the rename utility

and replace the text as follows

Get/Set platform information

To get or set in environment variables the platform information of a system you can use the following:

Taken from the installation instructions of the Operator SKD here: https://master.sdk.operatorframework.io/docs/installation/

Upgrading node and yarn

Problem

You are getting the following error when trying to use yarn:

Solution

Upgrade yarn

Which should give the updated yarn version:

Upgrade node version with the correct version from above (ie 10.0.0)

And then the needed versions would have been installed:

Forcing https with wordpress on dreamhost

In order to be able to force the http to https redirection when using wordpress in dreamhost use the following (taken from https://help.dreamhost.com/hc/en-us/articles/215747758-Force-your-site-to-load-securely-with-an-htaccess-file) :

Using port number in Terraform output

Problem

You would like to output some additional information (ie port number) in addition to the variable provided by Terraform.

Solution

Use interpolation of the Terraform variable using ${var} together with the rest of the string you would like to output, like:

More information about the language https://learn.hashicorp.com/tutorials/terraform/outputs?in=terraform/configuration-language

Creating two types of IAM users in AWS using the CLI

To create a user in AWS IAM using the CLI (after you have configured it), use the following:

Create a user with programmatic access (access key ID and secret access key):

And for a user with console access: