What is User Data in AWS, Azure, or Terraform?

Problem scenario
You have heard about user data in AWS, Azure, or Terraform. What is it? What does user data include?

AWS User Data versus Terraform User Data

Answer for AWS
Generally it is a customization that the account owner configured to apply to an EC-2 instance when it first launches. It is either a shell script or a cloud-init directive that is used when an EC-2 instance is launched (according to Amazon’s website).

How Do You Get EC-2 Instances to Get IP Addresses by Default?

Problem scenario
In AWS when you try to create an EC-2 instance, on step #3 to “Configure Instance Details”, you are not getting an auto-assigned public IP address. You see this message:

“No default subnet found
Please choose another subnet in your default VPC, or choose another VPC.”

What should you do?

Solution
As of November 2020,

How Do You Troubleshoot the GCP BigQuery Error ‘Table name “foobar” missing dataset while no default dataset is set in the request’?

Problem scenario
You run a BigQuery query. But you get a pop-up message that says ‘Table name “mockdata” missing dataset while no default dataset is set in the request.’

What should you do?

Solution
Did you specify a dataset (or database name) before foobar?

For example, if your dataset is called “cool”, your BigQuery query should refer to “foobar” as “cool.foobar”.

How Do You Write a Terraform Module in AWS?

Problem scenario
You want to write a Terraform module in AWS. What do you do?

Solution
You will use the keyword “module” in a .tf file, and you will use either “terraform init” or “terraform get” to install the module. The directions below were adapted from https://www.howtoforge.com/how-to-create-a-terraform-module/.

Prerequisite
You need to have Terraform installed;

How Do You Troubleshoot the InsufficientFreeAddressSpaceInVpc Error?

Problem scenario
You run an AWS CLI command. But you get this message:

An error occurred (InsufficientFreeAddressSpaceInVpc) when calling the CreateDefaultSubnet operation: The VPC ‘vpc-123abcd’ does not have enough free address space to allocate an additional /20 subnet.

How do you troubleshoot this AWS CLI error?

Solution
Go to the VPC section of AWS. Find the VPC in the error and click on it.

How Do You Use Terraform and Kubernetes in a Simple Way (as a Proof of Concept)?

Problem scenario
You want to use Terraform and Kubernetes (in EKS). How do you do this in a simple way to test it out?

Solution
Prerequisite

This assumes you have deployed EKS. If you need assistance, see this posting.
This assumes you have installed Terraform. If you need assistance, see this posting.

Procedures

  1. This first step is optional.

How Do You Fix the AWS CLI Error “Following required service principals [eks.amazonaws.com] were not found in the trust relationships”?

Problem scenario
You run an AWS CLI command, but you get this error:

An error occurred (InvalidParameterException) when calling the CreateNodegroup operation: Following required service principals [eks.amazonaws.com] were not found in the trust relationships of clusterRole arn:aws:iam::12345678910:role/foobar

How do you fix this?

Solution
Draft a command like this (but replace “12345677810:role/foobar” with the equivalent string in the error,

How Do You Create an EC-2 Instance Running RHEL 8.x in the AWS Web UI?

Problem scenario
You want to use the AWS Management Console to create a server. What do you do?

Solution
Prerequisite

This assumes you have already configured a .ppk file, and you know its password. If you need assistance, see this posting.

Procedures

  1. Log into the AWS management console (aws.amazon.com).