Skip to content

Instantly share code, notes, and snippets.

View strongoose's full-sized avatar
🦕

Dan Strong strongoose

🦕
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ouroboros8 on github.
  • I am ouroboros8 (https://keybase.io/ouroboros8) on keybase.
  • I have a public key ASB4WVpWgBJGUThGvF9vjTameUdKEe0vUzj0ZG_aUX_x1wo

To claim this, I am signing this object:

@strongoose
strongoose / inline-initial-create.log
Last active February 14, 2017 16:11
Inline launchconfig debug logs
2017/02/14 14:53:18 [INFO] Terraform version: 0.8.6 df4bcf64828598a25bd41f00470b2ab3a66f3169
2017/02/14 14:53:18 [INFO] CLI args: []string{"/opt/terraform/terraform-0.8.6", "apply"}
2017/02/14 14:53:18 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 14:53:18 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 14:53:18 [DEBUG] Attempting to open CLI config file: /home/dan/.terraformrc
2017/02/14 14:53:18 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/02/14 14:53:18 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 14:53:18 [DEBUG] vertex "module.asg (orphan)": static expanding
2017/02/14 14:53:18 [DEBUG] DestroyEdgeInclude: Checking: aws_launch_configuration.launch_configuration
2017/02/14 14:53:18 [DEBUG] Checking resource noop: aws_launch_configuration.launch_configuration
@strongoose
strongoose / template-initial-create.log
Created February 14, 2017 16:22
template debug logs
2017/02/14 15:03:37 [INFO] Terraform version: 0.8.6 df4bcf64828598a25bd41f00470b2ab3a66f3169
2017/02/14 15:03:37 [INFO] CLI args: []string{"/opt/terraform/terraform-0.8.6", "apply"}
2017/02/14 15:03:37 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 15:03:37 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 15:03:37 [DEBUG] Attempting to open CLI config file: /home/dan/.terraformrc
2017/02/14 15:03:37 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/02/14 15:03:37 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 15:03:37 [DEBUG] vertex "module.asg (orphan)": static expanding
2017/02/14 15:03:37 [DEBUG] DestroyEdgeInclude: Checking: aws_launch_configuration.launch_configuration
2017/02/14 15:03:37 [DEBUG] No diff, not a noop
2017/02/14 15:21:06 [INFO] Terraform version: 0.8.6 df4bcf64828598a25bd41f00470b2ab3a66f3169
2017/02/14 15:21:06 [INFO] CLI args: []string{"/opt/terraform/terraform-0.8.6", "apply"}
2017/02/14 15:21:06 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 15:21:06 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 15:21:06 [DEBUG] Attempting to open CLI config file: /home/dan/.terraformrc
2017/02/14 15:21:06 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/02/14 15:21:06 [DEBUG] Detected home directory from env var: /home/dan
2017/02/14 15:21:06 [DEBUG] vertex "module.asg": static expanding
2017/02/14 15:21:06 [DEBUG] DestroyEdgeInclude: Checking: aws_launch_configuration.launch_configuration
2017/02/14 15:21:06 [DEBUG] DestroyEdgeInclude: Checking: module.asg.aws_cloudformation_stack.multi_zone_rolling_upgrade_asg
@strongoose
strongoose / source-profile.sh
Last active February 11, 2019 11:47
Export environment variables populated by aws-profile into current shell session
useaws () {
# Usage: useaws <profile-name>
# Exports AWS environment into the current shell
profile=$1
for assignment in $(aws-profile -p "$profile" env | grep '^AWS'); do
export "${assignment?}"
done
}
clearaws () {
#! /usr/bin/env python
'''
Shrink an elasticsearch index my first moving it to a single node, then calling
the shrink API.
'''
import argparse
import logging
import random
import time
@strongoose
strongoose / tfsetup.md
Last active February 6, 2019 11:06
Terraform setup

Install terraform with tfenv

brew install tfenv
tfenv --help
tfenv install latest
terraform --version

Install aws-profile

brew install python3

@strongoose
strongoose / update-packer
Created December 4, 2018 10:38
Packer update script
#!/bin/bash
set -euo pipefail
err() {
1>&2 echo "$@"
exit 1
}
cleanup() {
@strongoose
strongoose / log-json.cljs
Last active February 12, 2019 17:14
ClojureScript: log a JSON object
(defn log-json [obj]
((.-log js/console) (.stringify js/JSON (clj->js obj))))
@strongoose
strongoose / fix-module-providers.md
Last active February 25, 2019 11:54
Instructions for fixing terraform providers in child modules

Fix terraform providers within child modules

The problem

In terraform 0.11.x, providers within child modules are no longer properly supported, e.g. attempting to remove a module which contains the aws provider will result in the following error:

module.<module_name>.<resource>.<resource_name>: configuration for module.<module_name>.provider.aws is not present; a provider configuration block is required for all operations