from __future__ import print_function import re from collections import defaultdict from json import load from multiprocessing.pool import ThreadPool from socket import gethostbyname import boto3 from pkg_resources import resource_stream from app_json_file_cache import AppCache from .client import get_client cache = AppCache('aws_list_all') VERBS_LISTINGS = ['Describe', 'Get', 'List'] SERVICE_BLACKLIST = [ 'alexaforbusiness', # TODO: Mostly organization-specific calls and would need to be queried differently 'apigatewaymanagementapi', # This API allows management of deployed APIs, and requires an endpoint per API. 'cloudsearchdomain', # Domain-specific endpoint required 'kinesis-video-archived-media', # API operating on stream-specific endpoints 'kinesis-video-media', # API operating on stream-specific endpoints 'managedblockchain', # TODO: Unclear, does not have a region 'mediastore-data', # Mediastore Container-specific endpoint required 's3control', # TODO: Account-ID specific endpoint required ] DEPRECATED_OR_DISALLOWED = {
from json import load import boto3 from pkg_resources import resource_stream from app_json_file_cache import AppCache from .client import get_client cache = AppCache('aws_xno') DESCRIBING = ['Describe'] AWS_RESOURCE_QUERIES = { 'ec2': [ 'DescribePrefixLists', 'DescribeAvailabilityZones', 'DescribeVpcEndpointServices', 'DescribeSpotPriceHistory', 'DescribeHostReservationOfferings', 'DescribeRegions', 'DescribeReservedInstancesOfferings', 'DescribeIdFormat', 'DescribeVpcClassicLinkDnsSupport', 'DescribeAggregateIdFormat' ], } NOT_RESOURCE_DESCRIPTIONS = { 'ec2': [ 'DescribeAccountAttributes', 'DescribeDhcpOptions', 'DescribeVpcClassicLink', 'DescribeVpcClassicLinkDnsSupport', 'DescribePrincipalIdFormat' ], }