Skip to content

Instantly share code, notes, and snippets.

View straubt1's full-sized avatar
💭
Terraform All The Things

Tom Straub straubt1

💭
Terraform All The Things
View GitHub Profile
@straubt1
straubt1 / Terraform on Mac M1.md
Created June 14, 2022 18:38
Notes to install Terraform on M1

Installing the amd64 version of Terraform on Mac with M1

Not all Terraform providers are built for arm64.

One solution here is to install Terraform as amd64 which can be easily done from the downloads page.

However, for those who are using and switching between versions of Terraform often, a more streamlined approach is desirable.

Enter asdf.

@straubt1
straubt1 / get-airgap-versions.sh
Last active July 7, 2022 15:07
TFE Download Airgap
#!/bin/bash
# export LICENSE_ID=""
# export PASSWORD=""
[[ -z "$LICENSE_ID" ]] && echo "Please Set LICENSE_ID Environment Variable" && exit 1
[[ -z "$PASSWORD" ]] && echo "Please Set PASSWORD Environment Variable" && exit 1
b64_password=$(echo -n ${PASSWORD} | base64)
@straubt1
straubt1 / main.tf
Last active September 9, 2021 15:45
Using Sensitive Terraform Values in for_each
# Using the 'random_pet' resource to drive the example and treating the "prefix" argument as a secret.
variable "pets" {
description = "Map of 'random_pets' to create. These would be any non-sensitive values used to configure the resource."
type = map(object({
length = number
separator = string
}))
# default for easy demo
@straubt1
straubt1 / tf_version.sh
Last active April 16, 2021 14:57
Disable all but an allow list of Terraform Versions on TFE
#!/bin/bash
# ----- Initialize Environment -----
# export TFE_HOSTNAME="tfe.company.com"
# export TFE_TOKEN="zzz.atlasv1.zzz"
# Allowed values should be seperated by a space
allow_list=(0.12.24 0.12.20 0.11.14)

Cinnamon Bread

Ingredients

  • 1 cup oil
  • 3 large eggs
  • ½ cup milk
  • ½ teaspoon vanilla
  • 1 cup granulated sugar
  • 2 cups flour
@straubt1
straubt1 / recipe.md
Created February 3, 2019 18:02
Korean BBQ Sauce

Ingredients:

  • 2 ½ tbsp. Gochujang paste
  • 2 ½ tbsp. soy sauce
  • ½ tbsp. sesame oil
  • 1 ½ tsp. minced garlic
  • 2 tbsp. brown sugar
@straubt1
straubt1 / gist:7aa550c0851eb94d689b5531ceaba95f
Created December 10, 2020 21:30
Multiple VPC Endpoint Lookup
locals {
vpc_id = "vpc-xxxxx"
endpoints = [
"com.amazonaws.us-west-2.s3",
"com.amazonaws.us-west-2.ec2",
"com.amazonaws.us-west-2.rds",
]
}
@straubt1
straubt1 / README.md
Last active December 8, 2020 17:02
TFE with Custom Provider in Bundle

Terraform Bundle

terraform is 0.13.5

.
├── plugins
│   └── registry.terraform.io
│       ├── hashicorp
│       │   └── pshdns
│       │       └── 2.1.2
@straubt1
straubt1 / README.md
Last active December 2, 2020 22:40
Local Terraform Provider Diffs in TF 0.12 and TF 0.13

TF 0.12.29

main.tf:

terraform {
  required_providers {
    aws = {}
  }
  required_version = "~> 0.12.29"