Skip to content

Instantly share code, notes, and snippets.

@dallasmarlow
dallasmarlow / iam.json
Created May 6, 2022 11:13
EKS IAM policy
{
"Statement": [
{
"Action": [
"eks:UpdateClusterVersion",
"eks:UpdateClusterConfig",
"eks:UntagResource",
"eks:TagResource",
"eks:ListClusters",
"eks:DescribeCluster",
package main
import (
"crypto/sha1"
"crypto/tls"
"crypto/x509"
"errors"
"flag"
"fmt"
"log"
resource "kubernetes_manifest" "eks_console_role" {
manifest = {
apiVersion = "rbac.authorization.k8s.io/v1"
kind = "ClusterRole"
metadata = {
name = "eks-console"
}
rules = [
{
"apiGroups" = [
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: eks-console
rules:
- apiGroups:
- ""
resources:
- nodes
import os
import boto3
BATCH_SIZE = 25
REGION = 'us-west-2'
SRC_TABLE = os.environ['SRC']
SNK_TABLE = os.environ['SNK']
client = boto3.client('dynamodb', REGION)
tables = client.list_tables()['TableNames']
@dallasmarlow
dallasmarlow / build.fish
Created July 7, 2021 20:58
docker fish scripts
#!/usr/bin/env fish
source ../include/env.fish
source ../include/build_and_push.fish
@dallasmarlow
dallasmarlow / Makefile
Created June 20, 2021 23:29
simple python Makefile
.DEFAULT_GOAL := push
DIR = $(shell pwd)
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-builtin-variables
base_img := debian:buster-slim
img := abc
build: pull
docker build -t ${img} .
#!/usr/bin/env bash
set -e
REMOTE_CHARTS=(
"https://aws.github.io/eks-charts/|eks|aws-load-balancer-controller|1.1.0"
"https://kubernetes.github.io/dashboard/|kubernetes-dashboard|kubernetes-dashboard|3.0.0"
)
S3_BUCKET=$(terraform output s3_bucket_helm_repo)
if [[ ! -d "./charts" ]]; then
mkdir charts
@dallasmarlow
dallasmarlow / iam.tf
Created June 5, 2021 11:12
S3 helm repo
data "aws_iam_policy_document" "helm_repo_bucket_policy" {
statement {
actions = [
"s3:*",
]
condition {
test = "NotIpAddress"
variable = "aws:SourceIp"
values = [
var.remote_network,
---
apiVersion: v1
kind: Secret
metadata:
namespace: pypicloud
name: pypicloud
type: Opaque
stringData:
config.ini: |
[app:main]