diff --git a/requirements.txt b/requirements.txt index 02ad114..de09343 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ boto3>=1.2.3 +placebo==0.4.3 six>=1.9.0 PyYAML==3.11 python-dateutil>=2.1,<3.0.0 diff --git a/skew/__init__.py b/skew/__init__.py index f62f2a6..54302df 100644 --- a/skew/__init__.py +++ b/skew/__init__.py @@ -18,7 +18,7 @@ __version__ = open(os.path.join(os.path.dirname(__file__), '_version')).read() -def scan(sku, aws_creds=None): +def scan(sku, **kwargs): """ Scan (i.e. look up) a SKU. @@ -37,4 +37,4 @@ def scan(sku, aws_creds=None): but since there is currently only one (ARN) let's not over-complicate things. """ - return ARN(sku, aws_creds=aws_creds) + return ARN(sku, **kwargs) diff --git a/skew/arn/__init__.py b/skew/arn/__init__.py index 545a896..9f15a0e 100644 --- a/skew/arn/__init__.py +++ b/skew/arn/__init__.py @@ -108,7 +108,7 @@ def choices(self, context=None): all_resources = ['*'] return all_resources - def enumerate(self, context, aws_creds=None): + def enumerate(self, context, **kwargs): LOG.debug('Resource.enumerate %s', context) _, provider, service_name, region, account = context resource_type, resource_id = self._split_resource(self.pattern) @@ -119,7 +119,7 @@ def enumerate(self, context, aws_creds=None): resource_path = '.'.join([provider, service_name, resource_type]) resource_cls = skew.resources.find_resource_class(resource_path) resources.extend(resource_cls.enumerate( - self._arn, region, account, resource_id, aws_creds=aws_creds)) + self._arn, region, account, resource_id, **kwargs)) return resources @@ -132,12 +132,12 @@ def __init__(self, pattern, arn): def choices(self, context=None): return list(self._accounts.keys()) - def enumerate(self, context, aws_creds=None): + def enumerate(self, context, **kwargs): LOG.debug('Account.enumerate %s', context) for match in self.matches(context): context.append(match) for resource in self._arn.resource.enumerate( - context, aws_creds=aws_creds): + context, **kwargs): yield resource context.pop() @@ -179,12 +179,12 @@ def choices(self, context=None): return self._service_region_map.get( service, self._all_region_names) - def enumerate(self, context, aws_creds=None): + def enumerate(self, context, **kwargs): LOG.debug('Region.enumerate %s', context) for match in self.matches(context): context.append(match) for account in self._arn.account.enumerate( - context, aws_creds=aws_creds): + context, **kwargs): yield account context.pop() @@ -198,12 +198,12 @@ def choices(self, context=None): provider = self._arn.provider.pattern return skew.resources.all_services(provider) - def enumerate(self, context, aws_creds=None): + def enumerate(self, context, **kwargs): LOG.debug('Service.enumerate %s', context) for match in self.matches(context): context.append(match) for region in self._arn.region.enumerate( - context, aws_creds=aws_creds): + context, **kwargs): yield region context.pop() @@ -213,12 +213,12 @@ class Provider(ARNComponent): def choices(self, context=None): return ['aws'] - def enumerate(self, context, aws_creds=None): + def enumerate(self, context, **kwargs): LOG.debug('Provider.enumerate %s', context) for match in self.matches(context): context.append(match) for service in self._arn.service.enumerate( - context, aws_creds=aws_creds): + context, **kwargs): yield service context.pop() @@ -228,12 +228,12 @@ class Scheme(ARNComponent): def choices(self, context=None): return ['arn'] - def enumerate(self, context, aws_creds=None): + def enumerate(self, context, **kwargs): LOG.debug('Scheme.enumerate %s', context) for match in self.matches(context): context.append(match) for provider in self._arn.provider.enumerate( - context, aws_creds=aws_creds): + context, **kwargs): yield provider context.pop() @@ -242,11 +242,11 @@ class ARN(object): ComponentClasses = [Scheme, Provider, Service, Region, Account, Resource] - def __init__(self, arn_string='arn:aws:*:*:*:*', aws_creds=None): + def __init__(self, arn_string='arn:aws:*:*:*:*', **kwargs): self.query = None self._components = None self._build_components_from_string(arn_string) - self.aws_creds = aws_creds + self.kwargs = kwargs def __repr__(self): return ':'.join([str(c) for c in self._components]) @@ -308,5 +308,5 @@ def resource(self): def __iter__(self): context = [] - for scheme in self.scheme.enumerate(context, aws_creds=self.aws_creds): + for scheme in self.scheme.enumerate(context, **self.kwargs): yield scheme diff --git a/skew/awsclient.py b/skew/awsclient.py index 090dc94..c6c4282 100644 --- a/skew/awsclient.py +++ b/skew/awsclient.py @@ -13,12 +13,12 @@ # limitations under the License. import logging -import json -import os +import time import datetime import jmespath import boto3 +from botocore.exceptions import ClientError from skew.config import get_config @@ -35,18 +35,20 @@ def json_encoder(obj): class AWSClient(object): - def __init__(self, service_name, region_name, account_id, aws_creds=None): + def __init__(self, service_name, region_name, account_id, **kwargs): self._config = get_config() self._service_name = service_name self._region_name = region_name self._account_id = account_id self._has_credentials = False - if not aws_creds: - # If no creds, need profile name to retrieve creds from ~/.aws/credentials + self.aws_creds = kwargs.get('aws_creds') + if self.aws_creds is None: + # no aws_creds, need profile to get creds from ~/.aws/credentials self._profile = self._config['accounts'][account_id]['profile'] - self.aws_creds = aws_creds + self.placebo = kwargs.get('placebo') + self.placebo_dir = kwargs.get('placebo_dir') + self.placebo_mode = kwargs.get('placebo_mode', 'record') self._client = self._create_client() - self._record_path = self._config.get('record_path', None) @property def service_name(self): @@ -64,49 +66,19 @@ def account_id(self): def profile(self): return self._profile - def _record(self, op_name, kwargs, data): - """ - This is a little hack to enable easier unit testing of the code. - Since botocore has its own set of tests, I'm not interested in - trying to test it again here. So, this recording capability allows - us to save the data coming back from botocore as JSON files which - can then be used by the mocked awsclient in the unit test directory. - To enable this, add something like this to your skew config file: - - record_path: ~/projects/skew/skew/tests/unit/data - - and the JSON data files will get stored in this path. - """ - if self._record_path: - path = os.path.expanduser(self._record_path) - path = os.path.expandvars(path) - path = os.path.join(path, self.service_name) - if not os.path.isdir(path): - os.mkdir(path) - path = os.path.join(path, self.region_name) - if not os.path.isdir(path): - os.mkdir(path) - path = os.path.join(path, self.account_id) - if not os.path.isdir(path): - os.mkdir(path) - filename = op_name - if kwargs: - for k, v in kwargs.items(): - if k != 'query': - filename += '_{}_{}'.format(k, v) - filename += '.json' - path = os.path.join(path, filename) - with open(path, 'wb') as fp: - json.dump(data, fp, indent=4, default=json_encoder, - ensure_ascii=False) - def _create_client(self): if self.aws_creds: session = boto3.Session(**self.aws_creds) else: session = boto3.Session( - profile_name=self.profile, region_name=self.region_name) - return session.client(self.service_name) + profile_name=self.profile) + if self.placebo and self.placebo_dir: + pill = self.placebo.attach(session, self.placebo_dir) + if self.placebo_mode == 'record': + pill.record() + elif self.placebo_mode == 'playback': + pill.playback() + return session.client(self.service_name, region_name=self.region_name) def call(self, op_name, query=None, **kwargs): """ @@ -144,12 +116,21 @@ def call(self, op_name, query=None, **kwargs): data = results.build_full_result() else: op = getattr(self._client, op_name) - data = op(**kwargs) + done = False + data = {} + while not done: + try: + data = op(**kwargs) + done = True + except ClientError as e: + if 'Throttling' in str(e): + time.sleep(1) + except Exception: + done = True if query: data = query.search(data) - self._record(op_name, kwargs, data) return data -def get_awsclient(service_name, region_name, account_id, aws_creds=None): - return AWSClient(service_name, region_name, account_id, aws_creds) +def get_awsclient(service_name, region_name, account_id, **kwargs): + return AWSClient(service_name, region_name, account_id, **kwargs) diff --git a/skew/resources/aws/cloudformation.py b/skew/resources/aws/cloudformation.py index df38b9f..09566d6 100644 --- a/skew/resources/aws/cloudformation.py +++ b/skew/resources/aws/cloudformation.py @@ -18,9 +18,9 @@ class Stack(AWSResource): @classmethod - def enumerate(cls, arn, region, account, resource_id=None, aws_creds=None): + def enumerate(cls, arn, region, account, resource_id=None, **kwargs): resources = super(Stack, cls).enumerate(arn, region, account, - resource_id, aws_creds) + resource_id, **kwargs) for stack in resources: stack.data['Resources'] = [] for stack_resource in stack: diff --git a/skew/resources/aws/lambda.py b/skew/resources/aws/lambda.py index a91521d..84ff74d 100644 --- a/skew/resources/aws/lambda.py +++ b/skew/resources/aws/lambda.py @@ -23,9 +23,9 @@ class Function(AWSResource): @classmethod - def enumerate(cls, arn, region, account, resource_id=None): + def enumerate(cls, arn, region, account, resource_id=None, **kwargs): resources = super(Function, cls).enumerate(arn, region, account, - resource_id) + resource_id, **kwargs) for r in resources: r.data['EventSources'] = [] kwargs = {'FunctionName': r.data['FunctionName']} diff --git a/skew/resources/aws/s3.py b/skew/resources/aws/s3.py index 5e0d406..7a58549 100644 --- a/skew/resources/aws/s3.py +++ b/skew/resources/aws/s3.py @@ -23,10 +23,10 @@ class Bucket(AWSResource): _location_cache = {} @classmethod - def enumerate(cls, arn, region, account, resource_id=None, aws_creds=None): + def enumerate(cls, arn, region, account, resource_id=None, **kwargs): resources = super(Bucket, cls).enumerate(arn, region, account, resource_id, - aws_creds=aws_creds) + **kwargs) region_resources = [] if region is None: region = 'us-east-1' diff --git a/skew/resources/resource.py b/skew/resources/resource.py index d12edd9..4360e6e 100644 --- a/skew/resources/resource.py +++ b/skew/resources/resource.py @@ -23,9 +23,9 @@ class Resource(object): @classmethod - def enumerate(cls, arn, region, account, resource_id=None, aws_creds=None): + def enumerate(cls, arn, region, account, resource_id=None, **kwargs): client = skew.awsclient.get_awsclient( - cls.Meta.service, region, account, aws_creds=aws_creds) + cls.Meta.service, region, account, **kwargs) kwargs = {} do_client_side_filtering = False if resource_id and resource_id != '*': diff --git a/tests/unit/data/autoscaling/ap-northeast-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/ap-northeast-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-northeast-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-northeast-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/ap-northeast-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-northeast-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-northeast-1/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/ap-northeast-1/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-northeast-1/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-northeast-1/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/ap-northeast-1/234567890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-northeast-1/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/ap-southeast-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/ap-southeast-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-1/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/ap-southeast-1/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-1/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-1/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/ap-southeast-1/234567890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-1/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-2/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/ap-southeast-2/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-2/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-2/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/ap-southeast-2/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-2/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-2/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/ap-southeast-2/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-2/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/ap-southeast-2/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/ap-southeast-2/234567890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/ap-southeast-2/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-central-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/eu-central-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-central-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-central-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/eu-central-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-central-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-central-1/2345677890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/eu-central-1/2345677890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-central-1/2345677890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-central-1/2345677890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/eu-central-1/2345677890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-central-1/2345677890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-west-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/eu-west-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-west-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-west-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/eu-west-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-west-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-west-1/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/eu-west-1/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-west-1/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/eu-west-1/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/eu-west-1/234567890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/eu-west-1/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/sa-east-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/sa-east-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/sa-east-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/sa-east-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/sa-east-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/sa-east-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/sa-east-1/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/sa-east-1/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/sa-east-1/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/sa-east-1/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/sa-east-1/234567890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/sa-east-1/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-east-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/us-east-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-east-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-east-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/us-east-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-east-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-east-1/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/us-east-1/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 583a315..0000000 --- a/tests/unit/data/autoscaling/us-east-1/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1,60 +0,0 @@ -[ - { - "AutoScalingGroupARN": "arn:aws:autoscaling:us-east-1:860421987956:autoScalingGroup:1c40bcc1-4382-43c6-82b8-5f9e7f25a38b:autoScalingGroupName/new-prod-test-hello-003", - "HealthCheckGracePeriod": 600, - "SuspendedProcesses": [], - "DesiredCapacity": 1, - "Tags": [ - { - "ResourceType": "auto-scaling-group", - "ResourceId": "new-prod-test-hello-003", - "PropagateAtLaunch": true, - "Value": "CloudNative Bakery", - "Key": "Creator" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "new-prod-test-hello-003", - "PropagateAtLaunch": true, - "Value": "new-prod-test", - "Key": "Name" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "new-prod-test-hello-003", - "PropagateAtLaunch": true, - "Value": "hello-003", - "Key": "Version" - } - ], - "EnabledMetrics": [], - "LoadBalancerNames": [ - "new-prod-test" - ], - "AutoScalingGroupName": "new-prod-test-hello-003", - "DefaultCooldown": 600, - "MinSize": 1, - "Instances": [ - { - "InstanceId": "i-af6a4d50", - "AvailabilityZone": "us-east-1b", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "new-prod-test-hello-003" - } - ], - "MaxSize": 1, - "VPCZoneIdentifier": "subnet-547c8023,subnet-daadb39c,subnet-30596018", - "TerminationPolicies": [ - "ClosestToNextInstanceHour" - ], - "LaunchConfigurationName": "new-prod-test-hello-003", - "CreatedTime": "2015-05-12T21:58:23.357000+00:00", - "AvailabilityZones": [ - "us-east-1b", - "us-east-1a", - "us-east-1d" - ], - "HealthCheckType": "ELB" - } -] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-east-1/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/us-east-1/234567890123/describe_launch_configurations.json deleted file mode 100644 index d553cc9..0000000 --- a/tests/unit/data/autoscaling/us-east-1/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - { - "UserData": "IyEvYmluL2Jhc2gNCg0KYXB0LWdldCB1cGRhdGUNCmFwdC1nZXQgaW5zdGFs\nbCAteSBhcGFjaGUyDQpjYXQgPiAvdmFyL3d3dy9odG1sL2luZGV4Lmh0bWwg\nPDxFT0YNCjxodG1sPg0KPGJvZHkgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6\nICNmZmZmZmYiPg0KPGgxPlRoaXMgaXMgdmVyc2lvbiAwMDE8L2gxPg0KPC9i\nb2R5Pg0KPC9odG1sPg0KRU9G\n", - "IamInstanceProfile": "DevTest-new-prod-test-Resources-exampleInstanceProfile-L237HDBJHQUA", - "EbsOptimized": false, - "LaunchConfigurationARN": "arn:aws:autoscaling:us-east-1:860421987956:launchConfiguration:deb63322-9f04-4645-9d88-921e3a5a2e09:launchConfigurationName/new-prod-test-hello-003", - "InstanceMonitoring": { - "Enabled": true - }, - "ClassicLinkVPCSecurityGroups": [], - "CreatedTime": "2015-05-12T21:58:23.033000+00:00", - "BlockDeviceMappings": [], - "KeyName": "", - "SecurityGroups": [ - "sg-74e1c210" - ], - "LaunchConfigurationName": "new-prod-test-hello-003", - "KernelId": "", - "RamdiskId": "", - "ImageId": "ami-9a562df2", - "InstanceType": "t2.micro", - "AssociatePublicIpAddress": true - } -] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-west-1/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/us-west-1/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-west-1/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-west-1/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/us-west-1/123456789012/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-west-1/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-west-1/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/us-west-1/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-west-1/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-west-1/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/us-west-1/234567890123/describe_launch_configurations.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-west-1/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-west-2/123456789012/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/us-west-2/123456789012/describe_auto_scaling_groups.json deleted file mode 100644 index 09ec90f..0000000 --- a/tests/unit/data/autoscaling/us-west-2/123456789012/describe_auto_scaling_groups.json +++ /dev/null @@ -1,277 +0,0 @@ -[ - { - "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:f07b1616-98b8-44b5-901d-bf84a36dad96:autoScalingGroupName/Production-Workers-workersASG-S7W22TUIBEH5", - "HealthCheckGracePeriod": 0, - "SuspendedProcesses": [], - "DesiredCapacity": 2, - "Tags": [ - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Workers-workersASG-S7W22TUIBEH5", - "PropagateAtLaunch": true, - "Value": "Production", - "Key": "Environment" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Workers-workersASG-S7W22TUIBEH5", - "PropagateAtLaunch": true, - "Value": "Workers", - "Key": "Name" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Workers-workersASG-S7W22TUIBEH5", - "PropagateAtLaunch": true, - "Value": "workersASG", - "Key": "aws:cloudformation:logical-id" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Workers-workersASG-S7W22TUIBEH5", - "PropagateAtLaunch": true, - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Workers/be5961d0-f86d-11e4-89c0-50e2414b0a7c", - "Key": "aws:cloudformation:stack-id" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Workers-workersASG-S7W22TUIBEH5", - "PropagateAtLaunch": true, - "Value": "Production-Workers", - "Key": "aws:cloudformation:stack-name" - } - ], - "EnabledMetrics": [], - "LoadBalancerNames": [], - "AutoScalingGroupName": "Production-Workers-workersASG-S7W22TUIBEH5", - "DefaultCooldown": 120, - "MinSize": 2, - "Instances": [ - { - "InstanceId": "i-824af759", - "AvailabilityZone": "us-west-2c", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "Production-Workers-workersLaunchConfig-1PCB8M7TRRWX0" - }, - { - "InstanceId": "i-a84ff56e", - "AvailabilityZone": "us-west-2a", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "Production-Workers-workersLaunchConfig-1PCB8M7TRRWX0" - } - ], - "MaxSize": 2, - "VPCZoneIdentifier": "subnet-4d68b414,subnet-91e35be6,subnet-5c33a839", - "TerminationPolicies": [ - "Default" - ], - "LaunchConfigurationName": "Production-Workers-workersLaunchConfig-1PCB8M7TRRWX0", - "CreatedTime": "2015-05-12T06:14:03.825000+00:00", - "AvailabilityZones": [ - "us-west-2c", - "us-west-2b", - "us-west-2a" - ], - "HealthCheckType": "EC2" - }, - { - "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:380b822e-8697-4a92-a141-e17acfcb2731:autoScalingGroupName/Production-Bastion-bastionAsg-3O30JDCUT1PS", - "HealthCheckGracePeriod": 0, - "SuspendedProcesses": [], - "DesiredCapacity": 1, - "Tags": [ - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "PropagateAtLaunch": true, - "Value": "Production", - "Key": "Environment" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "PropagateAtLaunch": true, - "Value": "Bastion", - "Key": "Name" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "PropagateAtLaunch": true, - "Value": "bastionAsg", - "Key": "aws:cloudformation:logical-id" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "PropagateAtLaunch": true, - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Bastion/03877fe0-f863-11e4-af73-500160d4da44", - "Key": "aws:cloudformation:stack-id" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "PropagateAtLaunch": true, - "Value": "Production-Bastion", - "Key": "aws:cloudformation:stack-name" - } - ], - "EnabledMetrics": [], - "LoadBalancerNames": [], - "AutoScalingGroupName": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "DefaultCooldown": 120, - "MinSize": 1, - "Instances": [ - { - "InstanceId": "i-f6057a00", - "AvailabilityZone": "us-west-2a", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "Production-Bastion-launchConfig-1WPOQV11EOIKR" - } - ], - "MaxSize": 1, - "VPCZoneIdentifier": "subnet-4d68b414,subnet-91e35be6,subnet-5c33a839", - "TerminationPolicies": [ - "Default" - ], - "LaunchConfigurationName": "Production-Bastion-launchConfig-1WPOQV11EOIKR", - "CreatedTime": "2015-05-12T04:55:19.149000+00:00", - "AvailabilityZones": [ - "us-west-2c", - "us-west-2b", - "us-west-2a" - ], - "HealthCheckType": "EC2" - }, - { - "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:3b8c28bb-e968-48dc-9a4e-38eb9a52dd7a:autoScalingGroupName/Production-NAT-natASG-L40NUGO0DDXB", - "HealthCheckGracePeriod": 0, - "SuspendedProcesses": [], - "DesiredCapacity": 1, - "Tags": [ - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-NAT-natASG-L40NUGO0DDXB", - "PropagateAtLaunch": true, - "Value": "Production", - "Key": "Environment" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-NAT-natASG-L40NUGO0DDXB", - "PropagateAtLaunch": true, - "Value": "NAT", - "Key": "Name" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-NAT-natASG-L40NUGO0DDXB", - "PropagateAtLaunch": true, - "Value": "natASG", - "Key": "aws:cloudformation:logical-id" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-NAT-natASG-L40NUGO0DDXB", - "PropagateAtLaunch": true, - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-NAT/86557bc0-f8d1-11e4-82c7-50e2414b0a18", - "Key": "aws:cloudformation:stack-id" - }, - { - "ResourceType": "auto-scaling-group", - "ResourceId": "Production-NAT-natASG-L40NUGO0DDXB", - "PropagateAtLaunch": true, - "Value": "Production-NAT", - "Key": "aws:cloudformation:stack-name" - } - ], - "EnabledMetrics": [], - "LoadBalancerNames": [], - "AutoScalingGroupName": "Production-NAT-natASG-L40NUGO0DDXB", - "DefaultCooldown": 120, - "MinSize": 1, - "Instances": [ - { - "InstanceId": "i-a69c2851", - "AvailabilityZone": "us-west-2b", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "Production-NAT-natLaunchConfig-5SN86RFELS9K" - } - ], - "MaxSize": 1, - "VPCZoneIdentifier": "subnet-4d68b414,subnet-91e35be6,subnet-5c33a839", - "TerminationPolicies": [ - "Default" - ], - "LaunchConfigurationName": "Production-NAT-natLaunchConfig-5SN86RFELS9K", - "CreatedTime": "2015-05-12T18:08:31.039000+00:00", - "AvailabilityZones": [ - "us-west-2c", - "us-west-2b", - "us-west-2a" - ], - "HealthCheckType": "EC2" - }, - { - "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:b1d27a1e-5bfc-42f8-aaec-314b9d803c3b:autoScalingGroupName/production-can-delete-aws-001", - "HealthCheckGracePeriod": 600, - "SuspendedProcesses": [], - "DesiredCapacity": 3, - "Tags": [ - { - "ResourceType": "auto-scaling-group", - "ResourceId": "production-can-delete-aws-001", - "PropagateAtLaunch": true, - "Value": "production", - "Key": "Name" - } - ], - "EnabledMetrics": [], - "LoadBalancerNames": [ - "bakeryapi-production" - ], - "AutoScalingGroupName": "production-can-delete-aws-001", - "DefaultCooldown": 600, - "MinSize": 3, - "Instances": [ - { - "InstanceId": "i-bf472b7a", - "AvailabilityZone": "us-west-2b", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "production-can-delete-aws-001" - }, - { - "InstanceId": "i-65e75bbe", - "AvailabilityZone": "us-west-2c", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "production-can-delete-aws-001" - }, - { - "InstanceId": "i-1a9217dc", - "AvailabilityZone": "us-west-2a", - "HealthStatus": "Healthy", - "LifecycleState": "InService", - "LaunchConfigurationName": "production-can-delete-aws-001" - } - ], - "MaxSize": 5, - "VPCZoneIdentifier": "subnet-5568b40c,subnet-4a33a82f,subnet-aae35bdd", - "TerminationPolicies": [ - "ClosestToNextInstanceHour" - ], - "LaunchConfigurationName": "production-can-delete-aws-001", - "CreatedTime": "2015-08-25T22:04:51.539000+00:00", - "AvailabilityZones": [ - "us-west-2c", - "us-west-2b", - "us-west-2a" - ], - "HealthCheckType": "ELB" - } -] diff --git a/tests/unit/data/autoscaling/us-west-2/123456789012/describe_launch_configurations.json b/tests/unit/data/autoscaling/us-west-2/123456789012/describe_launch_configurations.json deleted file mode 100644 index 09ed147..0000000 --- a/tests/unit/data/autoscaling/us-west-2/123456789012/describe_launch_configurations.json +++ /dev/null @@ -1,95 +0,0 @@ -[ - { - "UserData": "", - "IamInstanceProfile": "Production-Workers-workersInstanceProfile-O2C0T06GTO9T", - "EbsOptimized": false, - "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:433502988969:launchConfiguration:c903ec74-b439-47b0-9004-8f4cc89091ce:launchConfigurationName/Production-Workers-workersLaunchConfig-1PCB8M7TRRWX0", - "InstanceMonitoring": { - "Enabled": true - }, - "ClassicLinkVPCSecurityGroups": [], - "CreatedTime": "2015-08-17T22:20:07.470000+00:00", - "BlockDeviceMappings": [], - "KeyName": "admin", - "SecurityGroups": [ - "sg-27534e42" - ], - "LaunchConfigurationName": "Production-Workers-workersLaunchConfig-1PCB8M7TRRWX0", - "KernelId": "", - "RamdiskId": "", - "ImageId": "ami-494b5f79", - "InstanceType": "t2.small", - "AssociatePublicIpAddress": true - }, - { - "UserData": "", - "EbsOptimized": false, - "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:433502988969:launchConfiguration:1d5e59dc-938d-4e5f-8578-034f6dad0aa9:launchConfigurationName/Production-Bastion-launchConfig-1WPOQV11EOIKR", - "InstanceMonitoring": { - "Enabled": true - }, - "ClassicLinkVPCSecurityGroups": [], - "CreatedTime": "2015-05-12T04:55:15.908000+00:00", - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "VolumeType": "gp2" - } - } - ], - "KeyName": "admin", - "SecurityGroups": [ - "sg-f6584593" - ], - "LaunchConfigurationName": "Production-Bastion-launchConfig-1WPOQV11EOIKR", - "KernelId": "", - "RamdiskId": "", - "ImageId": "ami-03d0e133", - "InstanceType": "t2.micro", - "AssociatePublicIpAddress": true - }, - { - "IamInstanceProfile": "Production-NAT-natInstanceProfile-1G52MUYU0NAXP", - "EbsOptimized": false, - "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:433502988969:launchConfiguration:39e122b5-f6b3-4a83-a916-ae162f362f4d:launchConfigurationName/Production-NAT-natLaunchConfig-5SN86RFELS9K", - "InstanceMonitoring": { - "Enabled": true - }, - "ClassicLinkVPCSecurityGroups": [], - "CreatedTime": "2015-05-12T18:08:27.878000+00:00", - "BlockDeviceMappings": [], - "KeyName": "", - "SecurityGroups": [ - "sg-ba3825df" - ], - "LaunchConfigurationName": "Production-NAT-natLaunchConfig-5SN86RFELS9K", - "KernelId": "", - "RamdiskId": "", - "ImageId": "ami-69ae8259", - "InstanceType": "t2.micro", - "AssociatePublicIpAddress": true - }, - { - "UserData": "", - "IamInstanceProfile": "Production-Resources-bakeryInstanceProfile-1TKBRQ5FYZINE", - "EbsOptimized": false, - "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:433502988969:launchConfiguration:8c0c4c9e-9f25-4bc5-9e0f-256ef6da55d5:launchConfigurationName/production-can-delete-aws-001", - "InstanceMonitoring": { - "Enabled": true - }, - "ClassicLinkVPCSecurityGroups": [], - "CreatedTime": "2015-08-25T22:04:51.132000+00:00", - "BlockDeviceMappings": [], - "KeyName": "admin", - "SecurityGroups": [ - "sg-c0534ea5" - ], - "LaunchConfigurationName": "production-can-delete-aws-001", - "KernelId": "", - "RamdiskId": "", - "ImageId": "ami-df8f99ef", - "InstanceType": "t2.small", - "AssociatePublicIpAddress": false - } -] diff --git a/tests/unit/data/autoscaling/us-west-2/234567890123/describe_auto_scaling_groups.json b/tests/unit/data/autoscaling/us-west-2/234567890123/describe_auto_scaling_groups.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/autoscaling/us-west-2/234567890123/describe_auto_scaling_groups.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/autoscaling/us-west-2/234567890123/describe_launch_configurations.json b/tests/unit/data/autoscaling/us-west-2/234567890123/describe_launch_configurations.json deleted file mode 100644 index 8c210b9..0000000 --- a/tests/unit/data/autoscaling/us-west-2/234567890123/describe_launch_configurations.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "UserData": "", - "EbsOptimized": false, - "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:860421987956:launchConfiguration:e8e7651c-a030-4613-a3b4-2de963487142:launchConfigurationName/hosh-test-v20", - "InstanceMonitoring": { - "Enabled": true - }, - "ClassicLinkVPCSecurityGroups": [], - "CreatedTime": "2015-07-12T01:31:24.476000+00:00", - "BlockDeviceMappings": [], - "KeyName": "", - "SecurityGroups": [ - "sg-f153e494" - ], - "LaunchConfigurationName": "hosh-test-v20", - "KernelId": "", - "RamdiskId": "", - "ImageId": "ami-fdaea9cd", - "InstanceType": "t2.micro", - "AssociatePublicIpAddress": false - } -] \ No newline at end of file diff --git a/tests/unit/data/cloudformation/us-west-2/123456789012/describe_stack_resources_StackName_FooBar.json b/tests/unit/data/cloudformation/us-west-2/123456789012/describe_stack_resources_StackName_FooBar.json deleted file mode 100644 index bd54dfe..0000000 --- a/tests/unit/data/cloudformation/us-west-2/123456789012/describe_stack_resources_StackName_FooBar.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "StackResources": [ - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Worker-Resources/684bc4e0-4c32-11e5-b67b-500160d4da7c", - "ResourceStatus": "CREATE_COMPLETE", - "ResourceType": "AWS::EC2::SecurityGroupIngress", - "Timestamp": "2015-08-26T20:39:18.642000+00:00", - "StackName": "Production-Worker-Resources", - "PhysicalResourceId": "dbSecurityGroupIngress", - "LogicalResourceId": "dbSecurityGroupIngress" - }, - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Worker-Resources/684bc4e0-4c32-11e5-b67b-500160d4da7c", - "ResourceStatus": "CREATE_COMPLETE", - "ResourceType": "AWS::EC2::SecurityGroup", - "Timestamp": "2015-08-26T20:39:16.348000+00:00", - "StackName": "Production-Worker-Resources", - "PhysicalResourceId": "sg-a77fc8c3", - "LogicalResourceId": "ec2SecurityGroup" - }, - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Worker-Resources/684bc4e0-4c32-11e5-b67b-500160d4da7c", - "ResourceStatus": "UPDATE_COMPLETE", - "ResourceType": "AWS::ElasticLoadBalancing::LoadBalancer", - "Timestamp": "2015-08-26T21:15:29.762000+00:00", - "StackName": "Production-Worker-Resources", - "PhysicalResourceId": "worker-production", - "LogicalResourceId": "elb" - }, - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Worker-Resources/684bc4e0-4c32-11e5-b67b-500160d4da7c", - "ResourceStatus": "CREATE_COMPLETE", - "ResourceType": "AWS::EC2::SecurityGroup", - "Timestamp": "2015-08-26T20:38:57.834000+00:00", - "StackName": "Production-Worker-Resources", - "PhysicalResourceId": "sg-d77fc8b3", - "LogicalResourceId": "elbSecurityGroup" - }, - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Worker-Resources/684bc4e0-4c32-11e5-b67b-500160d4da7c", - "ResourceStatus": "CREATE_COMPLETE", - "ResourceType": "AWS::IAM::Role", - "Timestamp": "2015-08-26T20:38:52.422000+00:00", - "StackName": "Production-Worker-Resources", - "PhysicalResourceId": "Production-Worker-Resources-workersIamRole-436UOCN5ITI3", - "LogicalResourceId": "workersIamRole" - }, - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Worker-Resources/684bc4e0-4c32-11e5-b67b-500160d4da7c", - "ResourceStatus": "CREATE_COMPLETE", - "ResourceType": "AWS::IAM::InstanceProfile", - "Timestamp": "2015-08-26T20:40:55.821000+00:00", - "StackName": "Production-Worker-Resources", - "PhysicalResourceId": "Production-Worker-Resources-workersInstanceProfile-1MX8GHOXXDU95", - "LogicalResourceId": "workersInstanceProfile" - } - ], - "ResponseMetadata": { - "HTTPStatusCode": 200, - "RequestId": "a236e60a-8266-11e5-ba6f-7fb96a223003" - } -} diff --git a/tests/unit/data/cloudformation/us-west-2/123456789012/describe_stacks.json b/tests/unit/data/cloudformation/us-west-2/123456789012/describe_stacks.json deleted file mode 100644 index 901ceb2..0000000 --- a/tests/unit/data/cloudformation/us-west-2/123456789012/describe_stacks.json +++ /dev/null @@ -1,43 +0,0 @@ -[ - { - "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/FooBar/440b1fa0-452e-11e5-8646-500160d4da18", - "Description": "This stack contains all of the policies and roles needed by FooBar", - "Parameters": [ - { - "ParameterValue": "535edf1e-b9ca-4e3e-9522-059643fe4749", - "ParameterKey": "ExternalId" - }, - { - "ParameterValue": "123456789012", - "ParameterKey": "AssumingAccountId" - } - ], - "Tags": [], - "Outputs": [ - { - "Description": "FooBar Instance Profile", - "OutputKey": "BakerInstanceProfile", - "OutputValue": "FooBar" - }, - { - "Description": "The version ID for these roles and policies", - "OutputKey": "FooBarPolicyVersionID", - "OutputValue": "20150819" - }, - { - "Description": "The FooBar IAM role ARN", - "OutputKey": "FooBarRoleARN", - "OutputValue": "arn:aws:iam::123456789012:role/FooBar-kk222Xw7I5P7vvy2PpsI3j-FooBarRole-AGPG3O18RIVG" - } - ], - "CreationTime": "2015-08-17T22:21:11.823000+00:00", - "Capabilities": [ - "CAPABILITY_IAM" - ], - "StackName": "FooBar", - "NotificationARNs": [], - "StackStatus": "UPDATE_COMPLETE", - "DisableRollback": false, - "LastUpdatedTime": "2015-08-26T21:04:43.068000+00:00" - } -] diff --git a/tests/unit/data/dynamodb/us-east-1/234567890123/describe_table.json b/tests/unit/data/dynamodb/us-east-1/234567890123/describe_table.json deleted file mode 100644 index 15500d2..0000000 --- a/tests/unit/data/dynamodb/us-east-1/234567890123/describe_table.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "Table": { - "TableArn": "arn:aws:dynamodb:us-east-1:860421987956:table/foo-dev-build-number", - "AttributeDefinitions": [ - { - "AttributeName": "pipeline_id", - "AttributeType": "N" - } - ], - "ProvisionedThroughput": { - "NumberOfDecreasesToday": 0, - "WriteCapacityUnits": 1, - "ReadCapacityUnits": 1 - }, - "TableSizeBytes": 0, - "TableName": "foo-dev-build-number", - "TableStatus": "ACTIVE", - "KeySchema": [ - { - "KeyType": "HASH", - "AttributeName": "pipeline_id" - } - ], - "ItemCount": 0, - "CreationDateTime": "2015-06-11T15:01:21.011000-04:00" - }, - "ResponseMetadata": { - "HTTPStatusCode": 200, - "RequestId": "A6GPO5S1SIKJ7S04OU2IIIH9HBVV4KQNSO5AEMVJF66Q9ASUAAJG" - } -} diff --git a/tests/unit/data/dynamodb/us-east-1/234567890123/list_tables.json b/tests/unit/data/dynamodb/us-east-1/234567890123/list_tables.json deleted file mode 100644 index 7b9235e..0000000 --- a/tests/unit/data/dynamodb/us-east-1/234567890123/list_tables.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "foo-dev-build-number" -] diff --git a/tests/unit/data/dynamodb/us-west-2/123456789012/describe_table.json b/tests/unit/data/dynamodb/us-west-2/123456789012/describe_table.json deleted file mode 100644 index 418096a..0000000 --- a/tests/unit/data/dynamodb/us-west-2/123456789012/describe_table.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Table": { - "TableArn": "arn:aws:dynamodb:us-west-2:123456789012:table/foo", - "AttributeDefinitions": [ - { - "AttributeName": "external_id", - "AttributeType": "S" - }, - { - "AttributeName": "org_key", - "AttributeType": "S" - } - ], - "ProvisionedThroughput": { - "NumberOfDecreasesToday": 0, - "WriteCapacityUnits": 1, - "ReadCapacityUnits": 5 - }, - "TableSizeBytes": 3257, - "TableName": "org-account-link", - "TableStatus": "ACTIVE", - "KeySchema": [ - { - "KeyType": "HASH", - "AttributeName": "org_key" - }, - { - "KeyType": "RANGE", - "AttributeName": "external_id" - } - ], - "ItemCount": 17, - "CreationDateTime": "2015-08-05T14:24:35.814000-04:00" - }, - "ResponseMetadata": { - "HTTPStatusCode": 200, - "RequestId": "BA2HQHD1UAQ1EGMU1HNRFOV85FVV4KQNSO5AEMVJF66Q9ASUAAJG" - } -} diff --git a/tests/unit/data/dynamodb/us-west-2/123456789012/list_tables.json b/tests/unit/data/dynamodb/us-west-2/123456789012/list_tables.json deleted file mode 100644 index 7015f04..0000000 --- a/tests/unit/data/dynamodb/us-west-2/123456789012/list_tables.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "foo", - "bar" -] diff --git a/tests/unit/data/dynamodb/us-west-2/234567890123/describe_table.json b/tests/unit/data/dynamodb/us-west-2/234567890123/describe_table.json deleted file mode 100644 index ccbb0b3..0000000 --- a/tests/unit/data/dynamodb/us-west-2/234567890123/describe_table.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "Table": { - "TableArn": "arn:aws:dynamodb:us-west-2:234567890123:table/foo", - "AttributeDefinitions": [ - { - "AttributeName": "pipeline_id", - "AttributeType": "N" - } - ], - "ProvisionedThroughput": { - "NumberOfDecreasesToday": 0, - "WriteCapacityUnits": 1, - "ReadCapacityUnits": 1 - }, - "TableSizeBytes": 112, - "TableName": "pas256-dev-bakery-build-number", - "TableStatus": "ACTIVE", - "KeySchema": [ - { - "KeyType": "HASH", - "AttributeName": "pipeline_id" - } - ], - "ItemCount": 4, - "CreationDateTime": "2015-07-02T13:32:14.517000-04:00" - }, - "ResponseMetadata": { - "HTTPStatusCode": 200, - "RequestId": "OS8MN97GQL5GLJ5M4RCQQ0DPURVV4KQNSO5AEMVJF66Q9ASUAAJG" - } -} diff --git a/tests/unit/data/dynamodb/us-west-2/234567890123/list_tables.json b/tests/unit/data/dynamodb/us-west-2/234567890123/list_tables.json deleted file mode 100644 index 7015f04..0000000 --- a/tests/unit/data/dynamodb/us-west-2/234567890123/list_tables.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "foo", - "bar" -] diff --git a/tests/unit/data/ec2/ap-northeast-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/ap-northeast-1/123456789012/describe_security_groups.json deleted file mode 100644 index 138297f..0000000 --- a/tests/unit/data/ec2/ap-northeast-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-1152c774" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-75cf1310", - "OwnerId": "123456789012", - "GroupId": "sg-1152c774" - } -] diff --git a/tests/unit/data/ec2/ap-northeast-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/ap-northeast-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/ap-northeast-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/ap-southeast-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/ap-southeast-1/123456789012/describe_security_groups.json deleted file mode 100644 index 827491f..0000000 --- a/tests/unit/data/ec2/ap-southeast-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-8809b7ed" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-05bf7160", - "OwnerId": "123456789012", - "GroupId": "sg-8809b7ed" - } -] diff --git a/tests/unit/data/ec2/ap-southeast-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/ap-southeast-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/ap-southeast-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/ap-southeast-2/123456789012/describe_security_groups.json b/tests/unit/data/ec2/ap-southeast-2/123456789012/describe_security_groups.json deleted file mode 100644 index c9822ef..0000000 --- a/tests/unit/data/ec2/ap-southeast-2/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-9b189bfe" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-7217c217", - "OwnerId": "123456789012", - "GroupId": "sg-9b189bfe" - } -] diff --git a/tests/unit/data/ec2/ap-southeast-2/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/ap-southeast-2/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/ap-southeast-2/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/eu-central-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/eu-central-1/123456789012/describe_security_groups.json deleted file mode 100644 index eb6fa52..0000000 --- a/tests/unit/data/ec2/eu-central-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-29934b40" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-06cb026f", - "OwnerId": "123456789012", - "GroupId": "sg-29934b40" - } -] diff --git a/tests/unit/data/ec2/eu-central-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/eu-central-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/eu-central-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/eu-west-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/eu-west-1/123456789012/describe_security_groups.json deleted file mode 100644 index 5658bf5..0000000 --- a/tests/unit/data/ec2/eu-west-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-57c69932" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-b7d662d2", - "OwnerId": "123456789012", - "GroupId": "sg-57c69932" - } -] diff --git a/tests/unit/data/ec2/eu-west-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/eu-west-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/eu-west-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/sa-east-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/sa-east-1/123456789012/describe_security_groups.json deleted file mode 100644 index 26297e3..0000000 --- a/tests/unit/data/ec2/sa-east-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-d16fdab4" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-44118f21", - "OwnerId": "123456789012", - "GroupId": "sg-d16fdab4" - } -] diff --git a/tests/unit/data/ec2/sa-east-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/sa-east-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/sa-east-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/us-east-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/us-east-1/123456789012/describe_security_groups.json deleted file mode 100644 index 2cf16dc..0000000 --- a/tests/unit/data/ec2/us-east-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-10abf874" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-4192bf24", - "OwnerId": "123456789012", - "GroupId": "sg-10abf874" - } -] diff --git a/tests/unit/data/ec2/us-east-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/us-east-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 5c32b66..0000000 --- a/tests/unit/data/ec2/us-east-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "KeyName": "admin", - "KeyFingerprint": "07:80:64:11:f0:70:5a:49:c0:14:70:8c:2f:31:6b:6b:2c:a4:d6:8e" - } -] \ No newline at end of file diff --git a/tests/unit/data/ec2/us-west-1/123456789012/describe_security_groups.json b/tests/unit/data/ec2/us-west-1/123456789012/describe_security_groups.json deleted file mode 100644 index aab2a22..0000000 --- a/tests/unit/data/ec2/us-west-1/123456789012/describe_security_groups.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-66cb7403" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-7802d61d", - "OwnerId": "123456789012", - "GroupId": "sg-66cb7403" - } -] diff --git a/tests/unit/data/ec2/us-west-1/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/us-west-1/234567890123/describe_key_pairs.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/ec2/us-west-1/234567890123/describe_key_pairs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_instances.json b/tests/unit/data/ec2/us-west-2/123456789012/describe_instances.json deleted file mode 100644 index 145e489..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_instances.json +++ /dev/null @@ -1,177 +0,0 @@ -[ - { - "Monitoring": { - "State": "enabled" - }, - "PublicDnsName": "", - "RootDeviceType": "ebs", - "State": { - "Code": 48, - "Name": "terminated" - }, - "EbsOptimized": false, - "LaunchTime": "2015-08-26T21:11:04+00:00", - "ProductCodes": [], - "StateTransitionReason": "User initiated (2015-08-26 21:23:40 GMT)", - "InstanceId": "i-d8553c1d", - "ImageId": "ami-356f7e05", - "PrivateDnsName": "", - "KeyName": "admin", - "SecurityGroups": [], - "ClientToken": "99778389-2c16-4012-9721-43375cdd53dd_subnet-5c33a839_1", - "InstanceType": "t2.small", - "NetworkInterfaces": [], - "Placement": { - "Tenancy": "default", - "GroupName": "", - "AvailabilityZone": "us-west-2b" - }, - "Hypervisor": "xen", - "BlockDeviceMappings": [], - "Architecture": "x86_64", - "StateReason": { - "Message": "Client.UserInitiatedShutdown: User initiated shutdown", - "Code": "Client.UserInitiatedShutdown" - }, - "RootDeviceName": "/dev/sda1", - "VirtualizationType": "hvm", - "Tags": [ - { - "Value": "healthcheck-001", - "Key": "Version" - }, - { - "Value": "workers", - "Key": "Name" - }, - { - "Value": "workers-healthcheck-001", - "Key": "aws:autoscaling:groupName" - } - ], - "AmiLaunchIndex": 0 - }, - { - "Monitoring": { - "State": "enabled" - }, - "PublicDnsName": "ec2-10-10-10-10.us-west-2.compute.amazonaws.com", - "State": { - "Code": 16, - "Name": "running" - }, - "EbsOptimized": false, - "LaunchTime": "2015-05-12T04:55:23+00:00", - "PublicIpAddress": "52.24.192.183", - "PrivateIpAddress": "10.0.1.243", - "ProductCodes": [], - "VpcId": "vpc-2f0c8f4a", - "StateTransitionReason": "", - "InstanceId": "i-f6057a00", - "ImageId": "ami-03d0e133", - "PrivateDnsName": "ip-10-0-1-243.us-west-2.compute.internal", - "KeyName": "admin", - "SecurityGroups": [ - { - "GroupName": "Production-Bastion-bastionSecurityGroup-F2JNX5NB1PGN", - "GroupId": "sg-f6584593" - } - ], - "ClientToken": "a541431b-b43d-4732-b180-74fa359a6643_subnet-91e35be6_1", - "SubnetId": "subnet-91e35be6", - "InstanceType": "t2.micro", - "NetworkInterfaces": [ - { - "Status": "in-use", - "MacAddress": "06:fd:31:6f:22:8f", - "SourceDestCheck": true, - "VpcId": "vpc-2f0c8f4a", - "Description": "", - "Association": { - "PublicIp": "10.10.10.10", - "PublicDnsName": "ec2-10-10-10-10.us-west-2.compute.amazonaws.com", - "IpOwnerId": "amazon" - }, - "NetworkInterfaceId": "eni-e2454e94", - "PrivateIpAddresses": [ - { - "PrivateDnsName": "ip-10-0-1-243.us-west-2.compute.internal", - "Association": { - "PublicIp": "10.10.10.10", - "PublicDnsName": "ec2-10-10-10-10.us-west-2.compute.amazonaws.com", - "IpOwnerId": "amazon" - }, - "Primary": true, - "PrivateIpAddress": "10.0.1.243" - } - ], - "PrivateDnsName": "ip-10-0-1-243.us-west-2.compute.internal", - "Attachment": { - "Status": "attached", - "DeviceIndex": 0, - "DeleteOnTermination": true, - "AttachmentId": "eni-attach-86e849a7", - "AttachTime": "2015-05-12T04:55:23+00:00" - }, - "Groups": [ - { - "GroupName": "Production-Bastion-bastionSecurityGroup-F2JNX5NB1PGN", - "GroupId": "sg-f6584593" - } - ], - "SubnetId": "subnet-91e35be6", - "OwnerId": "123456789012", - "PrivateIpAddress": "10.0.1.243" - } - ], - "SourceDestCheck": true, - "Placement": { - "Tenancy": "default", - "GroupName": "", - "AvailabilityZone": "us-west-2a" - }, - "Hypervisor": "xen", - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "Status": "attached", - "DeleteOnTermination": true, - "VolumeId": "vol-b60577a4", - "AttachTime": "2015-05-12T04:55:26+00:00" - } - } - ], - "Architecture": "x86_64", - "RootDeviceType": "ebs", - "RootDeviceName": "/dev/sda1", - "VirtualizationType": "hvm", - "Tags": [ - { - "Value": "bastionAsg", - "Key": "aws:cloudformation:logical-id" - }, - { - "Value": "Production-Bastion-bastionAsg-3O30JDCUT1PS", - "Key": "aws:autoscaling:groupName" - }, - { - "Value": "Production-Bastion", - "Key": "aws:cloudformation:stack-name" - }, - { - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Bastion/03877fe0-f863-11e4-af73-500160d4da44", - "Key": "aws:cloudformation:stack-id" - }, - { - "Value": "Bastion", - "Key": "Name" - }, - { - "Value": "Production", - "Key": "Environment" - } - ], - "AmiLaunchIndex": 0 - } -] diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_instances_InstanceIds_['i-30f39af5'].json b/tests/unit/data/ec2/us-west-2/123456789012/describe_instances_InstanceIds_['i-30f39af5'].json deleted file mode 100644 index cd4bb12..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_instances_InstanceIds_['i-30f39af5'].json +++ /dev/null @@ -1,121 +0,0 @@ -[ - { - "Monitoring": { - "State": "enabled" - }, - "PublicDnsName": "ec2-52-25-159-178.us-west-2.compute.amazonaws.com", - "State": { - "Code": 16, - "Name": "running" - }, - "EbsOptimized": false, - "LaunchTime": "2015-08-26T23:52:23+00:00", - "PublicIpAddress": "52.25.159.178", - "PrivateIpAddress": "10.0.2.91", - "ProductCodes": [], - "VpcId": "vpc-2f0c8f4a", - "StateTransitionReason": "", - "InstanceId": "i-30f39af5", - "ImageId": "ami-391d0c09", - "PrivateDnsName": "ip-10-0-2-91.us-west-2.compute.internal", - "KeyName": "admin", - "SecurityGroups": [ - { - "GroupName": "Production-Worker-Resources-ec2SecurityGroup-H5ZOWOLY8R2O", - "GroupId": "sg-a77fc8c3" - } - ], - "ClientToken": "a8717752-7400-4ed2-934a-9be150a818ac_subnet-5c33a839_1", - "SubnetId": "subnet-5c33a839", - "InstanceType": "t2.small", - "NetworkInterfaces": [ - { - "Status": "in-use", - "MacAddress": "02:d8:31:fa:3a:11", - "SourceDestCheck": true, - "VpcId": "vpc-2f0c8f4a", - "Description": "", - "Association": { - "PublicIp": "52.25.159.178", - "PublicDnsName": "ec2-52-25-159-178.us-west-2.compute.amazonaws.com", - "IpOwnerId": "amazon" - }, - "NetworkInterfaceId": "eni-5852f13e", - "PrivateIpAddresses": [ - { - "PrivateDnsName": "ip-10-0-2-91.us-west-2.compute.internal", - "Association": { - "PublicIp": "52.25.159.178", - "PublicDnsName": "ec2-52-25-159-178.us-west-2.compute.amazonaws.com", - "IpOwnerId": "amazon" - }, - "Primary": true, - "PrivateIpAddress": "10.0.2.91" - } - ], - "PrivateDnsName": "ip-10-0-2-91.us-west-2.compute.internal", - "Attachment": { - "Status": "attached", - "DeviceIndex": 0, - "DeleteOnTermination": true, - "AttachmentId": "eni-attach-27a15c2c", - "AttachTime": "2015-08-26T23:52:23+00:00" - }, - "Groups": [ - { - "GroupName": "Production-Worker-Resources-ec2SecurityGroup-H5ZOWOLY8R2O", - "GroupId": "sg-a77fc8c3" - } - ], - "SubnetId": "subnet-5c33a839", - "OwnerId": "433502988969", - "PrivateIpAddress": "10.0.2.91" - } - ], - "SourceDestCheck": true, - "Placement": { - "Tenancy": "default", - "GroupName": "", - "AvailabilityZone": "us-west-2b" - }, - "Hypervisor": "xen", - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "Status": "attached", - "DeleteOnTermination": true, - "VolumeId": "vol-024bb6f6", - "AttachTime": "2015-08-26T23:52:26+00:00" - } - } - ], - "Architecture": "x86_64", - "RootDeviceType": "ebs", - "IamInstanceProfile": { - "Id": "AIPAIBXRTHUE3JLKIRQZ4", - "Arn": "arn:aws:iam::433502988969:instance-profile/Production-Worker-Resources-workersInstanceProfile-1MX8GHOXXDU95" - }, - "RootDeviceName": "/dev/sda1", - "VirtualizationType": "hvm", - "Tags": [ - { - "Value": "CloudNative Bakery", - "Key": "Creator" - }, - { - "Value": "workers-production-healthcheck-003", - "Key": "aws:autoscaling:groupName" - }, - { - "Value": "workers-production", - "Key": "Name" - }, - { - "Value": "healthcheck-003", - "Key": "Version" - } - ], - "AmiLaunchIndex": 0 - } -] \ No newline at end of file diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_instances_InstanceIds_['i-decafbad'].json b/tests/unit/data/ec2/us-west-2/123456789012/describe_instances_InstanceIds_['i-decafbad'].json deleted file mode 100644 index fe51488..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_instances_InstanceIds_['i-decafbad'].json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_network_acls.json b/tests/unit/data/ec2/us-west-2/123456789012/describe_network_acls.json deleted file mode 100644 index ae6c610..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_network_acls.json +++ /dev/null @@ -1,240 +0,0 @@ -[ - { - "Associations": [ - { - "SubnetId": "subnet-4a33a82f", - "NetworkAclId": "acl-48f47a2d", - "NetworkAclAssociationId": "aclassoc-efa6728b" - }, - { - "SubnetId": "subnet-aae35bdd", - "NetworkAclId": "acl-48f47a2d", - "NetworkAclAssociationId": "aclassoc-eda67289" - }, - { - "SubnetId": "subnet-5568b40c", - "NetworkAclId": "acl-48f47a2d", - "NetworkAclAssociationId": "aclassoc-eea6728a" - } - ], - "NetworkAclId": "acl-48f47a2d", - "VpcId": "vpc-2f0c8f4a", - "Tags": [ - { - "Value": "Private EC2 ACL", - "Key": "Name" - }, - { - "Value": "privateSubnetsAcl", - "Key": "aws:cloudformation:logical-id" - }, - { - "Value": "Production-VPC-Subnets-Private", - "Key": "aws:cloudformation:stack-name" - }, - { - "Value": "Production", - "Key": "Environment" - }, - { - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-VPC-Subnets-Private/8d402800-f858-11e4-9e3e-50d50205787c", - "Key": "aws:cloudformation:stack-id" - } - ], - "Entries": [ - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": true, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": true, - "RuleAction": "deny" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": false, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": false, - "RuleAction": "deny" - } - ], - "IsDefault": false - }, - { - "Associations": [ - { - "SubnetId": "subnet-91e35be6", - "NetworkAclId": "acl-50f47a35", - "NetworkAclAssociationId": "aclassoc-f7a67293" - }, - { - "SubnetId": "subnet-4d68b414", - "NetworkAclId": "acl-50f47a35", - "NetworkAclAssociationId": "aclassoc-f6a67292" - }, - { - "SubnetId": "subnet-5c33a839", - "NetworkAclId": "acl-50f47a35", - "NetworkAclAssociationId": "aclassoc-f0a67294" - } - ], - "NetworkAclId": "acl-50f47a35", - "VpcId": "vpc-2f0c8f4a", - "Tags": [ - { - "Value": "Production", - "Key": "Environment" - }, - { - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-VPC-Subnets-Public/91575df0-f858-11e4-af73-500160d4da44", - "Key": "aws:cloudformation:stack-id" - }, - { - "Value": "Public Subnet ACL", - "Key": "Name" - }, - { - "Value": "Production-VPC-Subnets-Public", - "Key": "aws:cloudformation:stack-name" - }, - { - "Value": "publicSubnetsAcl", - "Key": "aws:cloudformation:logical-id" - } - ], - "Entries": [ - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": true, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": true, - "RuleAction": "deny" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": false, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": false, - "RuleAction": "deny" - } - ], - "IsDefault": false - }, - { - "Associations": [ - { - "SubnetId": "subnet-922af9cb", - "NetworkAclId": "acl-316be954", - "NetworkAclAssociationId": "aclassoc-522fef36" - }, - { - "SubnetId": "subnet-c05bc5a5", - "NetworkAclId": "acl-316be954", - "NetworkAclAssociationId": "aclassoc-532fef37" - }, - { - "SubnetId": "subnet-4644f831", - "NetworkAclId": "acl-316be954", - "NetworkAclAssociationId": "aclassoc-5c2fef38" - } - ], - "NetworkAclId": "acl-316be954", - "VpcId": "vpc-fc098f99", - "Tags": [], - "Entries": [ - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": true, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": true, - "RuleAction": "deny" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": false, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": false, - "RuleAction": "deny" - } - ], - "IsDefault": true - }, - { - "Associations": [], - "NetworkAclId": "acl-c9fb75ac", - "VpcId": "vpc-2f0c8f4a", - "Tags": [], - "Entries": [ - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": true, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": true, - "RuleAction": "deny" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 100, - "Protocol": "-1", - "Egress": false, - "RuleAction": "allow" - }, - { - "CidrBlock": "0.0.0.0/0", - "RuleNumber": 32767, - "Protocol": "-1", - "Egress": false, - "RuleAction": "deny" - } - ], - "IsDefault": true - } -] diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_route_tables.json b/tests/unit/data/ec2/us-west-2/123456789012/describe_route_tables.json deleted file mode 100644 index b5ac0da..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_route_tables.json +++ /dev/null @@ -1,137 +0,0 @@ -[ - { - "Associations": [ - { - "SubnetId": "subnet-5568b40c", - "RouteTableAssociationId": "rtbassoc-19f0977c", - "Main": false, - "RouteTableId": "rtb-f6980c93" - }, - { - "RouteTableAssociationId": "rtbassoc-33f59256", - "Main": true, - "RouteTableId": "rtb-f6980c93" - }, - { - "SubnetId": "subnet-aae35bdd", - "RouteTableAssociationId": "rtbassoc-1ef0977b", - "Main": false, - "RouteTableId": "rtb-f6980c93" - }, - { - "SubnetId": "subnet-4a33a82f", - "RouteTableAssociationId": "rtbassoc-18f0977d", - "Main": false, - "RouteTableId": "rtb-f6980c93" - } - ], - "RouteTableId": "rtb-f6980c93", - "VpcId": "vpc-2f0c8f4a", - "PropagatingVgws": [], - "Tags": [], - "Routes": [ - { - "GatewayId": "local", - "DestinationCidrBlock": "10.0.0.0/16", - "State": "active", - "Origin": "CreateRouteTable" - }, - { - "Origin": "CreateRoute", - "DestinationCidrBlock": "0.0.0.0/0", - "InstanceId": "i-a69c2851", - "NetworkInterfaceId": "eni-ee01a789", - "State": "active", - "InstanceOwnerId": "123456789012" - } - ] - }, - { - "Associations": [ - { - "RouteTableAssociationId": "rtbassoc-2340db46", - "Main": true, - "RouteTableId": "rtb-c94fc7ac" - } - ], - "RouteTableId": "rtb-c94fc7ac", - "VpcId": "vpc-fc098f99", - "PropagatingVgws": [], - "Tags": [], - "Routes": [ - { - "GatewayId": "local", - "DestinationCidrBlock": "172.31.0.0/16", - "State": "active", - "Origin": "CreateRouteTable" - }, - { - "GatewayId": "igw-ce5ef8ab", - "DestinationCidrBlock": "0.0.0.0/0", - "State": "active", - "Origin": "CreateRoute" - } - ] - }, - { - "Associations": [ - { - "SubnetId": "subnet-4d68b414", - "RouteTableAssociationId": "rtbassoc-e1f09784", - "Main": false, - "RouteTableId": "rtb-fc980c99" - }, - { - "SubnetId": "subnet-5c33a839", - "RouteTableAssociationId": "rtbassoc-e6f09783", - "Main": false, - "RouteTableId": "rtb-fc980c99" - }, - { - "SubnetId": "subnet-91e35be6", - "RouteTableAssociationId": "rtbassoc-e7f09782", - "Main": false, - "RouteTableId": "rtb-fc980c99" - } - ], - "RouteTableId": "rtb-fc980c99", - "VpcId": "vpc-2f0c8f4a", - "PropagatingVgws": [], - "Tags": [ - { - "Value": "Production", - "Key": "Environment" - }, - { - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-VPC/d1923df0-f84d-11e4-b16d-5001230106a6", - "Key": "aws:cloudformation:stack-id" - }, - { - "Value": "publicRouteTable", - "Key": "aws:cloudformation:logical-id" - }, - { - "Value": "Public route table", - "Key": "Name" - }, - { - "Value": "Production-VPC", - "Key": "aws:cloudformation:stack-name" - } - ], - "Routes": [ - { - "GatewayId": "local", - "DestinationCidrBlock": "10.0.0.0/16", - "State": "active", - "Origin": "CreateRouteTable" - }, - { - "GatewayId": "igw-57d07332", - "DestinationCidrBlock": "0.0.0.0/0", - "State": "active", - "Origin": "CreateRoute" - } - ] - } -] diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_security_groups.json b/tests/unit/data/ec2/us-west-2/123456789012/describe_security_groups.json deleted file mode 100644 index 7d8f3dd..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_security_groups.json +++ /dev/null @@ -1,94 +0,0 @@ -[ - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "default VPC security group", - "IpPermissions": [ - { - "IpProtocol": "-1", - "IpRanges": [], - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-57a6b432" - } - ], - "PrefixListIds": [] - } - ], - "GroupName": "default", - "VpcId": "vpc-2f0c8f4a", - "OwnerId": "123456789012", - "GroupId": "sg-57a6b432" - }, - { - "IpPermissionsEgress": [ - { - "IpProtocol": "-1", - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "UserIdGroupPairs": [], - "PrefixListIds": [] - } - ], - "Description": "Access to Production EC2 instances", - "Tags": [ - { - "Value": "ec2SecurityGroup", - "Key": "aws:cloudformation:logical-id" - }, - { - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-Resources/f945c360-f86d-11e4-9b3b-50d5020578e0", - "Key": "aws:cloudformation:stack-id" - }, - { - "Value": "Production", - "Key": "Environment" - } - ], - "IpPermissions": [ - { - "PrefixListIds": [], - "FromPort": 80, - "IpRanges": [], - "ToPort": 80, - "IpProtocol": "tcp", - "UserIdGroupPairs": [ - { - "UserId": "123456789012", - "GroupId": "sg-f1534e94" - } - ] - }, - { - "PrefixListIds": [], - "FromPort": 22, - "IpRanges": [ - { - "CidrIp": "0.0.0.0/0" - } - ], - "ToPort": 22, - "IpProtocol": "tcp", - "UserIdGroupPairs": [] - } - ], - "GroupName": "Production-Resources-ec2SecurityGroup-MIH2Z1M2SV1U", - "VpcId": "vpc-2f0c8f4a", - "OwnerId": "123456789012", - "GroupId": "sg-c0534ea5" - } -] diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_volumes.json b/tests/unit/data/ec2/us-west-2/123456789012/describe_volumes.json deleted file mode 100644 index 74e7904..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_volumes.json +++ /dev/null @@ -1,185 +0,0 @@ -[ - { - "AvailabilityZone": "us-west-2c", - "Attachments": [ - { - "AttachTime": "2015-08-25T17:37:11+00:00", - "InstanceId": "i-824af759", - "VolumeId": "vol-2fe0cdc8", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-2fe0cdc8", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-5276c616", - "CreateTime": "2015-08-25T17:37:11.215000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2c", - "Attachments": [ - { - "AttachTime": "2015-08-25T22:04:56+00:00", - "InstanceId": "i-65e75bbe", - "VolumeId": "vol-0d98b5ea", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-0d98b5ea", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-cbc6a38c", - "CreateTime": "2015-08-25T22:04:56.735000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2a", - "Attachments": [ - { - "AttachTime": "2015-05-12T04:55:26+00:00", - "InstanceId": "i-f6057a00", - "VolumeId": "vol-b60577a4", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-b60577a4", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-dd51f985", - "CreateTime": "2015-05-12T04:55:26.122000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2a", - "Attachments": [], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-a721e7b2", - "State": "available", - "Iops": 24, - "SnapshotId": "snap-5aabfc1e", - "CreateTime": "2015-07-27T22:04:00.746000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2a", - "Attachments": [ - { - "AttachTime": "2015-08-25T17:39:11+00:00", - "InstanceId": "i-a84ff56e", - "VolumeId": "vol-38a38df6", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-38a38df6", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-5276c616", - "CreateTime": "2015-08-25T17:39:10.947000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2a", - "Attachments": [ - { - "AttachTime": "2015-08-25T22:04:56+00:00", - "InstanceId": "i-1a9217dc", - "VolumeId": "vol-4f311881", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-4f311881", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-cbc6a38c", - "CreateTime": "2015-08-25T22:04:56.347000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2b", - "Attachments": [ - { - "AttachTime": "2015-05-12T18:08:40+00:00", - "InstanceId": "i-a69c2851", - "VolumeId": "vol-ea7badfa", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/xvda" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-ea7badfa", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-27c0ce77", - "CreateTime": "2015-05-12T18:08:40.399000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2b", - "Attachments": [], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-e4271211", - "State": "available", - "Iops": 24, - "SnapshotId": "snap-5aabfc1e", - "CreateTime": "2015-07-27T22:07:37.085000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2b", - "Attachments": [], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-3a794ecf", - "State": "available", - "Iops": 24, - "SnapshotId": "snap-5aabfc1e", - "CreateTime": "2015-07-28T16:05:17.064000+00:00", - "Size": 8 - }, - { - "AvailabilityZone": "us-west-2b", - "Attachments": [ - { - "AttachTime": "2015-08-25T22:04:57+00:00", - "InstanceId": "i-bf472b7a", - "VolumeId": "vol-2a4ebede", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-2a4ebede", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-cbc6a38c", - "CreateTime": "2015-08-25T22:04:57.649000+00:00", - "Size": 8 - } -] \ No newline at end of file diff --git a/tests/unit/data/ec2/us-west-2/123456789012/describe_vpcs.json b/tests/unit/data/ec2/us-west-2/123456789012/describe_vpcs.json deleted file mode 100644 index 66a54d7..0000000 --- a/tests/unit/data/ec2/us-west-2/123456789012/describe_vpcs.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "VpcId": "vpc-2f0c8f4a", - "InstanceTenancy": "default", - "Tags": [ - { - "Value": "theVpc", - "Key": "aws:cloudformation:logical-id" - }, - { - "Value": "Production-VPC", - "Key": "aws:cloudformation:stack-name" - }, - { - "Value": "Production", - "Key": "Environment" - }, - { - "Value": "Production VPC", - "Key": "Name" - }, - { - "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/Production-VPC/d1923df0-f84d-11e4-b16d-5001230106a6", - "Key": "aws:cloudformation:stack-id" - } - ], - "State": "available", - "DhcpOptionsId": "dopt-46d53d23", - "CidrBlock": "10.0.0.0/16", - "IsDefault": false - }, - { - "VpcId": "vpc-fc098f99", - "InstanceTenancy": "default", - "State": "available", - "DhcpOptionsId": "dopt-f3cc2596", - "CidrBlock": "172.31.0.0/16", - "IsDefault": true - } -] diff --git a/tests/unit/data/ec2/us-west-2/234567890123/describe_images_Owners_['self'].json b/tests/unit/data/ec2/us-west-2/234567890123/describe_images_Owners_['self'].json deleted file mode 100644 index 53a9668..0000000 --- a/tests/unit/data/ec2/us-west-2/234567890123/describe_images_Owners_['self'].json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Images": [ - { - "VirtualizationType": "paravirtual", - "Name": "test name", - "Tags": [ - { - "Value": "test name", - "Key": "Name" - } - ], - "Hypervisor": "xen", - "ImageId": "ami-13b9dc64", - "RootDeviceType": "ebs", - "State": "available", - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "DeleteOnTermination": false, - "SnapshotId": "snap-4445ef6d", - "VolumeSize": 8, - "VolumeType": "gp2", - "Encrypted": false - } - }, - { - "DeviceName": "/dev/sdb", - "VirtualName": "ephemeral0" - } - ], - "Architecture": "x86_64", - "ImageLocation": "234567890123/test name", - "KernelId": "aki-52a34525", - "OwnerId": "234567890123", - "RootDeviceName": "/dev/sda1", - "CreationDate": "2015-04-03T13:19:34.000Z", - "Public": false, - "ImageType": "machine" - } - ] -} diff --git a/tests/unit/data/ec2/us-west-2/234567890123/describe_key_pairs.json b/tests/unit/data/ec2/us-west-2/234567890123/describe_key_pairs.json deleted file mode 100644 index 21e431b..0000000 --- a/tests/unit/data/ec2/us-west-2/234567890123/describe_key_pairs.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "KeyName": "admin", - "KeyFingerprint": "85:83:08:25:fa:96:45:ea:c9:15:04:12:af:45:3f:c0:ef:e8:b8:ce" - } -] \ No newline at end of file diff --git a/tests/unit/data/ec2/us-west-2/234567890123/describe_volumes.json b/tests/unit/data/ec2/us-west-2/234567890123/describe_volumes.json deleted file mode 100644 index 8fea0af..0000000 --- a/tests/unit/data/ec2/us-west-2/234567890123/describe_volumes.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "AvailabilityZone": "us-west-2a", - "Attachments": [ - { - "AttachTime": "2015-08-25T22:03:22+00:00", - "InstanceId": "i-f993163f", - "VolumeId": "vol-ea3e1724", - "State": "attached", - "DeleteOnTermination": true, - "Device": "/dev/sda1" - } - ], - "Encrypted": false, - "VolumeType": "gp2", - "VolumeId": "vol-ea3e1724", - "State": "in-use", - "Iops": 24, - "SnapshotId": "snap-bd9c25fb", - "CreateTime": "2015-08-25T22:03:22.153000+00:00", - "Size": 8 - } -] \ No newline at end of file diff --git a/tests/unit/data/elb/us-west-2/123456789012/describe_load_balancers.json b/tests/unit/data/elb/us-west-2/123456789012/describe_load_balancers.json deleted file mode 100644 index c210ea9..0000000 --- a/tests/unit/data/elb/us-west-2/123456789012/describe_load_balancers.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - { - "Subnets": [ - "subnet-4d68b414", - "subnet-5c33a839", - "subnet-91e35be6" - ], - "ListenerDescriptions": [ - { - "Listener": { - "InstancePort": 80, - "SSLCertificateId": "arn:aws:iam::123456789012:server-certificate/cloudfront/foo.bar", - "LoadBalancerPort": 443, - "Protocol": "HTTPS", - "InstanceProtocol": "HTTP" - }, - "PolicyNames": [ - "ELBSecurityPolicy-2015-05" - ] - }, - { - "Listener": { - "InstancePort": 80, - "LoadBalancerPort": 80, - "Protocol": "HTTP", - "InstanceProtocol": "HTTP" - }, - "PolicyNames": [] - } - ], - "HealthCheck": { - "HealthyThreshold": 3, - "Interval": 30, - "Target": "HTTP:80/healthcheck", - "Timeout": 5, - "UnhealthyThreshold": 5 - }, - "VPCId": "vpc-2f0c8f4a", - "BackendServerDescriptions": [], - "Instances": [ - { - "InstanceId": "i-1a9217dc" - }, - { - "InstanceId": "i-65e75bbe" - }, - { - "InstanceId": "i-bf472b7a" - } - ], - "DNSName": "api-production-1476580936.us-west-2.elb.amazonaws.com", - "SecurityGroups": [ - "sg-f1534e94" - ], - "Policies": { - "LBCookieStickinessPolicies": [], - "AppCookieStickinessPolicies": [], - "OtherPolicies": [ - "ELBSecurityPolicy-2015-05", - "ELBSecurityPolicy-2015-03" - ] - }, - "LoadBalancerName": "api-production", - "CreatedTime": "2015-05-12T06:13:43.050000+00:00", - "AvailabilityZones": [ - "us-west-2c", - "us-west-2b", - "us-west-2a" - ], - "Scheme": "internet-facing", - "SourceSecurityGroup": { - "OwnerAlias": "123456789012", - "GroupName": "Production-Resources-elbSecurityGroup-KUUYOUDBBA2M" - } - } -] diff --git a/tests/unit/data/elb/us-west-2/234567890123/describe_load_balancers.json b/tests/unit/data/elb/us-west-2/234567890123/describe_load_balancers.json deleted file mode 100644 index 99555d9..0000000 --- a/tests/unit/data/elb/us-west-2/234567890123/describe_load_balancers.json +++ /dev/null @@ -1,229 +0,0 @@ -[ - { - "Subnets": [ - "subnet-7456e511", - "subnet-9112c3e6", - "subnet-c7cf399e" - ], - "HealthCheck": { - "HealthyThreshold": 3, - "Interval": 30, - "Target": "HTTP:80/", - "Timeout": 5, - "UnhealthyThreshold": 5 - }, - "VPCId": "vpc-7f5e861a", - "BackendServerDescriptions": [], - "Instances": [], - "DNSName": "example-app-2080941558.us-west-2.elb.amazonaws.com", - "SecurityGroups": [ - "sg-3e572c5b" - ], - "Policies": { - "LBCookieStickinessPolicies": [], - "AppCookieStickinessPolicies": [], - "OtherPolicies": [] - }, - "LoadBalancerName": "example-app", - "CreatedTime": "2014-12-15T06:00:37.640000+00:00", - "AvailabilityZones": [ - "us-west-2c", - "us-west-2b", - "us-west-2a" - ], - "Scheme": "internet-facing", - "SourceSecurityGroup": { - "OwnerAlias": "234567890123", - "GroupName": "DevTest-Example-App-Resources-elbSecurityGroup-17ZVI99H5520V" - } - }, - { - "Subnets": [ - "subnet-4aee762f", - "subnet-d99628ae" - ], - "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", - "CanonicalHostedZoneName": "hello-world-264014924.us-west-2.elb.amazonaws.com", - "ListenerDescriptions": [ - { - "Listener": { - "InstancePort": 80, - "LoadBalancerPort": 80, - "Protocol": "HTTP", - "InstanceProtocol": "HTTP" - }, - "PolicyNames": [] - } - ], - "HealthCheck": { - "HealthyThreshold": 3, - "Interval": 30, - "Target": "HTTP:80/", - "Timeout": 5, - "UnhealthyThreshold": 5 - }, - "VPCId": "vpc-06901063", - "BackendServerDescriptions": [], - "Instances": [], - "DNSName": "hello-world-264014924.us-west-2.elb.amazonaws.com", - "SecurityGroups": [ - "sg-8ed3c2eb" - ], - "Policies": { - "LBCookieStickinessPolicies": [], - "AppCookieStickinessPolicies": [], - "OtherPolicies": [] - }, - "LoadBalancerName": "hello-world", - "CreatedTime": "2015-05-06T18:07:54.820000+00:00", - "AvailabilityZones": [ - "us-west-2b", - "us-west-2a" - ], - "Scheme": "internet-facing", - "SourceSecurityGroup": { - "OwnerAlias": "234567890123", - "GroupName": "cyan1-delta-hello-world-elbSecurityGroup-V9TCAF6F13B8" - } - }, - { - "Subnets": [ - "subnet-41e42924", - "subnet-c38361b4", - "subnet-f61416b0" - ], - "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", - "CanonicalHostedZoneName": "hosh-test-elb-1552176118.us-west-2.elb.amazonaws.com", - "ListenerDescriptions": [ - { - "Listener": { - "InstancePort": 80, - "LoadBalancerPort": 80, - "Protocol": "HTTP", - "InstanceProtocol": "HTTP" - }, - "PolicyNames": [] - } - ], - "HealthCheck": { - "HealthyThreshold": 10, - "Interval": 30, - "Target": "HTTP:80/index.html", - "Timeout": 5, - "UnhealthyThreshold": 2 - }, - "VPCId": "vpc-2b86744e", - "BackendServerDescriptions": [], - "Instances": [], - "DNSName": "hosh-test-elb-1552176118.us-west-2.elb.amazonaws.com", - "SecurityGroups": [ - "sg-f153e494" - ], - "Policies": { - "LBCookieStickinessPolicies": [], - "AppCookieStickinessPolicies": [], - "OtherPolicies": [] - }, - "LoadBalancerName": "hosh-test-elb", - "CreatedTime": "2015-07-01T06:44:36.490000+00:00", - "AvailabilityZones": [ - "us-west-2a", - "us-west-2b", - "us-west-2c" - ], - "Scheme": "internet-facing", - "SourceSecurityGroup": { - "OwnerAlias": "234567890123", - "GroupName": "default" - } - }, - { - "Subnets": [ - "subnet-41e42924", - "subnet-c38361b4", - "subnet-f61416b0" - ], - "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", - "CanonicalHostedZoneName": "hosh-test-elb-2-801644917.us-west-2.elb.amazonaws.com", - "ListenerDescriptions": [ - { - "Listener": { - "InstancePort": 80, - "LoadBalancerPort": 80, - "Protocol": "HTTP", - "InstanceProtocol": "HTTP" - }, - "PolicyNames": [] - } - ], - "HealthCheck": { - "HealthyThreshold": 10, - "Interval": 30, - "Target": "HTTP:80/index.html", - "Timeout": 5, - "UnhealthyThreshold": 2 - }, - "VPCId": "vpc-2b86744e", - "BackendServerDescriptions": [], - "Instances": [], - "DNSName": "hosh-test-elb-2-801644917.us-west-2.elb.amazonaws.com", - "SecurityGroups": [ - "sg-f153e494" - ], - "Policies": { - "LBCookieStickinessPolicies": [], - "AppCookieStickinessPolicies": [], - "OtherPolicies": [] - }, - "LoadBalancerName": "hosh-test-elb-2", - "CreatedTime": "2015-07-20T03:22:40.160000+00:00", - "AvailabilityZones": [ - "us-west-2a", - "us-west-2b", - "us-west-2c" - ], - "Scheme": "internet-facing", - "SourceSecurityGroup": { - "OwnerAlias": "234567890123", - "GroupName": "default" - } - }, - { - "Subnets": [ - "subnet-7456e511", - "subnet-9112c3e6", - "subnet-c7cf399e" - ], - "HealthCheck": { - "HealthyThreshold": 3, - "Interval": 30, - "Target": "HTTP:80/", - "Timeout": 5, - "UnhealthyThreshold": 5 - }, - "VPCId": "vpc-7f5e861a", - "BackendServerDescriptions": [], - "Instances": [], - "DNSName": "foo-11111111.us-west-2.elb.amazonaws.com", - "SecurityGroups": [ - "sg-1ca27578" - ], - "Policies": { - "LBCookieStickinessPolicies": [], - "AppCookieStickinessPolicies": [], - "OtherPolicies": [] - }, - "LoadBalancerName": "u4u-dev", - "CreatedTime": "2015-07-29T01:03:58.590000+00:00", - "AvailabilityZones": [ - "us-west-2a", - "us-west-2b", - "us-west-2c" - ], - "Scheme": "internet-facing", - "SourceSecurityGroup": { - "OwnerAlias": "234567890123", - "GroupName": "DevTest-elbSecurityGroup-1MCBCYAJ5LAPS" - } - } -] diff --git a/tests/unit/data/iam/123456789012/list_groups.json b/tests/unit/data/iam/123456789012/list_groups.json deleted file mode 100644 index 0fd8a85..0000000 --- a/tests/unit/data/iam/123456789012/list_groups.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "Path": "/", - "CreateDate": "2015-05-01T04:55:13+00:00", - "GroupId": "AGPAJPEN42SMQRU5UWRGS", - "Arn": "arn:aws:iam::123456789012:group/Administrators", - "GroupName": "Administrators" - }, - { - "Path": "/", - "CreateDate": "2015-05-05T21:44:58+00:00", - "GroupId": "AGPAJG5SZVVECMBTC5ESY", - "Arn": "arn:aws:iam::123456789012:group/foobar", - "GroupName": "foobar" - } -] diff --git a/tests/unit/data/iam/123456789012/list_users.json b/tests/unit/data/iam/123456789012/list_users.json deleted file mode 100644 index 46aaec7..0000000 --- a/tests/unit/data/iam/123456789012/list_users.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "UserName": "foo", - "PasswordLastUsed": "2015-08-21T14:40:53+00:00", - "CreateDate": "2015-06-11T22:37:14+00:00", - "UserId": "AIDAI3QVEB6MR6JTWJUDU", - "Path": "/", - "Arn": "arn:aws:iam::123456789012:user/foo" - }, - { - "UserName": "bar", - "PasswordLastUsed": "2015-06-30T07:38:19+00:00", - "CreateDate": "2015-05-26T20:42:10+00:00", - "UserId": "AIDAJV2QK2FRI4DIGSU54", - "Path": "/", - "Arn": "arn:aws:iam::123456789012:user/bar" - }, - { - "UserName": "fie", - "PasswordLastUsed": "2015-08-26T16:37:49+00:00", - "CreateDate": "2015-05-01T04:54:49+00:00", - "UserId": "AIDAJYEJ5UAQGW57T32BG", - "Path": "/", - "Arn": "arn:aws:iam::123456789012:user/fie" - } -] diff --git a/tests/unit/data/iam/234567890123/list_users.json b/tests/unit/data/iam/234567890123/list_users.json deleted file mode 100644 index 46aaec7..0000000 --- a/tests/unit/data/iam/234567890123/list_users.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "UserName": "foo", - "PasswordLastUsed": "2015-08-21T14:40:53+00:00", - "CreateDate": "2015-06-11T22:37:14+00:00", - "UserId": "AIDAI3QVEB6MR6JTWJUDU", - "Path": "/", - "Arn": "arn:aws:iam::123456789012:user/foo" - }, - { - "UserName": "bar", - "PasswordLastUsed": "2015-06-30T07:38:19+00:00", - "CreateDate": "2015-05-26T20:42:10+00:00", - "UserId": "AIDAJV2QK2FRI4DIGSU54", - "Path": "/", - "Arn": "arn:aws:iam::123456789012:user/bar" - }, - { - "UserName": "fie", - "PasswordLastUsed": "2015-08-26T16:37:49+00:00", - "CreateDate": "2015-05-01T04:54:49+00:00", - "UserId": "AIDAJYEJ5UAQGW57T32BG", - "Path": "/", - "Arn": "arn:aws:iam::123456789012:user/fie" - } -] diff --git a/tests/unit/data/route53/123456789012/list_health_checks.json b/tests/unit/data/route53/123456789012/list_health_checks.json deleted file mode 100644 index 0637a08..0000000 --- a/tests/unit/data/route53/123456789012/list_health_checks.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/tests/unit/data/route53/123456789012/list_hosted_zones.json b/tests/unit/data/route53/123456789012/list_hosted_zones.json deleted file mode 100644 index 58f4621..0000000 --- a/tests/unit/data/route53/123456789012/list_hosted_zones.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "ResourceRecordSetCount": 10, - "CallerReference": "3A0E1ACB-DA7A-5893-B820-4F9DED5EEBAB", - "Config": { - "Comment": "FooBar", - "PrivateZone": false - }, - "Id": "/hostedzone/FFFF865FFFF3", - "Name": "foobar.com." - }, - { - "ResourceRecordSetCount": 4, - "CallerReference": "Production-VPC-hostedZone", - "Config": { - "Comment": "Production VPC internal DNS", - "PrivateZone": true - }, - "Id": "/hostedzone/FFFFFFOF0235F", - "Name": "prod.foobar.com." - } -] diff --git a/tests/unit/data/s3/us-east-1/234567890123/list_buckets.json b/tests/unit/data/s3/us-east-1/234567890123/list_buckets.json deleted file mode 100644 index b8e1864..0000000 --- a/tests/unit/data/s3/us-east-1/234567890123/list_buckets.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "CreationDate": "2015-08-17T22:25:17+00:00", - "Name": "foo" - }, - { - "CreationDate": "2015-05-01T05:26:09+00:00", - "Name": "bar" - }, - { - "CreationDate": "2015-05-12T20:05:17+00:00", - "Name": "fie" - }, - { - "CreationDate": "2015-05-06T18:53:26+00:00", - "Name": "baz" - } -] diff --git a/tests/unit/data/s3/us-east-1/234567890123/list_objects_Bucket_bar.json b/tests/unit/data/s3/us-east-1/234567890123/list_objects_Bucket_bar.json deleted file mode 100644 index e0f2253..0000000 --- a/tests/unit/data/s3/us-east-1/234567890123/list_objects_Bucket_bar.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "CommonPrefixes": [], - "Contents": [ - { - "LastModified": "2011-02-18T03:13:33+00:00", - "ETag": "\"bed1ca48f81f1c682bdece790c9d3400\"", - "StorageClass": "STANDARD", - "Key": "foobar", - "Owner": { - "DisplayName": "thedude", - "ID": "41e9227ae8ec27bb96ae1837247d02b2497bdf17ca0b7fedc0987e229c10baef" - }, - "Size": 205 - }, - { - "LastModified": "2011-02-18T03:13:34+00:00", - "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", - "StorageClass": "STANDARD", - "Key": "fiebaz", - "Owner": { - "DisplayName": "thedude", - "ID": "41e9227ae8ec27bb96ae1837247d02b2497bdf17ca0b7fedc0987e229c10baef" - }, - "Size": 0 - }, - { - "LastModified": "2011-02-18T03:13:34+00:00", - "ETag": "\"6cabcfa2525c71451ce351ea286b71db\"", - "StorageClass": "STANDARD", - "Key": "lisplisplisp", - "Owner": { - "DisplayName": "thedude", - "ID": "41e9227ae8ec27bb96ae1837247d02b2497bdf17ca0b7fedc0987e229c10baef" - }, - "Size": 2853 - }, - { - "LastModified": "2011-02-18T03:13:34+00:00", - "ETag": "\"e492aaff0fb987bf32a3e5e6854601b6\"", - "StorageClass": "STANDARD", - "Key": "thebigleibowski.mov", - "Owner": { - "DisplayName": "thedude", - "ID": "41e9227ae8ec27bb96ae1837247d02b2497bdf17ca0b7fedc0987e229c10baef" - }, - "Size": 2120 - } - ] -} diff --git a/tests/unit/data/sqs/us-east-1/123456789012/list_queues.json b/tests/unit/data/sqs/us-east-1/123456789012/list_queues.json deleted file mode 100644 index ec747fa..0000000 --- a/tests/unit/data/sqs/us-east-1/123456789012/list_queues.json +++ /dev/null @@ -1 +0,0 @@ -null \ No newline at end of file diff --git a/tests/unit/mock_awsclient.py b/tests/unit/mock_awsclient.py deleted file mode 100644 index 30cac40..0000000 --- a/tests/unit/mock_awsclient.py +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2015 Mitch Garnaat -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. - -import os -import json -import logging - -LOG = logging.getLogger(__name__) - - -class MockAWSClient(object): - - def __init__(self, service_name, region_name, account_id, aws_creds=None): - self.service_name = service_name - self.region_name = region_name - self.account_id = account_id - self.aws_creds = aws_creds - - def _get_stored_response(self, op_name, kwargs): - LOG.debug('op_name={}, kwargs={}'.format(op_name, kwargs)) - data = {} - path = os.path.join(os.path.dirname(__file__), 'data', - self.service_name) - if self.service_name not in ('iam', 'route53'): - path = os.path.join(path, self.region_name) - path = os.path.join(path, self.account_id) - filename = op_name - if kwargs: - for k, v in kwargs.items(): - if k != 'query': - filename += '_{}_{}'.format(k, v) - filename += '.json' - path = os.path.join(path, filename) - try: - with open(path) as fp: - data = json.load(fp) - except IOError: - LOG.debug('path: {} not found'.format(path)) - return data - - def call(self, op_name, **kwargs): - return self._get_stored_response(op_name, kwargs) - - -def get_awsclient(service_name, region_name, account_id, aws_creds=None): - return MockAWSClient(service_name, region_name, account_id, - aws_creds=aws_creds) diff --git a/tests/unit/responses/buckets/s3.GetBucketLocation_1.json b/tests/unit/responses/buckets/s3.GetBucketLocation_1.json new file mode 100644 index 0000000..762309b --- /dev/null +++ b/tests/unit/responses/buckets/s3.GetBucketLocation_1.json @@ -0,0 +1,10 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "HostId": "7rVlvvCmaat4i1Km3mIaMlpPTxDL6k1LcYObw8uF3mvN0Rm0JDI3sXo4WpIsSccOMuZdh+jvwng=", + "RequestId": "584D07E69B350436" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/buckets/s3.GetBucketLocation_2.json b/tests/unit/responses/buckets/s3.GetBucketLocation_2.json new file mode 100644 index 0000000..114d02f --- /dev/null +++ b/tests/unit/responses/buckets/s3.GetBucketLocation_2.json @@ -0,0 +1,10 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "HostId": "VvBrGRsNGK+QlCe+QTw0guPUxdnctZQp/nqPV4FcOozcEV07N5bOP5Kwt0nAaialBoTpl3uboXY=", + "RequestId": "DD19C6AC3683ED86" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/buckets/s3.GetBucketLocation_3.json b/tests/unit/responses/buckets/s3.GetBucketLocation_3.json new file mode 100644 index 0000000..bd61c9c --- /dev/null +++ b/tests/unit/responses/buckets/s3.GetBucketLocation_3.json @@ -0,0 +1,10 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "HostId": "djLkAppJqT8HRrtg7UBSLWbK+obvUKwevaK3hFyygiVM4nUCxBVWbWxbi9YdcPFZsyOoXl+r5ug=", + "RequestId": "9498DB828AA519CE" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/buckets/s3.GetBucketLocation_4.json b/tests/unit/responses/buckets/s3.GetBucketLocation_4.json new file mode 100644 index 0000000..16a00e4 --- /dev/null +++ b/tests/unit/responses/buckets/s3.GetBucketLocation_4.json @@ -0,0 +1,10 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "HostId": "ceaP7O7T6Ge75ui6ZuZbho+LxkARPKjF4xNcwgSNnz+PqnaKahy/pyLA8Fc9Rgb0YiKzlL8g6SQ=", + "RequestId": "8488AFFCFB74117B" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/buckets/s3.GetBucketLocation_5.json b/tests/unit/responses/buckets/s3.GetBucketLocation_5.json new file mode 100644 index 0000000..3792ca1 --- /dev/null +++ b/tests/unit/responses/buckets/s3.GetBucketLocation_5.json @@ -0,0 +1,10 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "HostId": "GsDC+CUZnvRiCr69HYXxtHeCEw7m9DCnGMJz2l1a1tM4jWFjgGyTEggMRlxNS1I3cPa6PCcRJzs=", + "RequestId": "AADC3ABE02345F09" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/buckets/s3.ListBuckets_1.json b/tests/unit/responses/buckets/s3.ListBuckets_1.json new file mode 100644 index 0000000..37f7da7 --- /dev/null +++ b/tests/unit/responses/buckets/s3.ListBuckets_1.json @@ -0,0 +1,81 @@ +{ + "status_code": 200, + "data": { + "Owner": { + "DisplayName": "foobar", + "ID": "12345678901234567890" + }, + "Buckets": [ + { + "CreationDate": { + "hour": 5, + "__class__": "datetime", + "month": 10, + "second": 5, + "microsecond": 0, + "year": 2015, + "day": 3, + "minute": 15 + }, + "Name": "foobar.1" + }, + { + "CreationDate": { + "hour": 20, + "__class__": "datetime", + "month": 11, + "second": 57, + "microsecond": 0, + "year": 2015, + "day": 25, + "minute": 0 + }, + "Name": "foobar.2" + }, + { + "CreationDate": { + "hour": 22, + "__class__": "datetime", + "month": 8, + "second": 17, + "microsecond": 0, + "year": 2015, + "day": 17, + "minute": 25 + }, + "Name": "foobar.3" + }, + { + "CreationDate": { + "hour": 5, + "__class__": "datetime", + "month": 5, + "second": 9, + "microsecond": 0, + "year": 2015, + "day": 1, + "minute": 26 + }, + "Name": "foobar.4" + }, + { + "CreationDate": { + "hour": 20, + "__class__": "datetime", + "month": 5, + "second": 17, + "microsecond": 0, + "year": 2015, + "day": 12, + "minute": 5 + }, + "Name": "foobar.5" + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "HostId": "G4fIQCAT7FKq6O37x/RN6KUJY6sCKv6qr3/2mPDFceHWwLMLI8xAICRB7NhZRrEd9wOLH1dLbeI=", + "RequestId": "ED1C96C5020AD68D" + } + } +} diff --git a/tests/unit/responses/elbs/elasticloadbalancing.DescribeLoadBalancers_1.json b/tests/unit/responses/elbs/elasticloadbalancing.DescribeLoadBalancers_1.json new file mode 100644 index 0000000..5586026 --- /dev/null +++ b/tests/unit/responses/elbs/elasticloadbalancing.DescribeLoadBalancers_1.json @@ -0,0 +1,373 @@ +{ + "status_code": 200, + "data": { + "LoadBalancerDescriptions": [ + { + "Subnets": [ + "subnet-7456e511", + "subnet-9112c3e6", + "subnet-c7cf399e" + ], + "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", + "CanonicalHostedZoneName": "example-app-2080941558.us-west-2.elb.amazonaws.com", + "ListenerDescriptions": [ + { + "Listener": { + "InstancePort": 80, + "LoadBalancerPort": 80, + "Protocol": "HTTP", + "InstanceProtocol": "HTTP" + }, + "PolicyNames": [] + } + ], + "HealthCheck": { + "HealthyThreshold": 3, + "Interval": 30, + "Target": "HTTP:80/", + "Timeout": 5, + "UnhealthyThreshold": 5 + }, + "VPCId": "vpc-7f5e861a", + "BackendServerDescriptions": [], + "Instances": [], + "DNSName": "example-app-2080941558.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-3e572c5b" + ], + "Policies": { + "LBCookieStickinessPolicies": [], + "AppCookieStickinessPolicies": [], + "OtherPolicies": [] + }, + "LoadBalancerName": "example-app", + "CreatedTime": { + "hour": 6, + "__class__": "datetime", + "month": 12, + "second": 37, + "microsecond": 640000, + "year": 2014, + "day": 15, + "minute": 0 + }, + "AvailabilityZones": [ + "us-west-2c", + "us-west-2b", + "us-west-2a" + ], + "Scheme": "internet-facing", + "SourceSecurityGroup": { + "OwnerAlias": "123456789012", + "GroupName": "DevTest-Example-App-Resources-elbSecurityGroup-17ZVI99H5520V" + } + }, + { + "Subnets": [ + "subnet-4aee762f", + "subnet-d99628ae" + ], + "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", + "CanonicalHostedZoneName": "hello-world-264014924.us-west-2.elb.amazonaws.com", + "ListenerDescriptions": [ + { + "Listener": { + "InstancePort": 80, + "LoadBalancerPort": 80, + "Protocol": "HTTP", + "InstanceProtocol": "HTTP" + }, + "PolicyNames": [] + } + ], + "HealthCheck": { + "HealthyThreshold": 3, + "Interval": 30, + "Target": "HTTP:80/", + "Timeout": 5, + "UnhealthyThreshold": 5 + }, + "VPCId": "vpc-06901063", + "BackendServerDescriptions": [], + "Instances": [], + "DNSName": "hello-world-264014924.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-8ed3c2eb" + ], + "Policies": { + "LBCookieStickinessPolicies": [], + "AppCookieStickinessPolicies": [], + "OtherPolicies": [] + }, + "LoadBalancerName": "hello-world", + "CreatedTime": { + "hour": 18, + "__class__": "datetime", + "month": 5, + "second": 54, + "microsecond": 820000, + "year": 2015, + "day": 6, + "minute": 7 + }, + "AvailabilityZones": [ + "us-west-2b", + "us-west-2a" + ], + "Scheme": "internet-facing", + "SourceSecurityGroup": { + "OwnerAlias": "123456789012", + "GroupName": "cyan1-delta-hello-world-elbSecurityGroup-V9TCAF6F13B8" + } + }, + { + "Subnets": [ + "subnet-7456e511", + "subnet-9112c3e6", + "subnet-c7cf399e" + ], + "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", + "CanonicalHostedZoneName": "u4u-pas256-dev-1102450121.us-west-2.elb.amazonaws.com", + "ListenerDescriptions": [ + { + "Listener": { + "InstancePort": 80, + "LoadBalancerPort": 80, + "Protocol": "HTTP", + "InstanceProtocol": "HTTP" + }, + "PolicyNames": [] + } + ], + "HealthCheck": { + "HealthyThreshold": 3, + "Interval": 30, + "Target": "HTTP:80/", + "Timeout": 5, + "UnhealthyThreshold": 5 + }, + "VPCId": "vpc-7f5e861a", + "BackendServerDescriptions": [], + "Instances": [], + "DNSName": "u4u-pas256-dev-1102450121.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-1ca27578" + ], + "Policies": { + "LBCookieStickinessPolicies": [], + "AppCookieStickinessPolicies": [], + "OtherPolicies": [] + }, + "LoadBalancerName": "u4u-pas256-dev", + "CreatedTime": { + "hour": 1, + "__class__": "datetime", + "month": 7, + "second": 58, + "microsecond": 590000, + "year": 2015, + "day": 29, + "minute": 3 + }, + "AvailabilityZones": [ + "us-west-2a", + "us-west-2b", + "us-west-2c" + ], + "Scheme": "internet-facing", + "SourceSecurityGroup": { + "OwnerAlias": "123456789012", + "GroupName": "DevTest-u4u-pas256-dev-Resources-elbSecurityGroup-1MCBCYAJ5LAPS" + } + }, + { + "Subnets": [ + "subnet-7456e511", + "subnet-9112c3e6", + "subnet-c7cf399e" + ], + "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", + "CanonicalHostedZoneName": "invite-bot-997614207.us-west-2.elb.amazonaws.com", + "ListenerDescriptions": [ + { + "Listener": { + "InstancePort": 8033, + "LoadBalancerPort": 8033, + "Protocol": "HTTP", + "InstanceProtocol": "HTTP" + }, + "PolicyNames": [] + } + ], + "HealthCheck": { + "HealthyThreshold": 3, + "Interval": 60, + "Target": "HTTP:8033/", + "Timeout": 5, + "UnhealthyThreshold": 5 + }, + "VPCId": "vpc-7f5e861a", + "BackendServerDescriptions": [], + "Instances": [], + "DNSName": "invite-bot-997614207.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-500e9e34" + ], + "Policies": { + "LBCookieStickinessPolicies": [], + "AppCookieStickinessPolicies": [], + "OtherPolicies": [] + }, + "LoadBalancerName": "invite-bot", + "CreatedTime": { + "hour": 23, + "__class__": "datetime", + "month": 9, + "second": 40, + "microsecond": 880000, + "year": 2015, + "day": 28, + "minute": 39 + }, + "AvailabilityZones": [ + "us-west-2a", + "us-west-2b", + "us-west-2c" + ], + "Scheme": "internet-facing", + "SourceSecurityGroup": { + "OwnerAlias": "123456789012", + "GroupName": "DevTest-InviteBot-Resources-elbSecurityGroup-19C16N589LQWM" + } + }, + { + "Subnets": [ + "subnet-7456e511", + "subnet-9112c3e6", + "subnet-c7cf399e" + ], + "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", + "CanonicalHostedZoneName": "mercator-bot-2044968535.us-west-2.elb.amazonaws.com", + "ListenerDescriptions": [ + { + "Listener": { + "InstancePort": 8033, + "LoadBalancerPort": 8033, + "Protocol": "HTTP", + "InstanceProtocol": "HTTP" + }, + "PolicyNames": [] + } + ], + "HealthCheck": { + "HealthyThreshold": 3, + "Interval": 60, + "Target": "HTTP:8033/", + "Timeout": 5, + "UnhealthyThreshold": 5 + }, + "VPCId": "vpc-7f5e861a", + "BackendServerDescriptions": [], + "Instances": [], + "DNSName": "mercator-bot-2044968535.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-6242da06" + ], + "Policies": { + "LBCookieStickinessPolicies": [], + "AppCookieStickinessPolicies": [], + "OtherPolicies": [] + }, + "LoadBalancerName": "mercator-bot", + "CreatedTime": { + "hour": 22, + "__class__": "datetime", + "month": 10, + "second": 40, + "microsecond": 130000, + "year": 2015, + "day": 5, + "minute": 27 + }, + "AvailabilityZones": [ + "us-west-2a", + "us-west-2b", + "us-west-2c" + ], + "Scheme": "internet-facing", + "SourceSecurityGroup": { + "OwnerAlias": "123456789012", + "GroupName": "DevTest-MercatorBot-Resources-elbSecurityGroup-9UTR15I1O9FR" + } + }, + { + "Subnets": [ + "subnet-7456e511", + "subnet-9112c3e6", + "subnet-c7cf399e" + ], + "CanonicalHostedZoneNameID": "Z33MTJ483KN6FU", + "CanonicalHostedZoneName": "mercator-survey-480833217.us-west-2.elb.amazonaws.com", + "ListenerDescriptions": [ + { + "Listener": { + "InstancePort": 8033, + "LoadBalancerPort": 8033, + "Protocol": "HTTP", + "InstanceProtocol": "HTTP" + }, + "PolicyNames": [] + } + ], + "HealthCheck": { + "HealthyThreshold": 3, + "Interval": 60, + "Target": "HTTP:8033/", + "Timeout": 5, + "UnhealthyThreshold": 5 + }, + "VPCId": "vpc-7f5e861a", + "BackendServerDescriptions": [], + "Instances": [ + { + "InstanceId": "i-100ec2c9" + } + ], + "DNSName": "mercator-survey-480833217.us-west-2.elb.amazonaws.com", + "SecurityGroups": [ + "sg-9c9deff8" + ], + "Policies": { + "LBCookieStickinessPolicies": [], + "AppCookieStickinessPolicies": [], + "OtherPolicies": [] + }, + "LoadBalancerName": "mercator-survey", + "CreatedTime": { + "hour": 17, + "__class__": "datetime", + "month": 10, + "second": 6, + "microsecond": 700000, + "year": 2015, + "day": 28, + "minute": 51 + }, + "AvailabilityZones": [ + "us-west-2a", + "us-west-2b", + "us-west-2c" + ], + "Scheme": "internet-facing", + "SourceSecurityGroup": { + "OwnerAlias": "123456789012", + "GroupName": "DevTest-MercatorSurvey-Resources-elbSecurityGroup-GNV5KXPYVV8M" + } + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "0a541d8b-ba21-11e5-ae99-05a2027fd021" + } + } +} diff --git a/tests/unit/responses/groups/iam.ListGroups_1.json b/tests/unit/responses/groups/iam.ListGroups_1.json new file mode 100644 index 0000000..be06d56 --- /dev/null +++ b/tests/unit/responses/groups/iam.ListGroups_1.json @@ -0,0 +1,60 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "7b30fc17-ba3c-11e5-84d2-1f83828f2439" + }, + "IsTruncated": false, + "Groups": [ + { + "Path": "/", + "CreateDate": { + "hour": 4, + "__class__": "datetime", + "month": 5, + "second": 13, + "microsecond": 0, + "year": 2015, + "day": 1, + "minute": 55 + }, + "GroupId": "AGPAJPEN42SMQRU5UWRGS", + "Arn": "arn:aws:iam::234567890123:group/Administrators", + "GroupName": "Administrators" + }, + { + "Path": "/", + "CreateDate": { + "hour": 21, + "__class__": "datetime", + "month": 5, + "second": 58, + "microsecond": 0, + "year": 2015, + "day": 5, + "minute": 44 + }, + "GroupId": "AGPAJG5SZVVECMBTC5ESY", + "Arn": "arn:aws:iam::234567890123:group/FooBarAdmin", + "GroupName": "FooBarAdmin" + }, + { + "Path": "/", + "CreateDate": { + "hour": 19, + "__class__": "datetime", + "month": 11, + "second": 11, + "microsecond": 0, + "year": 2015, + "day": 30, + "minute": 12 + }, + "GroupId": "AGPAJR2DDEWJWVUUZ7IRQ", + "Arn": "arn:aws:iam::234567890123:group/FieBaz", + "GroupName": "FieBaz" + } + ] + } +} diff --git a/tests/unit/responses/instances_1/ec2.DescribeInstances_1.json b/tests/unit/responses/instances_1/ec2.DescribeInstances_1.json new file mode 100644 index 0000000..26c3958 --- /dev/null +++ b/tests/unit/responses/instances_1/ec2.DescribeInstances_1.json @@ -0,0 +1,311 @@ +{ + "status_code": 200, + "data": { + "Reservations": [ + { + "OwnerId": "123456789012", + "ReservationId": "r-86e33840", + "Groups": [], + "RequesterId": "226008221399", + "Instances": [ + { + "Monitoring": { + "State": "enabled" + }, + "PublicDnsName": "ec2-00-000-00-000.us-west-2.compute.amazonaws.com", + "State": { + "Code": 272, + "Name": "running" + }, + "EbsOptimized": false, + "LaunchTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 7, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + }, + "PublicIpAddress": "1.2.3.4", + "PrivateIpAddress": "10.0.11.168", + "ProductCodes": [], + "VpcId": "vpc-7f5e861a", + "StateTransitionReason": "", + "InstanceId": "i-db530902", + "ImageId": "ami-d74357b6", + "PrivateDnsName": "ip-10-0-11-168.us-west-2.compute.internal", + "KeyName": "admin", + "SecurityGroups": [ + { + "GroupName": "FooBar", + "GroupId": "sg-39efad5d" + } + ], + "ClientToken": "98c72e0f-d01b-4a32-b140-e0be2deb33d7_subnet-9312c3e4_1", + "SubnetId": "subnet-9312c3e4", + "InstanceType": "t2.small", + "NetworkInterfaces": [ + { + "Status": "in-use", + "MacAddress": "06:ef:48:f7:c4:ab", + "SourceDestCheck": true, + "VpcId": "vpc-7f5e861a", + "Description": "", + "Association": { + "PublicIp": "1.2.3.4", + "PublicDnsName": "ec2-00-000-00-000.us-west-2.compute.amazonaws.com", + "IpOwnerId": "amazon" + }, + "NetworkInterfaceId": "eni-f58a5ebe", + "PrivateIpAddresses": [ + { + "PrivateDnsName": "ip-10-0-11-168.us-west-2.compute.internal", + "Association": { + "PublicIp": "1.2.3.4", + "PublicDnsName": "ec2-00-000-00-000.us-west-2.compute.amazonaws.com", + "IpOwnerId": "amazon" + }, + "Primary": true, + "PrivateIpAddress": "10.0.11.168" + } + ], + "PrivateDnsName": "ip-10-0-11-168.us-west-2.compute.internal", + "Attachment": { + "Status": "attached", + "DeviceIndex": 0, + "DeleteOnTermination": true, + "AttachmentId": "eni-attach-e3eb1cef", + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 7, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + } + }, + "Groups": [ + { + "GroupName": "FooBar", + "GroupId": "sg-39efad5d" + } + ], + "SubnetId": "subnet-9312c3e4", + "OwnerId": "123456789012", + "PrivateIpAddress": "10.0.11.168" + } + ], + "SourceDestCheck": true, + "Placement": { + "Tenancy": "default", + "GroupName": "", + "AvailabilityZone": "us-west-2a" + }, + "Hypervisor": "xen", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/xvda", + "Ebs": { + "Status": "attached", + "DeleteOnTermination": true, + "VolumeId": "vol-aac7336a", + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 10, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + } + } + } + ], + "Architecture": "x86_64", + "RootDeviceType": "ebs", + "IamInstanceProfile": { + "Id": "AIPAIIC7YPOPHECAPLMVS", + "Arn": "arn:aws:iam::123456789012:instance-profile/FooBar" + }, + "RootDeviceName": "/dev/xvda", + "VirtualizationType": "hvm", + "Tags": [ + { + "Value": "FooBar", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "ecsAsg", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest", + "Key": "Environment" + } + ], + "AmiLaunchIndex": 0 + } + ] + }, + { + "OwnerId": "123456789012", + "ReservationId": "r-d819a710", + "Groups": [], + "RequesterId": "226008221399", + "Instances": [ + { + "Monitoring": { + "State": "enabled" + }, + "PublicDnsName": "ec2-00-000-000-00.us-west-2.compute.amazonaws.com", + "State": { + "Code": 16, + "Name": "running" + }, + "EbsOptimized": false, + "LaunchTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 38, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 22 + }, + "PublicIpAddress": "2.3.3.4", + "PrivateIpAddress": "10.0.13.108", + "ProductCodes": [], + "VpcId": "vpc-7f5e861a", + "StateTransitionReason": "", + "InstanceId": "i-c81fb512", + "ImageId": "ami-d74357b6", + "PrivateDnsName": "ip-10-0-13-108.us-west-2.compute.internal", + "KeyName": "admin", + "SecurityGroups": [ + { + "GroupName": "FieBaz", + "GroupId": "sg-39efad5d" + } + ], + "ClientToken": "8845bb91-9625-4251-8fe4-31accf94448e_subnet-c5cf399c_1", + "SubnetId": "subnet-c5cf399c", + "InstanceType": "t2.small", + "NetworkInterfaces": [ + { + "Status": "in-use", + "MacAddress": "0a:08:0d:ee:3c:6d", + "SourceDestCheck": true, + "VpcId": "vpc-7f5e861a", + "Description": "", + "Association": { + "PublicIp": "2.3.3.4", + "PublicDnsName": "ec2-00-000-000-00.us-west-2.compute.amazonaws.com", + "IpOwnerId": "amazon" + }, + "NetworkInterfaceId": "eni-8447c5de", + "PrivateIpAddresses": [ + { + "PrivateDnsName": "ip-10-0-13-108.us-west-2.compute.internal", + "Association": { + "PublicIp": "54.201.130.21", + "PublicDnsName": "ec2-00-000-00-00.us-west-2.compute.amazonaws.com", + "IpOwnerId": "amazon" + }, + "Primary": true, + "PrivateIpAddress": "10.0.13.108" + } + ], + "PrivateDnsName": "ip-10-0-13-108.us-west-2.compute.internal", + "Attachment": { + "Status": "attached", + "DeviceIndex": 0, + "DeleteOnTermination": true, + "AttachmentId": "eni-attach-fa9614f5", + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 38, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 22 + } + }, + "Groups": [ + { + "GroupName": "FieBaz", + "GroupId": "sg-39efad5d" + } + ], + "SubnetId": "subnet-c5cf399c", + "OwnerId": "123456789012", + "PrivateIpAddress": "10.0.13.108" + } + ], + "SourceDestCheck": true, + "Placement": { + "Tenancy": "default", + "GroupName": "", + "AvailabilityZone": "us-west-2c" + }, + "Hypervisor": "xen", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/xvda", + "Ebs": { + "Status": "attached", + "DeleteOnTermination": true, + "VolumeId": "vol-a3510945", + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 41, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 22 + } + } + } + ], + "Architecture": "x86_64", + "RootDeviceType": "ebs", + "IamInstanceProfile": { + "Id": "AIPAIIC7YPOPHECAPLMVS", + "Arn": "arn:aws:iam::123456789012:instance-profile/FieBaz" + }, + "RootDeviceName": "/dev/xvda", + "VirtualizationType": "hvm", + "Tags": [ + { + "Value": "DevTest", + "Key": "Environment" + }, + { + "Value": "ecsAsg", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest ECS Instance", + "Key": "Name" + } + ], + "AmiLaunchIndex": 0 + } + ] + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "1eb4b5dc-d4de-4f15-a3ca-04b99bae3ec1" + } + } +} diff --git a/tests/unit/responses/instances_2/ec2.DescribeInstances_1.json b/tests/unit/responses/instances_2/ec2.DescribeInstances_1.json new file mode 100644 index 0000000..47b4dc6 --- /dev/null +++ b/tests/unit/responses/instances_2/ec2.DescribeInstances_1.json @@ -0,0 +1,161 @@ +{ + "status_code": 200, + "data": { + "Reservations": [ + { + "OwnerId": "123456789012", + "ReservationId": "r-86e33840", + "Groups": [], + "RequesterId": "226008221399", + "Instances": [ + { + "Monitoring": { + "State": "enabled" + }, + "PublicDnsName": "ec2-00-000-00-000.us-west-2.compute.amazonaws.com", + "State": { + "Code": 272, + "Name": "running" + }, + "EbsOptimized": false, + "LaunchTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 7, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + }, + "PublicIpAddress": "1.2.3.4", + "PrivateIpAddress": "10.0.11.168", + "ProductCodes": [], + "VpcId": "vpc-7f5e861a", + "StateTransitionReason": "", + "InstanceId": "i-db530902", + "ImageId": "ami-d74357b6", + "PrivateDnsName": "ip-10-0-11-168.us-west-2.compute.internal", + "KeyName": "admin", + "SecurityGroups": [ + { + "GroupName": "FooBar", + "GroupId": "sg-39efad5d" + } + ], + "ClientToken": "98c72e0f-d01b-4a32-b140-e0be2deb33d7_subnet-9312c3e4_1", + "SubnetId": "subnet-9312c3e4", + "InstanceType": "t2.small", + "NetworkInterfaces": [ + { + "Status": "in-use", + "MacAddress": "06:ef:48:f7:c4:ab", + "SourceDestCheck": true, + "VpcId": "vpc-7f5e861a", + "Description": "", + "Association": { + "PublicIp": "1.2.3.4", + "PublicDnsName": "ec2-00-000-00-000.us-west-2.compute.amazonaws.com", + "IpOwnerId": "amazon" + }, + "NetworkInterfaceId": "eni-f58a5ebe", + "PrivateIpAddresses": [ + { + "PrivateDnsName": "ip-10-0-11-168.us-west-2.compute.internal", + "Association": { + "PublicIp": "1.2.3.4", + "PublicDnsName": "ec2-00-000-00-000.us-west-2.compute.amazonaws.com", + "IpOwnerId": "amazon" + }, + "Primary": true, + "PrivateIpAddress": "10.0.11.168" + } + ], + "PrivateDnsName": "ip-10-0-11-168.us-west-2.compute.internal", + "Attachment": { + "Status": "attached", + "DeviceIndex": 0, + "DeleteOnTermination": true, + "AttachmentId": "eni-attach-e3eb1cef", + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 7, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + } + }, + "Groups": [ + { + "GroupName": "FooBar", + "GroupId": "sg-39efad5d" + } + ], + "SubnetId": "subnet-9312c3e4", + "OwnerId": "123456789012", + "PrivateIpAddress": "10.0.11.168" + } + ], + "SourceDestCheck": true, + "Placement": { + "Tenancy": "default", + "GroupName": "", + "AvailabilityZone": "us-west-2a" + }, + "Hypervisor": "xen", + "BlockDeviceMappings": [ + { + "DeviceName": "/dev/xvda", + "Ebs": { + "Status": "attached", + "DeleteOnTermination": true, + "VolumeId": "vol-aac7336a", + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 10, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + } + } + } + ], + "Architecture": "x86_64", + "RootDeviceType": "ebs", + "IamInstanceProfile": { + "Id": "AIPAIIC7YPOPHECAPLMVS", + "Arn": "arn:aws:iam::123456789012:instance-profile/FooBar" + }, + "RootDeviceName": "/dev/xvda", + "VirtualizationType": "hvm", + "Tags": [ + { + "Value": "FooBar", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "ecsAsg", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest", + "Key": "Environment" + } + ], + "AmiLaunchIndex": 0 + } + ] + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "bea049ac-1dfb-4362-b016-193e1525c8b8" + } + } +} diff --git a/tests/unit/responses/keypairs/ec2.DescribeKeyPairs_1.json b/tests/unit/responses/keypairs/ec2.DescribeKeyPairs_1.json new file mode 100644 index 0000000..13ec18f --- /dev/null +++ b/tests/unit/responses/keypairs/ec2.DescribeKeyPairs_1.json @@ -0,0 +1,19 @@ +{ + "status_code": 200, + "data": { + "KeyPairs": [ + { + "KeyName": "admin", + "KeyFingerprint": "85:83:08:25:fa:96:45:ea:c9:15:04:12:af:45:3f:c0:ef:e8:b8:ce" + }, + { + "KeyName": "FooBar", + "KeyFingerprint": "9b:02:68:c2:ff:32:38:1a:49:ec:c4:b5:b3:98:36:cf:cd:1f:73:cc" + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "2fb7f483-e17b-47d7-b0aa-0f2062770016" + } + } +} diff --git a/tests/unit/responses/networkacls/ec2.DescribeNetworkAcls_1.json b/tests/unit/responses/networkacls/ec2.DescribeNetworkAcls_1.json new file mode 100644 index 0000000..5c53b2e --- /dev/null +++ b/tests/unit/responses/networkacls/ec2.DescribeNetworkAcls_1.json @@ -0,0 +1,503 @@ +{ + "status_code": 200, + "data": { + "NetworkAcls": [ + { + "Associations": [], + "NetworkAclId": "acl-fe6bb39b", + "VpcId": "vpc-7f5e861a", + "Tags": [], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": true + }, + { + "Associations": [ + { + "SubnetId": "subnet-d99628ae", + "NetworkAclId": "acl-f2bc3097", + "NetworkAclAssociationId": "aclassoc-20fe3044" + }, + { + "SubnetId": "subnet-4aee762f", + "NetworkAclId": "acl-f2bc3097", + "NetworkAclAssociationId": "aclassoc-21fe3045" + } + ], + "NetworkAclId": "acl-f2bc3097", + "VpcId": "vpc-06901063", + "Tags": [ + { + "Value": "cyan1-delta-hello-world", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "CloudNative", + "Key": "Vendor" + }, + { + "Value": "publicEc2SubnetsAcl", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:860421987956:stack/cyan1-delta-hello-world/b2fd9dd0-f41a-11e4-8e28-5088484a585d", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "Public EC2 ACL", + "Key": "Name" + } + ], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": false + }, + { + "Associations": [ + { + "SubnetId": "subnet-c38361b4", + "NetworkAclId": "acl-64c23f01", + "NetworkAclAssociationId": "aclassoc-394af75c" + }, + { + "SubnetId": "subnet-41e42924", + "NetworkAclId": "acl-64c23f01", + "NetworkAclAssociationId": "aclassoc-384af75d" + }, + { + "SubnetId": "subnet-f61416b0", + "NetworkAclId": "acl-64c23f01", + "NetworkAclAssociationId": "aclassoc-3e4af75b" + } + ], + "NetworkAclId": "acl-64c23f01", + "VpcId": "vpc-2b86744e", + "Tags": [], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": true + }, + { + "Associations": [ + { + "SubnetId": "subnet-c5cf399c", + "NetworkAclId": "acl-b56bb3d0", + "NetworkAclAssociationId": "aclassoc-8fabfdea" + }, + { + "SubnetId": "subnet-9312c3e4", + "NetworkAclId": "acl-b56bb3d0", + "NetworkAclAssociationId": "aclassoc-81abfde4" + }, + { + "SubnetId": "subnet-6b56e50e", + "NetworkAclId": "acl-b56bb3d0", + "NetworkAclAssociationId": "aclassoc-82abfde7" + } + ], + "NetworkAclId": "acl-b56bb3d0", + "VpcId": "vpc-7f5e861a", + "Tags": [ + { + "Value": "Public EC2 ACL", + "Key": "Name" + }, + { + "Value": "DevTest", + "Key": "Environment" + }, + { + "Value": "publicEc2SubnetsAcl", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest-EC2-Subnets", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:860421987956:stack/DevTest-EC2-Subnets/c6abd8f0-8418-11e4-9e4e-5088487b0895", + "Key": "aws:cloudformation:stack-id" + } + ], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": false + }, + { + "Associations": [ + { + "SubnetId": "subnet-c2cf399b", + "NetworkAclId": "acl-aa6bb3cf", + "NetworkAclAssociationId": "aclassoc-80abfde5" + }, + { + "SubnetId": "subnet-9412c3e3", + "NetworkAclId": "acl-aa6bb3cf", + "NetworkAclAssociationId": "aclassoc-83abfde6" + }, + { + "SubnetId": "subnet-6a56e50f", + "NetworkAclId": "acl-aa6bb3cf", + "NetworkAclAssociationId": "aclassoc-8dabfde8" + } + ], + "NetworkAclId": "acl-aa6bb3cf", + "VpcId": "vpc-7f5e861a", + "Tags": [ + { + "Value": "DevTest", + "Key": "Environment" + }, + { + "Value": "privateEc2SubnetsAcl", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest-EC2-Subnets", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:860421987956:stack/DevTest-EC2-Subnets/c6abd8f0-8418-11e4-9e4e-5088487b0895", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "Private EC2 ACL", + "Key": "Name" + } + ], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": false + }, + { + "Associations": [ + { + "SubnetId": "subnet-7556e510", + "NetworkAclId": "acl-b66bb3d3", + "NetworkAclAssociationId": "aclassoc-94abfdf1" + }, + { + "SubnetId": "subnet-9212c3e5", + "NetworkAclId": "acl-b66bb3d3", + "NetworkAclAssociationId": "aclassoc-91abfdf4" + }, + { + "SubnetId": "subnet-c6cf399f", + "NetworkAclId": "acl-b66bb3d3", + "NetworkAclAssociationId": "aclassoc-97abfdf2" + } + ], + "NetworkAclId": "acl-b66bb3d3", + "VpcId": "vpc-7f5e861a", + "Tags": [ + { + "Value": "DevTest-ELB-Subnets", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "privateElbSubnetsAcl", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:860421987956:stack/DevTest-ELB-Subnets/cdd13940-8418-11e4-8b57-50e2414b0a7c", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "DevTest", + "Key": "Environment" + }, + { + "Value": "Private ELB ACL", + "Key": "Name" + } + ], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": false + }, + { + "Associations": [], + "NetworkAclId": "acl-e8bc308d", + "VpcId": "vpc-06901063", + "Tags": [], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": true + }, + { + "Associations": [ + { + "SubnetId": "subnet-7456e511", + "NetworkAclId": "acl-b16bb3d4", + "NetworkAclAssociationId": "aclassoc-8aabfdef" + }, + { + "SubnetId": "subnet-9112c3e6", + "NetworkAclId": "acl-b16bb3d4", + "NetworkAclAssociationId": "aclassoc-96abfdf3" + }, + { + "SubnetId": "subnet-c7cf399e", + "NetworkAclId": "acl-b16bb3d4", + "NetworkAclAssociationId": "aclassoc-95abfdf0" + } + ], + "NetworkAclId": "acl-b16bb3d4", + "VpcId": "vpc-7f5e861a", + "Tags": [ + { + "Value": "arn:aws:cloudformation:us-west-2:860421987956:stack/DevTest-ELB-Subnets/cdd13940-8418-11e4-8b57-50e2414b0a7c", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "publicElbSubnetsAcl", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest-ELB-Subnets", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "Public ELB ACL", + "Key": "Name" + }, + { + "Value": "DevTest", + "Key": "Environment" + } + ], + "Entries": [ + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": true, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": true, + "RuleAction": "deny" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 100, + "Protocol": "-1", + "Egress": false, + "RuleAction": "allow" + }, + { + "CidrBlock": "0.0.0.0/0", + "RuleNumber": 32767, + "Protocol": "-1", + "Egress": false, + "RuleAction": "deny" + } + ], + "IsDefault": false + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "3761ecff-aba1-445f-ba8b-4437339ad5c1" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/routetables/ec2.DescribeRouteTables_1.json b/tests/unit/responses/routetables/ec2.DescribeRouteTables_1.json new file mode 100644 index 0000000..2439399 --- /dev/null +++ b/tests/unit/responses/routetables/ec2.DescribeRouteTables_1.json @@ -0,0 +1,250 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "5367ca88-d88c-4ff0-b393-1f3399c00bd1" + }, + "RouteTables": [ + { + "Associations": [ + { + "RouteTableAssociationId": "rtbassoc-5896533d", + "Main": true, + "RouteTableId": "rtb-48936c2d" + } + ], + "RouteTableId": "rtb-48936c2d", + "VpcId": "vpc-2b86744e", + "PropagatingVgws": [], + "Tags": [], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "172.31.0.0/16", + "State": "active", + "Origin": "CreateRouteTable" + }, + { + "GatewayId": "igw-e200ee87", + "DestinationCidrBlock": "0.0.0.0/0", + "State": "active", + "Origin": "CreateRoute" + } + ] + }, + { + "Associations": [ + { + "SubnetId": "subnet-c5cf399c", + "RouteTableAssociationId": "rtbassoc-7867ce1d", + "Main": false, + "RouteTableId": "rtb-cfab0faa" + }, + { + "SubnetId": "subnet-9112c3e6", + "RouteTableAssociationId": "rtbassoc-4667ce23", + "Main": false, + "RouteTableId": "rtb-cfab0faa" + }, + { + "SubnetId": "subnet-7456e511", + "RouteTableAssociationId": "rtbassoc-4567ce20", + "Main": false, + "RouteTableId": "rtb-cfab0faa" + }, + { + "SubnetId": "subnet-c7cf399e", + "RouteTableAssociationId": "rtbassoc-7a67ce1f", + "Main": false, + "RouteTableId": "rtb-cfab0faa" + }, + { + "SubnetId": "subnet-6b56e50e", + "RouteTableAssociationId": "rtbassoc-7f67ce1a", + "Main": false, + "RouteTableId": "rtb-cfab0faa" + }, + { + "SubnetId": "subnet-9312c3e4", + "RouteTableAssociationId": "rtbassoc-7967ce1c", + "Main": false, + "RouteTableId": "rtb-cfab0faa" + } + ], + "RouteTableId": "rtb-cfab0faa", + "VpcId": "vpc-7f5e861a", + "PropagatingVgws": [], + "Tags": [ + { + "Value": "DevTest", + "Key": "Environment" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/DevTest-VPC/f40833d0-8417-11e4-8e98-50fa5e742444", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "Public route table", + "Key": "Name" + }, + { + "Value": "publicRouteTable", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "DevTest-VPC", + "Key": "aws:cloudformation:stack-name" + } + ], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active", + "Origin": "CreateRouteTable" + }, + { + "GatewayId": "igw-f8995a9d", + "DestinationCidrBlock": "0.0.0.0/0", + "State": "active", + "Origin": "CreateRoute" + } + ] + }, + { + "Associations": [ + { + "RouteTableAssociationId": "rtbassoc-039df866", + "Main": true, + "RouteTableId": "rtb-dda12bb8" + } + ], + "RouteTableId": "rtb-dda12bb8", + "VpcId": "vpc-06901063", + "PropagatingVgws": [], + "Tags": [], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active", + "Origin": "CreateRouteTable" + } + ] + }, + { + "Associations": [ + { + "SubnetId": "subnet-d99628ae", + "RouteTableAssociationId": "rtbassoc-169df873", + "Main": false, + "RouteTableId": "rtb-a4a12bc1" + }, + { + "SubnetId": "subnet-4aee762f", + "RouteTableAssociationId": "rtbassoc-119df874", + "Main": false, + "RouteTableId": "rtb-a4a12bc1" + } + ], + "RouteTableId": "rtb-a4a12bc1", + "VpcId": "vpc-06901063", + "PropagatingVgws": [], + "Tags": [ + { + "Value": "CloudNative", + "Key": "Vendor" + }, + { + "Value": "Public route table", + "Key": "Name" + }, + { + "Value": "publicRouteTable", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "cyan1-delta-hello-world", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/cyan1-delta-hello-world/b2fd9dd0-f41a-11e4-8e28-5088484a585d", + "Key": "aws:cloudformation:stack-id" + } + ], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active", + "Origin": "CreateRouteTable" + }, + { + "GatewayId": "igw-5919b83c", + "DestinationCidrBlock": "0.0.0.0/0", + "State": "active", + "Origin": "CreateRoute" + } + ] + }, + { + "Associations": [ + { + "SubnetId": "subnet-c2cf399b", + "RouteTableAssociationId": "rtbassoc-7c67ce19", + "Main": false, + "RouteTableId": "rtb-cdab0fa8" + }, + { + "SubnetId": "subnet-c6cf399f", + "RouteTableAssociationId": "rtbassoc-4467ce21", + "Main": false, + "RouteTableId": "rtb-cdab0fa8" + }, + { + "RouteTableAssociationId": "rtbassoc-a864cdcd", + "Main": true, + "RouteTableId": "rtb-cdab0fa8" + }, + { + "SubnetId": "subnet-9212c3e5", + "RouteTableAssociationId": "rtbassoc-4767ce22", + "Main": false, + "RouteTableId": "rtb-cdab0fa8" + }, + { + "SubnetId": "subnet-6a56e50f", + "RouteTableAssociationId": "rtbassoc-7e67ce1b", + "Main": false, + "RouteTableId": "rtb-cdab0fa8" + }, + { + "SubnetId": "subnet-9412c3e3", + "RouteTableAssociationId": "rtbassoc-7d67ce18", + "Main": false, + "RouteTableId": "rtb-cdab0fa8" + }, + { + "SubnetId": "subnet-7556e510", + "RouteTableAssociationId": "rtbassoc-7b67ce1e", + "Main": false, + "RouteTableId": "rtb-cdab0fa8" + } + ], + "RouteTableId": "rtb-cdab0fa8", + "VpcId": "vpc-7f5e861a", + "PropagatingVgws": [], + "Tags": [], + "Routes": [ + { + "GatewayId": "local", + "DestinationCidrBlock": "10.0.0.0/16", + "State": "active", + "Origin": "CreateRouteTable" + } + ] + } + ] + } +} diff --git a/tests/unit/responses/secgrp/ec2.DescribeSecurityGroups_1.json b/tests/unit/responses/secgrp/ec2.DescribeSecurityGroups_1.json new file mode 100644 index 0000000..438a0bb --- /dev/null +++ b/tests/unit/responses/secgrp/ec2.DescribeSecurityGroups_1.json @@ -0,0 +1,139 @@ +{ + "status_code": 200, + "data": { + "SecurityGroups": [ + { + "IpPermissionsEgress": [], + "Description": "default group", + "IpPermissions": [ + { + "PrefixListIds": [], + "FromPort": 0, + "IpRanges": [], + "ToPort": 65535, + "IpProtocol": "tcp", + "UserIdGroupPairs": [ + { + "GroupName": "default", + "UserId": "123456789012", + "GroupId": "sg-c7286cf7" + } + ] + }, + { + "PrefixListIds": [], + "FromPort": 0, + "IpRanges": [], + "ToPort": 65535, + "IpProtocol": "udp", + "UserIdGroupPairs": [ + { + "GroupName": "default", + "UserId": "123456789012", + "GroupId": "sg-c7286cf7" + } + ] + }, + { + "PrefixListIds": [], + "FromPort": -1, + "IpRanges": [], + "ToPort": -1, + "IpProtocol": "icmp", + "UserIdGroupPairs": [ + { + "GroupName": "default", + "UserId": "123456789012", + "GroupId": "sg-c7286cf7" + } + ] + } + ], + "GroupName": "default", + "OwnerId": "123456789012", + "GroupId": "sg-c7286cf7" + }, + { + "IpPermissionsEgress": [ + { + "IpProtocol": "-1", + "IpRanges": [ + { + "CidrIp": "0.0.0.0/0" + } + ], + "UserIdGroupPairs": [], + "PrefixListIds": [] + } + ], + "Description": "A group for running an iPython notebook server", + "IpPermissions": [ + { + "PrefixListIds": [], + "FromPort": 8888, + "IpRanges": [ + { + "CidrIp": "1.2.3.4/32" + } + ], + "ToPort": 8888, + "IpProtocol": "tcp", + "UserIdGroupPairs": [] + }, + { + "PrefixListIds": [], + "FromPort": 22, + "IpRanges": [ + { + "CidrIp": "0.0.0.0/0" + } + ], + "ToPort": 22, + "IpProtocol": "tcp", + "UserIdGroupPairs": [] + } + ], + "GroupName": "IPythonNotebook", + "VpcId": "vpc-4ff5eb2d", + "OwnerId": "123456789012", + "GroupId": "sg-740eec11" + }, + { + "IpPermissionsEgress": [ + { + "IpProtocol": "-1", + "IpRanges": [ + { + "CidrIp": "0.0.0.0/0" + } + ], + "UserIdGroupPairs": [], + "PrefixListIds": [] + } + ], + "Description": "default VPC security group", + "IpPermissions": [ + { + "IpProtocol": "-1", + "IpRanges": [], + "UserIdGroupPairs": [ + { + "UserId": "123456789012", + "GroupId": "sg-cc09eba9" + } + ], + "PrefixListIds": [] + } + ], + "GroupName": "default", + "VpcId": "vpc-4ff5eb2d", + "OwnerId": "123456789012", + "GroupId": "sg-cc09eba9" + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "4e4c6b4b-9e97-448b-bf1f-09760c584f2e" + } + } +} diff --git a/tests/unit/responses/stacks/cloudformation.DescribeStackResources_1.json b/tests/unit/responses/stacks/cloudformation.DescribeStackResources_1.json new file mode 100644 index 0000000..eb505f5 --- /dev/null +++ b/tests/unit/responses/stacks/cloudformation.DescribeStackResources_1.json @@ -0,0 +1,83 @@ +{ + "status_code": 200, + "data": { + "StackResources": [ + { + "StackId": "arn:aws:cloudformation:us-west-2:860421987956:stack/foobar-tables/117c58a0-b56e-11e5-a63a-503f2a2ceeae", + "ResourceStatus": "CREATE_COMPLETE", + "ResourceType": "AWS::DynamoDB::Table", + "Timestamp": { + "hour": 18, + "__class__": "datetime", + "month": 1, + "second": 51, + "microsecond": 962000, + "year": 2016, + "day": 7, + "minute": 40 + }, + "StackName": "foobar-tables", + "PhysicalResourceId": "foobar-tables", + "LogicalResourceId": "foobar" + }, + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/foobar-tables/117c58a0-b56e-11e5-a63a-503f2a2ceeae", + "ResourceStatus": "CREATE_COMPLETE", + "ResourceType": "AWS::DynamoDB::Table", + "Timestamp": { + "hour": 18, + "__class__": "datetime", + "month": 1, + "second": 50, + "microsecond": 715000, + "year": 2016, + "day": 7, + "minute": 40 + }, + "StackName": "foo", + "PhysicalResourceId": "foo", + "LogicalResourceId": "foo" + }, + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/yeobot-tables/117c58a0-b56e-11e5-a63a-503f2a2ceeae", + "ResourceStatus": "CREATE_COMPLETE", + "ResourceType": "AWS::DynamoDB::Table", + "Timestamp": { + "hour": 23, + "__class__": "datetime", + "month": 1, + "second": 29, + "microsecond": 437000, + "year": 2016, + "day": 8, + "minute": 1 + }, + "StackName": "bar", + "PhysicalResourceId": "bar", + "LogicalResourceId": "bar" + }, + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/yeobot-tables/117c58a0-b56e-11e5-a63a-503f2a2ceeae", + "ResourceStatus": "CREATE_COMPLETE", + "ResourceType": "AWS::DynamoDB::Table", + "Timestamp": { + "hour": 18, + "__class__": "datetime", + "month": 1, + "second": 50, + "microsecond": 915000, + "year": 2016, + "day": 7, + "minute": 40 + }, + "StackName": "fie", + "PhysicalResourceId": "fie", + "LogicalResourceId": "fie" + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "f7cff340-ba3d-11e5-9c27-a9e2294677da" + } + } +} diff --git a/tests/unit/responses/stacks/cloudformation.DescribeStacks_1.json b/tests/unit/responses/stacks/cloudformation.DescribeStacks_1.json new file mode 100644 index 0000000..473d816 --- /dev/null +++ b/tests/unit/responses/stacks/cloudformation.DescribeStacks_1.json @@ -0,0 +1,57 @@ +{ + "status_code": 200, + "data": { + "Stacks": [ + { + "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/foobar-tables/117c58a0-b56e-11e5-a63a-503f2a2ceeae", + "Description": "Create all DynamoDB tables needed by FooBar", + "Tags": [], + "Outputs": [ + { + "Description": "The Foo table", + "OutputKey": "foo", + "OutputValue": "foo" + }, + { + "Description": "The Bar table", + "OutputKey": "bar", + "OutputValue": "bar" + }, + { + "Description": "The Fie table", + "OutputKey": "fie", + "OutputValue": "fie" + } + ], + "CreationTime": { + "hour": 18, + "__class__": "datetime", + "month": 1, + "second": 4, + "microsecond": 921000, + "year": 2016, + "day": 7, + "minute": 40 + }, + "StackName": "foobar-tables", + "NotificationARNs": [], + "StackStatus": "UPDATE_COMPLETE", + "DisableRollback": false, + "LastUpdatedTime": { + "hour": 23, + "__class__": "datetime", + "month": 1, + "second": 39, + "microsecond": 255000, + "year": 2016, + "day": 8, + "minute": 0 + } + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "f7857c47-ba3d-11e5-bca7-5353f1afe730" + } + } +} diff --git a/tests/unit/responses/users/iam.ListUsers_1.json b/tests/unit/responses/users/iam.ListUsers_1.json new file mode 100644 index 0000000..d480bb9 --- /dev/null +++ b/tests/unit/responses/users/iam.ListUsers_1.json @@ -0,0 +1,106 @@ +{ + "status_code": 200, + "data": { + "Users": [ + { + "UserName": "foo", + "Path": "/", + "CreateDate": { + "hour": 16, + "__class__": "datetime", + "month": 9, + "second": 8, + "microsecond": 0, + "year": 2015, + "day": 3, + "minute": 38 + }, + "UserId": "AIDAIRPF4OH5UHMJZL46Y", + "Arn": "arn:aws:iam::234567890123:user/foo" + }, + { + "UserName": "bar", + "PasswordLastUsed": { + "hour": 4, + "__class__": "datetime", + "month": 1, + "second": 9, + "microsecond": 0, + "year": 2016, + "day": 13, + "minute": 9 + }, + "CreateDate": { + "hour": 22, + "__class__": "datetime", + "month": 6, + "second": 14, + "microsecond": 0, + "year": 2015, + "day": 11, + "minute": 37 + }, + "UserId": "AIDAI3QVEB6MR6JTWJUDU", + "Path": "/", + "Arn": "arn:aws:iam::234567890123:user/bar" + }, + { + "UserName": "fie", + "PasswordLastUsed": { + "hour": 7, + "__class__": "datetime", + "month": 1, + "second": 36, + "microsecond": 0, + "year": 2016, + "day": 4, + "minute": 4 + }, + "CreateDate": { + "hour": 20, + "__class__": "datetime", + "month": 5, + "second": 10, + "microsecond": 0, + "year": 2015, + "day": 26, + "minute": 42 + }, + "UserId": "AIDAJV2QK2FRI4DIGSU54", + "Path": "/", + "Arn": "arn:aws:iam::234567890123:user/fie" + }, + { + "UserName": "baz", + "PasswordLastUsed": { + "hour": 13, + "__class__": "datetime", + "month": 1, + "second": 36, + "microsecond": 0, + "year": 2016, + "day": 4, + "minute": 5 + }, + "CreateDate": { + "hour": 18, + "__class__": "datetime", + "month": 11, + "second": 40, + "microsecond": 0, + "year": 2015, + "day": 30, + "minute": 48 + }, + "UserId": "AIDAJAUML5KUAM547O6LK", + "Path": "/", + "Arn": "arn:aws:iam::234567890123:user/baz" + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "e2cfc45a-ba38-11e5-ac7c-6b766251e9ee" + }, + "IsTruncated": false + } +} diff --git a/tests/unit/responses/volumes/ec2.DescribeVolumes_1.json b/tests/unit/responses/volumes/ec2.DescribeVolumes_1.json new file mode 100644 index 0000000..f542661 --- /dev/null +++ b/tests/unit/responses/volumes/ec2.DescribeVolumes_1.json @@ -0,0 +1,149 @@ +{ + "status_code": 200, + "data": { + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "d856b1fe-1716-462d-bc63-aad062316190" + }, + "Volumes": [ + { + "AvailabilityZone": "us-west-2c", + "Attachments": [], + "Encrypted": false, + "VolumeType": "gp2", + "VolumeId": "vol-b85e475f", + "State": "available", + "Iops": 24, + "SnapshotId": "snap-bfb086e1", + "CreateTime": { + "hour": 6, + "__class__": "datetime", + "month": 9, + "second": 19, + "microsecond": 569000, + "year": 2015, + "day": 23, + "minute": 20 + }, + "Size": 8 + }, + { + "AvailabilityZone": "us-west-2c", + "Attachments": [ + { + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 41, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 22 + }, + "InstanceId": "i-c81fb512", + "VolumeId": "vol-a3510945", + "State": "attached", + "DeleteOnTermination": true, + "Device": "/dev/xvda" + } + ], + "Encrypted": false, + "VolumeType": "gp2", + "VolumeId": "vol-a3510945", + "State": "in-use", + "Iops": 90, + "SnapshotId": "snap-8c9ecb15", + "CreateTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 41, + "microsecond": 428000, + "year": 2015, + "day": 31, + "minute": 22 + }, + "Size": 30 + }, + { + "AvailabilityZone": "us-west-2a", + "Attachments": [ + { + "AttachTime": { + "hour": 21, + "__class__": "datetime", + "month": 11, + "second": 35, + "microsecond": 0, + "year": 2015, + "day": 4, + "minute": 18 + }, + "InstanceId": "i-100ec2c9", + "VolumeId": "vol-09f36bc8", + "State": "attached", + "DeleteOnTermination": true, + "Device": "/dev/sda1" + } + ], + "Encrypted": false, + "VolumeType": "gp2", + "VolumeId": "vol-09f36bc8", + "State": "in-use", + "Iops": 24, + "SnapshotId": "snap-6fa83432", + "CreateTime": { + "hour": 21, + "__class__": "datetime", + "month": 11, + "second": 35, + "microsecond": 213000, + "year": 2015, + "day": 4, + "minute": 18 + }, + "Size": 8 + }, + { + "AvailabilityZone": "us-west-2a", + "Attachments": [ + { + "AttachTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 10, + "microsecond": 0, + "year": 2015, + "day": 31, + "minute": 21 + }, + "InstanceId": "i-db530902", + "VolumeId": "vol-aac7336a", + "State": "attached", + "DeleteOnTermination": true, + "Device": "/dev/xvda" + } + ], + "Encrypted": false, + "VolumeType": "gp2", + "VolumeId": "vol-aac7336a", + "State": "in-use", + "Iops": 90, + "SnapshotId": "snap-8c9ecb15", + "CreateTime": { + "hour": 0, + "__class__": "datetime", + "month": 12, + "second": 10, + "microsecond": 749000, + "year": 2015, + "day": 31, + "minute": 21 + }, + "Size": 30 + } + ] + } +} \ No newline at end of file diff --git a/tests/unit/responses/vpcs/ec2.DescribeVpcPeeringConnections_1.json b/tests/unit/responses/vpcs/ec2.DescribeVpcPeeringConnections_1.json new file mode 100644 index 0000000..a52c1ff --- /dev/null +++ b/tests/unit/responses/vpcs/ec2.DescribeVpcPeeringConnections_1.json @@ -0,0 +1,10 @@ +{ + "status_code": 200, + "data": { + "VpcPeeringConnections": [], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "e9826765-8432-4f48-b895-0fc61d448020" + } + } +} \ No newline at end of file diff --git a/tests/unit/responses/vpcs/ec2.DescribeVpcs_1.json b/tests/unit/responses/vpcs/ec2.DescribeVpcs_1.json new file mode 100644 index 0000000..fd59f5b --- /dev/null +++ b/tests/unit/responses/vpcs/ec2.DescribeVpcs_1.json @@ -0,0 +1,79 @@ +{ + "status_code": 200, + "data": { + "Vpcs": [ + { + "VpcId": "vpc-7f5e861a", + "InstanceTenancy": "default", + "Tags": [ + { + "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/DevTest-VPC/f40833d0-8417-11e4-8e98-50fa5e742444", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "DevTest", + "Key": "Environment" + }, + { + "Value": "DevTest-VPC", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "DevTest VPC", + "Key": "Name" + }, + { + "Value": "theVpc", + "Key": "aws:cloudformation:logical-id" + } + ], + "State": "available", + "DhcpOptionsId": "dopt-6fa84c0a", + "CidrBlock": "10.0.0.0/16", + "IsDefault": false + }, + { + "VpcId": "vpc-06901063", + "InstanceTenancy": "default", + "Tags": [ + { + "Value": "theVpc", + "Key": "aws:cloudformation:logical-id" + }, + { + "Value": "Hello World VPC", + "Key": "Name" + }, + { + "Value": "arn:aws:cloudformation:us-west-2:123456789012:stack/cyan1-delta-hello-world/b2fd9dd0-f41a-11e4-8e28-5088484a585d", + "Key": "aws:cloudformation:stack-id" + }, + { + "Value": "cyan1-delta-hello-world", + "Key": "aws:cloudformation:stack-name" + }, + { + "Value": "CloudNative", + "Key": "Vendor" + } + ], + "State": "available", + "DhcpOptionsId": "dopt-195db47c", + "CidrBlock": "10.0.0.0/16", + "IsDefault": false + }, + { + "VpcId": "vpc-2b86744e", + "InstanceTenancy": "default", + "State": "available", + "DhcpOptionsId": "dopt-0cffed6e", + "CidrBlock": "172.31.0.0/16", + "IsDefault": true + } + ], + "ResponseMetadata": { + "HTTPStatusCode": 200, + "RequestId": "0e5a176a-9344-4141-a937-8411c24c8aee" + } + } +} diff --git a/tests/unit/test_arn.py b/tests/unit/test_arn.py index 0be20c0..fcbd8b4 100644 --- a/tests/unit/test_arn.py +++ b/tests/unit/test_arn.py @@ -15,16 +15,17 @@ import os import mock +import placebo from skew import scan -from tests.unit.mock_awsclient import get_awsclient -import skew.awsclient - -skew.awsclient.get_awsclient = get_awsclient class TestARN(unittest.TestCase): + def _get_response_path(self, test_case): + p = os.path.join(os.path.dirname(__file__), 'responses') + return os.path.join(p, test_case) + def setUp(self): self.environ = {} self.environ_patch = mock.patch('os.environ', self.environ) @@ -39,107 +40,157 @@ def setUp(self): def tearDown(self): pass - def test_ec2_instance(self): - arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/*') + def test_ec2(self): + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('instances_1'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/*', + **placebo_cfg) # Fetch all Instance resources l = list(arn) self.assertEqual(len(l), 2) - # Fetch non-existant resource - arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/i-decafbad') - l = list(arn) - self.assertEqual(len(l), 0) # Fetch a single resource - arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/i-30f39af5') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('instances_2'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/i-db530902', + **placebo_cfg) l = list(arn) self.assertEqual(len(l), 1) # check filters - arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/i-30f39af5|InstanceType') + arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/i-db530902|InstanceType', + **placebo_cfg) l = list(arn) self.assertEqual(len(l), 1) r = l[0] self.assertEqual(r.filtered_data, 't2.small') def test_ec2_volumes(self): - arn = scan('arn:aws:ec2::234567890123:volume/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('volumes'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:volume/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 1) + self.assertEqual(len(l), 4) r = l[0] - self.assertEqual(r.data['VolumeId'], "vol-ea3e1724") + self.assertEqual(r.data['VolumeId'], "vol-b85e475f") - def test_ec2_images(self): - arn = scan('arn:aws:ec2:us-west-2:234567890123:image/*') - l = list(arn) - self.assertEqual(len(l), 1) + # def test_ec2_images(self): + # arn = scan('arn:aws:ec2:us-west-2:234567890123:image/*') + # l = list(arn) + # self.assertEqual(len(l), 1) def test_ec2_keypairs(self): - arn = scan('arn:aws:ec2:*:234567890123:key-pair/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('keypairs'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:key-pair/*', + debug=True, **placebo_cfg) l = list(arn) self.assertEqual(len(l), 2) + self.assertEqual(l[0].id, 'admin') + self.assertEqual(l[1].id, 'FooBar') + self.assertEqual( + l[0].data['KeyFingerprint'], + "85:83:08:25:fa:96:45:ea:c9:15:04:12:af:45:3f:c0:ef:e8:b8:ce") def test_ec2_securitygroup(self): - arn = scan('arn:aws:ec2:*:123456789012:security-group/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('secgrp'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:security-group/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 10) + self.assertEqual(len(l), 3) def test_elb_loadbalancer(self): - arn = scan('arn:aws:elb:us-west-2:123456789012:loadbalancer/*') - l = list(arn) - self.assertEqual(len(l), 1) - arn = scan('arn:aws:elb:us-west-2:234567890123:loadbalancer/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('elbs'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:elb:us-west-2:123456789012:loadbalancer/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 5) + self.assertEqual(len(l), 6) def test_ec2_vpcs(self): - arn = scan('arn:aws:ec2:us-west-2:123456789012:vpc/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('vpcs'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:vpc/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 2) + self.assertEqual(len(l), 3) def test_ec2_routetable(self): - arn = scan('arn:aws:ec2:us-west-2:123456789012:route-table/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('routetables'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:route-table/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 3) + self.assertEqual(len(l), 5) def test_ec2_network_acls(self): - arn = scan('arn:aws:ec2:us-west-2:123456789012:network-acl/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('networkacls'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:ec2:us-west-2:123456789012:network-acl/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 4) + self.assertEqual(len(l), 8) def test_iam_users(self): - arn = scan('arn:aws:iam:*:234567890123:user/*') - l = list(arn) - self.assertEqual(len(l), 3) - arn = scan('arn:aws:iam:*:234567890123:user/foo') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('users'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:iam:*:234567890123:user/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 1) + self.assertEqual(len(l), 4) def test_s3_buckets(self): - arn = scan('arn:aws:s3:us-east-1:234567890123:bucket/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('buckets'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:s3:us-east-1:234567890123:bucket/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 4) - bucket_resource = l[1] - keys = list(bucket_resource) - self.assertEqual(len(keys), 4) + self.assertEqual(len(l), 5) def test_iam_groups(self): - arn = scan('arn:aws:iam::123456789012:group/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('groups'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:iam::234567890123:group/*', + **placebo_cfg) l = list(arn) - self.assertEqual(len(l), 2) + self.assertEqual(len(l), 3) group_resource = l[0] self.assertEqual(group_resource.arn, - 'arn:aws:iam::123456789012:group/Administrators') - - def test_route53_hostedzone(self): - arn = scan('arn:aws:route53::123456789012:hostedzone/*') - l = list(arn) - self.assertEqual(len(l), 2) - zone_resource = l[0] - self.assertEqual(zone_resource.arn, - 'arn:aws:route53:::hostedzone/FFFF865FFFF3') + 'arn:aws:iam::234567890123:group/Administrators') def test_cloudformation_stacks(self): - arn = scan('arn:aws:cloudformation:us-west-2:123456789012:stack/*') + placebo_cfg = { + 'placebo': placebo, + 'placebo_dir': self._get_response_path('stacks'), + 'placebo_mode': 'playback'} + arn = scan('arn:aws:cloudformation:us-west-2:123456789012:stack/*', + **placebo_cfg) l = list(arn) self.assertEqual(len(l), 1) stack_resource = l[0] resources = list(stack_resource) - self.assertEqual(len(resources), 6) + self.assertEqual(len(resources), 4)