Skip to content

Instantly share code, notes, and snippets.

@dalethestirling
dalethestirling / postgres_instance.tf
Created September 10, 2017 22:41
Using provisioner for RDS password generation
resource "aws_db_instance" "postgres" {
identifier = "${var.postgres_id}"
name = "${var.postgres_name}"
engine = "${var.postgres_engine}"
engine_version = "${var.postgres_version}"
multi_az = "${var.postgres_multi_az}"
instance_class = "${var.postgres_class}"
db_subnet_group_name = "${var.postgres_subnet_group}"
@dalethestirling
dalethestirling / buildah.sh
Created June 3, 2022 23:43
Create a container from scratch using buildah
#! /bin/bash
# Basic BASH script to build a python/flask container from scratch using buildah
# Script assumes that it is being run on Centos and tested on Centos 8 stream
# Install software dependencies
sudo yum install -y podman buildah skopeo
@dalethestirling
dalethestirling / deployment.yaml
Last active July 15, 2023 12:03
Kubernetes deployment files for pi-hole.net
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pihole
name: pihole
namespace: pi-hole
spec:
selector:
matchLabels:
@dalethestirling
dalethestirling / account_associating_domain.tf
Last active January 19, 2023 01:03
Associate private hosted zones between AWS accounts using Terraform
variable "accounts_to_associate" {
default = [
{
vpc: "vpc-12345"
zone: "Z3P9TEBI3356I"
}
]
}
data "aws_region" "current" {
@dalethestirling
dalethestirling / deployment.yaml
Last active September 6, 2022 08:59
Kubernetes files for Home assistant on Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: homeassistant
name: homeassistant
namespace: homeassistant
spec:
selector:
matchLabels:
@dalethestirling
dalethestirling / keybase.md
Last active June 17, 2022 01:31
keybase.md

Keybase proof

I hereby claim:

  • I am dalethestirling on github.
  • I am dale_stirling (https://keybase.io/dale_stirling) on keybase.
  • I have a public key ASBf6yoguvhr0qq6y7ck0j_h6-_V-RwOFC619oak9zCPnQo

To claim this, I am signing this object:

@dalethestirling
dalethestirling / pi-hole-pod.yaml
Created April 17, 2022 01:25
Deploy pi-hole-docker as a Pod in Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: pihole
labels:
app: pihole
spec:
hostNetwork: true
containers:
- name: pihole
[crio.runtime]
conmon_cgroup = "pod"
cgroup_manager = "cgroupfs"
@dalethestirling
dalethestirling / 0_variables.tf
Created November 26, 2019 07:12
Terraform 0.12 - merge and output map values based on key
variable "var_a" {
type = "map"
default = {
"a" = "one"
"b" = "two"
}
}
variable "var_b" {
type = "map"
@dalethestirling
dalethestirling / 00_basic_toggle.tf
Last active May 4, 2018 18:40
Feature toggles in Terraform
# Terraform converts boolean values to 1 (true) and 0 (false)
# This passed into the count sets the count to 1 or zero effectivly creating or skipping the resource
variable "create_my_group" { default="true" }
variable "name_my_group" { default="my_group" }
variabble "vpc_my_group" { default="vpcid" }
resource "aws_security_group" "my_group" {
count = "${var.create_my_group}"
name = "${var.name_my_group}"
vpc_id = "${var.vpc_id)"