Skip to content

Instantly share code, notes, and snippets.

@apparentlymart
apparentlymart / Terraform-State-Ideas.md
Last active December 24, 2022 17:10
Terraform State Integrity Issues

Issues with Terraform State Management

The idea of "state" is the lynchpin of Terraform, and yet Terraform's workflow is fraught with gotchas that can lead to the loss or destruction of state. This doc is a set of notes about issues I've encountered, what caused them, and in many cases ideas about how to improve Terraform to avoid or reduce the chances of them.

Each of these scenarios has occured at least within my team. Each time one of these occurs it erodes people's confidence in Terraform, giving it a reputation for being fragile and unforgiving of errors. This this document is not written just to criticize but rather to identify ways in which the situation could be improved.

package main
import (
"fmt"
"math/rand"
"sort"
"time"
)
const (
@joshrotenberg
joshrotenberg / embedded.go
Last active August 4, 2023 08:56
embedded nsqd
package main
// This is a basic example of running an nsqd instance embedded. It creates
// and runs an nsqd with all of the default options, and then produces
// and consumes a single message. You are probably better off running a
// standalone instance, but embedding it can simplify deployment and is
// useful in testing.
// See https://github.com/nsqio/nsq/blob/master/nsqd/options.go and
// https://github.com/nsqio/nsq/blob/master/apps/nsqd/nsqd.go for
@GaretJax
GaretJax / mapping.py
Created November 28, 2013 09:20
Set fastrouter mapping (not tested)
import socket
import struct
ip = '127.0.0.1'
port = 5005
payload = {
'key': '',
'address': '',
}