Skip to content

Instantly share code, notes, and snippets.

View dio-ct's full-sized avatar

Darryl Diosomito dio-ct

View GitHub Profile
@dio-ct
dio-ct / instance-controls-tfstate.py
Created September 8, 2021 12:33
stop and start AWS instances with boto3
import os
import boto3
import argparse
from botocore.exceptions import ClientError
INSTANCE_ID = os.environ.get("S3_INSTANCE_ID", None)
print(INSTANCE_ID)
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)