This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from terrasnek.api import TFC as TFP | |
# do `pip install terrasnek` before running this script | |
TFE_TOKEN = os.getenv("TFE_TOKEN", None) | |
TFE_URL = os.getenv("TFE_URL", "https://app.terraform.io") # ex: https://app.terraform.io | |
api = TFP(TFE_TOKEN, url=TFE_URL) | |
orgs = api.orgs.list()['data'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# Retrieve workspace resource counts and output sorted list (most resources first) | |
# NB: skeleton code ... only checks for basic errors in responses | |
# Reads inputs from env vars or interactively | |
import argparse | |
from getpass import getpass | |
import os | |
import requests | |
import threading |
OlderNewer