disableDetective.py [5:42]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__author__ = "Ryan Nolette"
__copyright__ = "Amazon 2020"
__credits__ = ["Ryan Nolette",
               "https://github.com/sonofagl1tch"]
__license__ = "Apache"
__version__ = "1.0.1"
__maintainer__ = "Ryan Nolette"
__email__ = "detective-demo-requests@amazon.com"
__status__ = "Production"

import argparse
import itertools
import logging
import re
import sys
import typing
import boto3
import botocore.exceptions

FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.INFO, stream=sys.stdout, format=FORMAT)


def setup_command_line(args = None) -> argparse.Namespace:
    """
    Configures and reads command line arguments.

    Returns:
        An argparse.Namespace object containing parsed arguments.

    Raises:
        argpare.ArgumentTypeError if an invalid value is used for
        master_account argument.
    """
    def _master_account_type(val: str, pattern: str = r'[0-9]{12}'):
        if not re.match(pattern, val):
            raise argparse.ArgumentTypeError
        return val
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



enableDetective.py [5:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__author__ = "Ryan Nolette"
__copyright__ = "Amazon 2020"
__credits__ = ["Ryan Nolette",
               "https://github.com/sonofagl1tch"]
__license__ = "Apache"
__version__ = "1.0.1"
__maintainer__ = "Ryan Nolette"
__email__ = "detective-demo-requests@amazon.com"
__status__ = "Production"

import argparse
import itertools
import logging
import re
import sys
import time
import typing
import boto3
import botocore.exceptions

FORMAT = '%(asctime)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.INFO, stream=sys.stdout, format=FORMAT)


def setup_command_line(args = None) -> argparse.Namespace:
    """
    Configures and reads command line arguments.

    Returns:
        An argparse.Namespace object containing parsed arguments.

    Raises:
        argpare.ArgumentTypeError if an invalid value is used for
        master_account argument.
    """
    def _master_account_type(val: str, pattern: str = r'[0-9]{12}'):
        if not re.match(pattern, val):
            raise argparse.ArgumentTypeError
        return val
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



