Skip to content

Instantly share code, notes, and snippets.

View xynova's full-sized avatar

Hec xynova

  • Australia
View GitHub Profile
@xynova
xynova / terraform-server.py
Last active May 30, 2022 22:34
Terraform Registry module reference rewrite server
from git import Repo # pip install gitpython
import requests # pip install requests
from http.server import BaseHTTPRequestHandler, HTTPServer
import ssl
import time
import logging
import urllib.parse
import os
import shutil
import fnmatch
@xynova
xynova / google-provider-terraform-import-issue
Created September 12, 2019 02:00
google-provider-terraform-import-issue
terraform import google_kms_crypto_key.etcd_enc_key projects/myproject/locations/australia-southeast1/keyRings/gke-clusters-keyring/cryptoKeys/experiments-cluster-v2-cluster-etcd-key
2019/09/12 01:51:29 [INFO] Terraform version: 0.12.8
2019/09/12 01:51:29 [INFO] Go runtime version: go1.12.9
2019/09/12 01:51:29 [INFO] CLI args: []string{"/usr/local/bin/terraform", "import", "google_kms_crypto_key.etcd_enc_key", "projects/myproject/locations/australia-southeast1/keyRings/gke-clusters-keyring/cryptoKeys/experiments-cluster-v2-cluster-etcd-key"}
2019/09/12 01:51:29 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2019/09/12 01:51:29 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/09/12 01:51:29 [INFO] CLI command args: []string{"import", "google_kms_crypto_key.etcd_enc_key", "projects/myproject/locations/australia-southeast1/keyRings/gke-clusters-keyring/cryptoKeys/experiments-cluster-v2-cluster-etcd-key"}
2019/09/12 01:51:29 [DEBUG] checking for provider in "."
2019/09/12 01:51:29
@xynova
xynova / Connecting Docker cli and Kubectl to Docker Desktop for Windows.md
Last active June 22, 2023 01:02
Connecting Docker cli and Kubectl to Docker Desktop for Windows
@xynova
xynova / Installing Kubernetes and Docker tools on Windows 10 Ubuntu WSL.md
Last active December 5, 2021 15:09
Installing Kubernetes and Docker tools on Windows 10 Ubuntu WSL
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowOpenvpnDnsUpdate",
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets"
],
"Resource": [
@xynova
xynova / openvpn-userdata.tf
Created August 18, 2018 06:54
openvpn-userdata.tf
#!/bin/bash
set -eu
###
echo '!!!! INSTALL PACKAGES'
apt-get -y update && apt install -y awscli mysql-client libmysqlclient-dev
###
echo '!!!! SETUP VARS'
@xynova
xynova / openvpn-launch-config.tf
Created August 18, 2018 06:53
openvpn-launch-config.tf
data "template_file" "ovpn_ext_tpl" {
template = "${file("${path.module}/vm_openvpn.tpl")}"
vars {
tf_r53_zone_id = "${data.aws_route53_zone.openvpn_ext_dns_zone.zone_id}"
tf_r53_fqdn = "${data.aws_route53_zone.openvpn_ext_dns_zone.name}"
tf_rds_fqdn = "${aws_route53_record.openvpn_db.fqdn}"
tf_db_enc = "${var.account_nfo["db_enc_password"]}"
tf_db_prefix = "ext_"
@xynova
xynova / ecr-pullonly.json
Created April 22, 2018 06:05
ECR Registry Pull-Only Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken"
],
"Resource": "*"
},
@xynova
xynova / aws-kubectl Dockerfile
Created April 21, 2018 11:18
aws-kubectl Dockerfile
FROM mesosphere/aws-cli as PKG
RUN apk --no-cache add openssl \
&& wget -q -O kubectl https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/linux/amd64/kubectl \
&& wget -q -O gomplate https://github.com/hairyhenderson/gomplate/releases/download/v2.4.0/gomplate_linux-amd64-slim \
&& chmod +x kubectl gomplate \
&& mv kubectl gomplate /usr/local/bin
ENTRYPOINT ["/bin/sh","-c"]
CMD [""]