Exemple #1
0
with open('aws_regions.json') as json_file:
    aws_regions = json.load(json_file)
regions = aws_regions.get('Regions', [])

# --- Inventory initialization

inventory = {}

# --- Argumentation. See function check_arguments.
#
# If we find log level parameter, we adjust log level.
# If we find no service name, we inventory all services.
# Else we only inventory services passed in cmd line.

arguments = utils.check_arguments(sys.argv[1:])
nb_arg = len(arguments)

# if no arguments, we try all AWS services
if (nb_arg == 0):
    arguments = config.SUPPORTED_COMMANDS
    arguments.remove(
        'ce'
    )  # For it's not free, cost explorer is removed from defaults inventory. You need to call it explicitly.

# --- Displaying execution parameters
print('-' * 100)
print('Number of services   :', len(arguments))
print('Services List        :', str(arguments))
print('-' * 100)
print()
Exemple #2
0
import res.network as net
import res.fact as fact
import res.security as security
import res.analytics as analytics
import res.management as mgn
import res.business as bus
import res.integration as integ
import res.awsthread as awsthread

# --- Argumentation. See function check_arguments.
#
# If we find log level parameter, we adjust log level.
# If we find no service name, we inventory all services.
# Else we only inventory services passed in cmd line.

profile_name, arguments, boto3_config = utils.check_arguments(sys.argv[1:])
nb_arg = len(arguments)

# if no arguments, we try all AWS services
if (nb_arg == 0):
    arguments = config.SUPPORTED_COMMANDS
    arguments.remove(
        'ce'
    )  # For it's not free, cost explorer is removed from defaults inventory. You need to call it explicitly.

# --- Displaying execution parameters
print('-' * 100)
print('Number of services   :', len(arguments))
print('Services List        :', str(arguments))
print('-' * 100)
print()