Skip to content

Instantly share code, notes, and snippets.

View sbutler's full-sized avatar

Stephen J. Butler sbutler

View GitHub Profile
@sbutler
sbutler / op-aws-credentials.py
Last active November 22, 2022 19:18
1Password credentials helper for AWS CLI/SDK
#!/usr/bin/env python3
"""
```
Copyright (c) 2022 University of Illinois Board of Trustees
All rights reserved.
Developed by: Technology Services
University of Illinois at Urbana-Champaign
https://techservices.illinois.edu/
```
aws_organizations_organizational_unit.example["example3"]: Creating...
aws_organizations_organizational_unit.example["example2"]: Creating...
aws_organizations_organizational_unit.example["example1"]: Creating...
aws_servicecatalog_portfolio.example: Creation complete after 0s [id=port-kwl3t4ex2bu3u]
aws_organizations_organizational_unit.example["example2"]: Creation complete after 1s [id=ou-jjxm-6lwl9nji]
aws_organizations_organizational_unit.example["example3"]: Creation complete after 3s [id=ou-jjxm-nci2egzs]
aws_organizations_organizational_unit.example["example1"]: Creation complete after 4s [id=ou-jjxm-a4e6vdj9]
aws_servicecatalog_portfolio_share.example_ou["example1"]: Creating...
aws_servicecatalog_portfolio_share.example_ou["example2"]: Creating...
aws_servicecatalog_portfolio_share.example_ou["example3"]: Creating...
@sbutler
sbutler / debug.log
Created April 2, 2019 03:50
terraform aws_backup_plan cold_storage_after optional (debug)
2019/04/01 22:41:49 [INFO] Terraform version: 0.11.13
2019/04/01 22:41:49 [INFO] Go runtime version: go1.11.5
2019/04/01 22:41:49 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2019/04/01 22:41:49 [DEBUG] Attempting to open CLI config file: /Users/sbutler/.terraformrc
2019/04/01 22:41:49 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/04/01 22:41:49 [INFO] CLI command args: []string{"apply"}
2019/04/01 22:41:49 [INFO] command: empty backend config, returning nil
2019/04/01 22:41:49 [DEBUG] command: no data state file found for backend config
2019/04/01 22:41:49 [DEBUG] New state was assigned lineage "25dc2857-a584-3a09-78e8-1dc7a74ec158"
2019/04/01 22:41:49 [INFO] command: backend initialized: <nil>
from contextlib import contextmanager
import threading
class _Local(threading.local):
def __init__(self):
self.ctxt = {}
_data = _Local()
@contextmanager