Skip to content

Instantly share code, notes, and snippets.

2016/05/17 11:16:06 [DEBUG] Checking variable noop: var.vpc_id
2016/05/17 11:16:06 [DEBUG] hasDestroyEdgeInPath: Looking for destroy edge: module.example_autoscaling_module.module.autoscaling_instance_security_group.var.vpc_id - *terraform.GraphNodeConfigVariableFlat
2016/05/17 11:16:06 [DEBUG] hasDestroyEdgeInPath: Looking for destroy edge: module.example_autoscaling_module.module.autoscaling_instance_security_group.aws_security_group.security_group - *terraform.GraphNodeConfigResourceFlat
2016/05/17 11:16:06 [DEBUG] hasDestroyEdgeInPath: Looking for destroy edge: module.example_autoscaling_module.output.instance_security_group_id - *terraform.GraphNodeConfigOutputFlat
2016/05/17 11:16:06 [DEBUG] hasDestroyEdgeInPath: Looking for destroy edge: module.example_autoscaling_module.module.autoscaling_instance_security_group.output.security_group_id - *terraform.GraphNodeConfigOutputFlat
2016/05/17 11:16:06 [DEBUG] hasDestroyEdgeInPath: Looking for destroy edge: module.example_autoscaling_module.output.instance_se
AWS generated: "{\"Statement\":[{\"Action\":[\"s3:PutObject\",\"s3:GetObject\",\"s3:DeleteObject\"],\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/FooAdmins\"},\"Resource\":\"arn:aws:s3:::s3.lab.vcts.local/*\",\"Sid\":\"\"},{\"Action\":\"s3:ListBucket\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:role/FooAdmins\"},\"Resource\":\"arn:aws:s3:::s3.lab.vcts.local\",\"Sid\":\"\"}],\"Version\":\"2012-10-17\"}"
Data source generated: "{\"Statement\":[{\"Action\":[\"s3:GetObject\",\"s3:DeleteObject\",\"s3:PutObject\"],\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"arn:aws:iam::123456789012:role/FooAdmins\"]},\"Resource\":[\"arn:aws:s3:::s3.lab.vcts.local/*\"]},{\"Action\":[\"s3:ListBucket\"],\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"arn:aws:iam::123456789012:role/FooAdmins\"]},\"Resource\":[\"arn:aws:s3:::s3.lab.vcts.local\"]}],\"Version\":\"2012-10-17\"}"
@vancluever
vancluever / test.txt
Last active October 2, 2016 20:51
Terraform - schema_test.go - failing test for TestSchemaMap_Diff
"Complex structure with list of computed string should mark root set as computed": {
Schema: map[string]*Schema{
"outer": &Schema{
Type: TypeSet,
Optional: true,
Elem: &Resource{
Schema: map[string]*Schema{
"outer_str": &Schema{
Type: TypeString,
Optional: true,
@vancluever
vancluever / snippet.go
Created December 5, 2016 15:43
NewDockerAPIDriver Function for Packer
// NewDockerAPIDriver loads an instance of the Docker API driver. It will
// also log into a docker registry if the appropriate options are defined.
//
// Configuration is handled in the following order:
// * tls_verify on: Use NewTLSClient
// * This breaks if ca_certificate, client_certificate, and client_key are
// not provided.
// * NewClient, if endpoint is supplied
// * NewEnvClient if all other options have been exhausted.
//
@vancluever
vancluever / teleport-webasset-curl-fail.txt
Created January 2, 2017 02:18
Teleport webassets download fail (fonts and icons)
$ curl -k -v https://127.0.0.1:3080/web/app/assets/fonts/fontawesome-webfont.woff2 > /dev/null
* Trying 127.0.0.1...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 3080 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
@vancluever
vancluever / Dockerfile.teleport.v1.3.1
Created January 2, 2017 02:25
Quick Dockerfile for Gravitational Teleport (http://gravitational.com/teleport/)
FROM ubuntu:latest
RUN apt-get update && apt-get -y install curl make && \
cd /tmp && \
curl -LO https://github.com/gravitational/teleport/releases/download/v1.3.1/teleport-v1.3.1-linux-amd64-bin.tar.gz && \
tar zxvf teleport-v1.3.1-linux-amd64-bin.tar.gz && \
cd teleport && \
make install && \
rm -rf /tmp/* && \
rm -rf /var/lib/apt/lists
@vancluever
vancluever / ipcalcandplan.sh
Created January 27, 2017 21:10
Bash script to calculate a set of subnets off a network address
#!/usr/bin/env bash
# ip_to_decmial takes a dotted-quad IPv4 address and returns the decimal form
# on stdout.
ip_to_decmial() {
local ip_bytes=(${1//./ })
local ip_decimal=0
for n in 0 1 2 3; do
ip_decimal=$(( ip_decimal | ip_bytes[n] << 8 * 3 - 8 * n ))
@vancluever
vancluever / main.tf
Created February 9, 2017 18:34
Sample terraform-provider-acme config
variable "email_address" {
type = "string"
}
variable "domain" {
type = "string"
}
resource "tls_private_key" "private_key" {
algorithm = "RSA"
@vancluever
vancluever / dectoipv4.js
Created February 17, 2017 19:25
IPv4 decimal to dotted quad conversion - https://jsfiddle.net/t7fu2fgy/ - works in Google Apps Script too
function decimalToIPv4(decIpAddr) {
ipBytes = [];
for (i=0;i<=3;i++) {
ipBytes.push((decIpAddr >> 8 * 3 - 8 * i) & 255);
}
return ipBytes.join(".");
}
@vancluever
vancluever / rndpass.rb
Created February 21, 2017 21:58
Ruby random password generation - classic example
PW_RANGE = [*'0'..'9', *'A'..'Z', *'a'..'z'].freeze
password = Array.new(16) { PW_RANGE.sample }.join
puts password