Skip to content

Instantly share code, notes, and snippets.

@abuxton
abuxton / README.md
Created November 18, 2022 11:16
debugging cloud-init and user_data on cloud platforms
@abuxton
abuxton / README.MD
Last active February 3, 2022 16:11
Scrape Globals from Replicated/terraform enterprise install.sh
@alexbasista
alexbasista / create_tfe_org.py
Last active September 7, 2021 13:03
Examples of interacting with Terraform Cloud/Enterprise API via Python
import os
import sys
import json
import requests
def create_team(hostname, org, name, **kwargs):
"""
POST /organizations/:organization_name/teams
"""
if kwargs.get('tfe_token'):
@nitrocode
nitrocode / terraform-import-mv-guesser.py
Last active April 29, 2020 14:48
Guesses terraform imports based on outputted plan
#!/usr/bin/env python3
# Currently works for 0.12.x
#
# TODO:
# - use json output instead of stdout
#
# Usage:
# terraform plan > plan.out
# python terraform-import-statement-guesser.py plan.out
import sys
@straubt1
straubt1 / tf_version.sh
Last active April 16, 2021 14:57
Disable all but an allow list of Terraform Versions on TFE
#!/bin/bash
# ----- Initialize Environment -----
# export TFE_HOSTNAME="tfe.company.com"
# export TFE_TOKEN="zzz.atlasv1.zzz"
# Allowed values should be seperated by a space
allow_list=(0.12.24 0.12.20 0.11.14)
@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"
@jkodroff
jkodroff / refresh_creds.sh
Last active March 29, 2023 15:58
Bash script to port temporary STS creds to environment variables when MFA is required.
#!/usr/bin/env bash
# Usage: source ./refresh_creds.sh
# NOTE: You *must* source this file because it modifies environment variables.
# Executing the script directly will not change the calling shell's environment.
if [ -z ${AWS_MFA_DEVICE_ARN+x} ]
then
echo "Environment variable AWS_MFA_DEVICE_ARN must be set to the ARN of your MFA device."
return 1
fi
@shortjared
shortjared / list.txt
Last active May 6, 2024 17:16
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@vMarkusK
vMarkusK / Start-UNMAP.psm1
Created September 26, 2016 08:44
This Function will process SCSI UNMAP on VMware Datastores via ESXCLI -V2
function Start-UNMAP {
<#
.SYNOPSIS
Process SCSI UNMAP on VMware Datastores
.DESCRIPTION
This Function will process SCSI UNMAP on VMware Datastores via ESXCLI -V2
.Example
Start-UNMAP -ClusterName myCluster -DSWildcard *RAID5*
@leonardofed
leonardofed / README.md
Last active May 3, 2024 01:24
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.