Skip to content

Instantly share code, notes, and snippets.

@joatmon08
joatmon08 / README.md
Created October 13, 2021 13:27
Draw.io Export Script

Draw.io Export Script

For diagrams in books and other content.

Prerequisites

  • Mac OS X (run on Intel)
  • Draw.io v15.4.0+

Run

@joatmon08
joatmon08 / bucket.tf
Last active August 19, 2020 15:56
S3 Bucket Example for Permissions Toggle
variable "enable_object_editor" {
default = false
type = bool
description = "enables object editor for current aws account"
}
data "aws_caller_identity" "current" {}
resource "aws_s3_bucket" "my_bucket" {
bucket = "my_bucket"
@joatmon08
joatmon08 / Dockerfile.bundled
Last active December 5, 2019 04:46
Local Provisioner Debugging
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y --no-install-recommends wget unzip python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
RUN wget --no-check-certificate https://s3.amazonaws.com/aws-cli/awscli-bundle.zip \
&& unzip awscli-bundle.zip \
&& ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
@joatmon08
joatmon08 / crd.sh
Created November 26, 2019 17:20
Bash script to activate Chrome Remote Desktop
#!/bin/bash -
HOSTNAME=$(terraform output hostname)
GCLOUD_PROJECT=$(terraform output project)
GCLOUD_ZONE=$(terraform output gcloud_zone)
USER=$(terraform output user)
CODE=$(terraform output crd_code)
PIN=$(terraform output crd_pin)
echo $SSH_PUBLIC_KEY > ${HOME}/.ssh/google_compute_engine.pub
chmod 0600 ${HOME}/.ssh/google_compute_engine.pub

As a developer advocate for HashiCorp, Rosemary works to bridge the technical and cultural barriers between infrastructure engineers and application developers. She has a fascination for solving intractable problems with code, whether it be helping an infrastructure engineer learn to code or an application developer troubleshoot infrastructure failures. She also interfaces with vendors, clients, startups, and open source projects to find creative software solutions for infrastructure. When she is not drawing on whiteboards, Rosemary valiantly attempts to hack stacks of various infrastructure systems on her laptop while foraging for tasty victuals around the world.

@joatmon08
joatmon08 / debug.log
Last active August 7, 2019 21:03
Plan stalls due to failed tiller during `helm_resource` state refresh
2019/08/07 16:57:02 [WARN] Invalid log level: "1". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
2019/08/07 16:57:02 [INFO] Terraform version: 0.12.6
2019/08/07 16:57:02 [INFO] Go runtime version: go1.12.4
2019/08/07 16:57:02 [INFO] CLI args: []string{"/Users/rosemarywang/software/bin/terraform", "plan"}
2019/08/07 16:57:02 [DEBUG] Attempting to open CLI config file: /Users/rosemarywang/.terraformrc
2019/08/07 16:57:02 Loading CLI configuration from /Users/rosemarywang/.terraformrc
2019/08/07 16:57:02 [INFO] CLI command args: []string{"plan"}
2019/08/07 16:57:02 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/08/07 16:57:02 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/08/07 16:57:02 [DEBUG] New state was assigned lineage "8e57eb1c-ff5a-6685-1827-f90d923576ef"
@joatmon08
joatmon08 / app.tf
Last active March 13, 2024 10:40
Terraform Example for Azure App Gateway & App Service
locals {
app_services = [
{
kind = "Linux"
sku = {
tier = "Standard"
size = "S1"
}
},
{
@joatmon08
joatmon08 / tf-012-rundown.md
Last active March 8, 2024 04:38
Terraform v0.12.0 Rundown

Terraform v0.12.0 Rundown

Informal list of references, useful links, and examples referencing Terraform 0.12 related patterns and examples.

Links

@joatmon08
joatmon08 / s3.tf
Created May 2, 2019 22:12
TDD-Infra-bucket-terraform
resource "aws_s3_bucket" "bucket" {
bucket = "${var.bucket_name}"
acl = "private"
policy = "${file("policies/bucket.json")}"
}
resource "aws_s3_bucket_public_access_block" "bucket" {
bucket = "${aws_s3_bucket.bucket.id}"
block_public_acls = true
@joatmon08
joatmon08 / TDD-infra-bucket-01-policy.json
Created May 2, 2019 19:55
TDD-infra-bucket-01-policy
{
"Version": "2012-10-17",
"Id": "MyBucketPolicy",
"Statement": [
{
"Sid": "statement1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AccountID:user/test"
},