2014-08-27 11:17:06 -04:00
|
|
|
from __future__ import unicode_literals
|
2016-12-01 17:23:51 -08:00
|
|
|
|
2017-09-22 00:20:26 +01:00
|
|
|
from moto.acm import acm_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.apigateway import apigateway_backends
|
2019-10-22 14:37:29 -07:00
|
|
|
from moto.athena import athena_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.autoscaling import autoscaling_backends
|
|
|
|
|
from moto.awslambda import lambda_backends
|
2019-11-01 19:24:21 +02:00
|
|
|
from moto.batch import batch_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.cloudformation import cloudformation_backends
|
|
|
|
|
from moto.cloudwatch import cloudwatch_backends
|
2019-12-26 17:21:37 +01:00
|
|
|
from moto.codecommit import codecommit_backends
|
2019-12-15 16:06:08 +01:00
|
|
|
from moto.codepipeline import codepipeline_backends
|
2018-04-03 12:57:21 -07:00
|
|
|
from moto.cognitoidentity import cognitoidentity_backends
|
2018-05-02 16:13:12 -05:00
|
|
|
from moto.cognitoidp import cognitoidp_backends
|
2019-11-01 19:24:21 +02:00
|
|
|
from moto.config import config_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.core import moto_api_backends
|
|
|
|
|
from moto.datapipeline import datapipeline_backends
|
2019-11-01 19:24:21 +02:00
|
|
|
from moto.datasync import datasync_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.dynamodb import dynamodb_backends
|
|
|
|
|
from moto.dynamodb2 import dynamodb_backends2
|
2018-11-07 17:10:00 -05:00
|
|
|
from moto.dynamodbstreams import dynamodbstreams_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.ec2 import ec2_backends
|
2019-12-14 19:21:41 -08:00
|
|
|
from moto.ec2_instance_connect import ec2_instance_connect_backends
|
2017-05-22 22:04:33 -05:00
|
|
|
from moto.ecr import ecr_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.ecs import ecs_backends
|
|
|
|
|
from moto.elb import elb_backends
|
2017-07-23 22:06:55 -07:00
|
|
|
from moto.elbv2 import elbv2_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.emr import emr_backends
|
|
|
|
|
from moto.events import events_backends
|
|
|
|
|
from moto.glacier import glacier_backends
|
2018-08-07 16:57:20 -04:00
|
|
|
from moto.glue import glue_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.iam import iam_backends
|
|
|
|
|
from moto.instance_metadata import instance_metadata_backends
|
2019-11-01 19:24:21 +02:00
|
|
|
from moto.iot import iot_backends
|
|
|
|
|
from moto.iotdata import iotdata_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.kinesis import kinesis_backends
|
|
|
|
|
from moto.kms import kms_backends
|
2017-09-27 16:04:58 -07:00
|
|
|
from moto.logs import logs_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.opsworks import opsworks_backends
|
2018-07-14 11:35:37 -07:00
|
|
|
from moto.organizations import organizations_backends
|
2017-09-26 16:46:18 +01:00
|
|
|
from moto.polly import polly_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.rds2 import rds2_backends
|
|
|
|
|
from moto.redshift import redshift_backends
|
2019-05-25 11:10:34 +01:00
|
|
|
from moto.resourcegroups import resourcegroups_backends
|
2019-11-01 19:24:21 +02:00
|
|
|
from moto.resourcegroupstaggingapi import resourcegroupstaggingapi_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.route53 import route53_backends
|
|
|
|
|
from moto.s3 import s3_backends
|
2018-06-05 22:11:00 -07:00
|
|
|
from moto.secretsmanager import secretsmanager_backends
|
2019-10-22 14:37:29 -07:00
|
|
|
from moto.ses import ses_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.sns import sns_backends
|
|
|
|
|
from moto.sqs import sqs_backends
|
2017-04-18 19:09:10 +02:00
|
|
|
from moto.ssm import ssm_backends
|
2019-09-02 16:26:40 +01:00
|
|
|
from moto.stepfunctions import stepfunction_backends
|
2017-02-23 19:43:48 -05:00
|
|
|
from moto.sts import sts_backends
|
2017-12-23 05:45:05 +02:00
|
|
|
from moto.swf import swf_backends
|
2017-09-23 00:08:31 +01:00
|
|
|
from moto.xray import xray_backends
|
2017-10-25 03:45:39 +09:00
|
|
|
|
2013-07-26 15:14:34 -04:00
|
|
|
BACKENDS = {
|
2019-10-31 08:44:26 -07:00
|
|
|
"acm": acm_backends,
|
|
|
|
|
"apigateway": apigateway_backends,
|
|
|
|
|
"athena": athena_backends,
|
|
|
|
|
"autoscaling": autoscaling_backends,
|
|
|
|
|
"batch": batch_backends,
|
|
|
|
|
"cloudformation": cloudformation_backends,
|
|
|
|
|
"cloudwatch": cloudwatch_backends,
|
2019-12-26 17:21:37 +01:00
|
|
|
"codecommit": codecommit_backends,
|
2019-12-15 16:06:08 +01:00
|
|
|
"codepipeline": codepipeline_backends,
|
2019-10-31 08:44:26 -07:00
|
|
|
"cognito-identity": cognitoidentity_backends,
|
|
|
|
|
"cognito-idp": cognitoidp_backends,
|
|
|
|
|
"config": config_backends,
|
|
|
|
|
"datapipeline": datapipeline_backends,
|
2019-11-01 19:24:21 +02:00
|
|
|
"datasync": datasync_backends,
|
2019-10-31 08:44:26 -07:00
|
|
|
"dynamodb": dynamodb_backends,
|
|
|
|
|
"dynamodb2": dynamodb_backends2,
|
|
|
|
|
"dynamodbstreams": dynamodbstreams_backends,
|
|
|
|
|
"ec2": ec2_backends,
|
2019-12-14 19:21:41 -08:00
|
|
|
"ec2_instance_connect": ec2_instance_connect_backends,
|
2019-10-31 08:44:26 -07:00
|
|
|
"ecr": ecr_backends,
|
|
|
|
|
"ecs": ecs_backends,
|
|
|
|
|
"elb": elb_backends,
|
|
|
|
|
"elbv2": elbv2_backends,
|
|
|
|
|
"events": events_backends,
|
|
|
|
|
"emr": emr_backends,
|
|
|
|
|
"glacier": glacier_backends,
|
|
|
|
|
"glue": glue_backends,
|
|
|
|
|
"iam": iam_backends,
|
|
|
|
|
"moto_api": moto_api_backends,
|
|
|
|
|
"instance_metadata": instance_metadata_backends,
|
|
|
|
|
"logs": logs_backends,
|
|
|
|
|
"kinesis": kinesis_backends,
|
|
|
|
|
"kms": kms_backends,
|
|
|
|
|
"opsworks": opsworks_backends,
|
|
|
|
|
"organizations": organizations_backends,
|
|
|
|
|
"polly": polly_backends,
|
|
|
|
|
"redshift": redshift_backends,
|
|
|
|
|
"resource-groups": resourcegroups_backends,
|
|
|
|
|
"rds": rds2_backends,
|
|
|
|
|
"s3": s3_backends,
|
|
|
|
|
"s3bucket_path": s3_backends,
|
|
|
|
|
"ses": ses_backends,
|
|
|
|
|
"secretsmanager": secretsmanager_backends,
|
|
|
|
|
"sns": sns_backends,
|
|
|
|
|
"sqs": sqs_backends,
|
|
|
|
|
"ssm": ssm_backends,
|
|
|
|
|
"stepfunctions": stepfunction_backends,
|
|
|
|
|
"sts": sts_backends,
|
|
|
|
|
"swf": swf_backends,
|
|
|
|
|
"route53": route53_backends,
|
|
|
|
|
"lambda": lambda_backends,
|
|
|
|
|
"xray": xray_backends,
|
|
|
|
|
"resourcegroupstaggingapi": resourcegroupstaggingapi_backends,
|
|
|
|
|
"iot": iot_backends,
|
|
|
|
|
"iot-data": iotdata_backends,
|
2013-07-26 15:14:34 -04:00
|
|
|
}
|
2014-06-18 10:46:20 +03:00
|
|
|
|
|
|
|
|
|
2017-02-23 22:28:09 -05:00
|
|
|
def get_model(name, region_name):
|
2017-02-23 19:43:48 -05:00
|
|
|
for backends in BACKENDS.values():
|
|
|
|
|
for region, backend in backends.items():
|
2017-02-23 22:28:09 -05:00
|
|
|
if region == region_name:
|
2019-10-31 08:44:26 -07:00
|
|
|
models = getattr(backend.__class__, "__models__", {})
|
2017-02-23 19:43:48 -05:00
|
|
|
if name in models:
|
|
|
|
|
return list(getattr(backend, models[name])())
|