Skip to content

Instantly share code, notes, and snippets.

Avatar

Darryl Diosomito dio-ct

View GitHub Profile
@dio-ct
dio-ct / instance-controls-tfstate.py
Created Sep 8, 2021
stop and start AWS instances with boto3
View instance-controls-tfstate.py
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)