How to use MotoFallbackDispatcher method in localstack

Best Python code snippet using localstack_python

providers.py

Source:providers.py Github

copy

Full Screen

...6def acm():7 from localstack.services.acm.provider import AcmProvider8 from localstack.services.moto import MotoFallbackDispatcher9 provider = AcmProvider()10 return Service("acm", listener=AwsApiListener("acm", MotoFallbackDispatcher(provider)))11@aws_provider()12def apigateway():13 from localstack.services.apigateway.provider import ApigatewayApiListener, ApigatewayProvider14 provider = ApigatewayProvider()15 listener = ApigatewayApiListener("apigateway", MotoFallbackDispatcher(provider))16 return Service("apigateway", listener=listener, lifecycle_hook=provider)17@aws_provider()18def cloudformation():19 from localstack.services.cloudformation.provider import CloudformationProvider20 provider = CloudformationProvider()21 return Service("cloudformation", listener=AwsApiListener("cloudformation", provider))22@aws_provider(api="config")23def awsconfig():24 from localstack.services.configservice.provider import ConfigProvider25 from localstack.services.moto import MotoFallbackDispatcher26 provider = ConfigProvider()27 return Service("config", listener=AwsApiListener("config", MotoFallbackDispatcher(provider)))28@aws_provider()29def cloudwatch():30 from localstack.services.cloudwatch.provider import CloudwatchProvider31 from localstack.services.moto import MotoFallbackDispatcher32 provider = CloudwatchProvider()33 listener = AwsApiListener("cloudwatch", MotoFallbackDispatcher(provider))34 return Service(35 "cloudwatch",36 listener=listener,37 lifecycle_hook=provider,38 )39@aws_provider()40def dynamodb():41 from localstack.services.dynamodb.provider import DynamoDBApiListener42 listener = DynamoDBApiListener()43 return Service(44 "dynamodb",45 listener=listener,46 lifecycle_hook=listener.provider,47 )48@aws_provider()49def dynamodbstreams():50 from localstack.aws.proxy import AwsApiListener51 from localstack.services.dynamodbstreams.provider import DynamoDBStreamsProvider52 provider = DynamoDBStreamsProvider()53 return Service(54 "dynamodbstreams",55 listener=AwsApiListener("dynamodbstreams", provider),56 lifecycle_hook=provider,57 )58@aws_provider()59def ec2():60 from localstack.services.ec2.provider import Ec2Provider61 from localstack.services.moto import MotoFallbackDispatcher62 provider = Ec2Provider()63 return Service(64 "ec2",65 listener=AwsApiListener("ec2", MotoFallbackDispatcher(provider)),66 )67@aws_provider()68def es():69 from localstack.aws.proxy import AwsApiListener70 from localstack.services.es.provider import EsProvider71 provider = EsProvider()72 return Service("es", listener=AwsApiListener("es", provider))73@aws_provider()74def firehose():75 from localstack.aws.proxy import AwsApiListener76 from localstack.services.firehose.provider import FirehoseProvider77 provider = FirehoseProvider()78 return Service("firehose", listener=AwsApiListener("firehose", provider))79@aws_provider()80def iam():81 from localstack.services.iam.provider import IamProvider82 from localstack.services.moto import MotoFallbackDispatcher83 provider = IamProvider()84 return Service(85 "iam",86 listener=AwsApiListener("iam", MotoFallbackDispatcher(provider)),87 )88@aws_provider()89def sts():90 from localstack.services.sts.provider import StsAwsApiListener91 listener = StsAwsApiListener()92 return Service("sts", listener=listener)93@aws_provider()94def kinesis():95 from localstack.services.kinesis import kinesis_listener, kinesis_starter96 return Service(97 "kinesis",98 listener=kinesis_listener.UPDATE_KINESIS,99 start=kinesis_starter.start_kinesis,100 check=kinesis_starter.check_kinesis,101 )102@aws_provider()103def kms():104 if config.KMS_PROVIDER == "local-kms":105 from localstack.services.kms import kms_starter106 return Service("kms", start=kms_starter.start_kms_local)107 # fall back to default provider108 from localstack.services.kms.provider import KmsProvider109 provider = KmsProvider()110 return Service("kms", listener=AwsApiListener("kms", MotoFallbackDispatcher(provider)))111@aws_provider(api="lambda")112def awslambda():113 from localstack.services.awslambda import lambda_starter114 return Service(115 "lambda",116 start=lambda_starter.start_lambda,117 stop=lambda_starter.stop_lambda,118 check=lambda_starter.check_lambda,119 )120@aws_provider(api="lambda", name="asf")121def awslambda_asf():122 from localstack.aws.proxy import AwsApiListener123 from localstack.services.awslambda.provider import LambdaProvider124 provider = LambdaProvider()125 return Service("lambda", listener=AwsApiListener("lambda", provider), lifecycle_hook=provider)126@aws_provider()127def logs():128 from localstack.services.logs.provider import LogsAwsApiListener129 listener = LogsAwsApiListener()130 return Service("logs", listener=listener)131@aws_provider()132def opensearch():133 from localstack.aws.proxy import AwsApiListener134 from localstack.services.opensearch.provider import OpensearchProvider135 provider = OpensearchProvider()136 return Service("opensearch", listener=AwsApiListener("opensearch", provider))137@aws_provider()138def redshift():139 from localstack.services.redshift.provider import RedshiftProvider140 provider = RedshiftProvider()141 listener = AwsApiListener("redshift", MotoFallbackDispatcher(provider))142 return Service("redshift", listener=listener)143@aws_provider()144def route53():145 from localstack.services.route53.provider import Route53Provider146 provider = Route53Provider()147 return Service("route53", listener=AwsApiListener("route53", MotoFallbackDispatcher(provider)))148@aws_provider()149def route53resolver():150 from localstack.services.route53.provider import Route53ResolverApi151 provider = Route53ResolverApi()152 return Service(153 "route53resolver",154 listener=AwsApiListener("route53resolver", MotoFallbackDispatcher(provider)),155 )156@aws_provider()157def s3():158 from localstack.services.s3 import s3_listener, s3_starter159 return Service(160 "s3", listener=s3_listener.UPDATE_S3, start=s3_starter.start_s3, check=s3_starter.check_s3161 )162@aws_provider()163def s3control():164 from localstack.services.moto import MotoFallbackDispatcher165 from localstack.services.s3control.provider import S3ControlProvider166 provider = S3ControlProvider()167 return Service(168 "s3control", listener=AwsApiListener("s3control", MotoFallbackDispatcher(provider))169 )170@aws_provider()171def secretsmanager():172 from localstack.services.moto import MotoFallbackDispatcher173 from localstack.services.secretsmanager.provider import SecretsmanagerProvider174 provider = SecretsmanagerProvider()175 return Service(176 "secretsmanager",177 listener=AwsApiListener("secretsmanager", MotoFallbackDispatcher(provider)),178 )179@aws_provider()180def ses():181 from localstack.services.moto import MotoFallbackDispatcher182 from localstack.services.ses.provider import SesProvider183 provider = SesProvider()184 return Service(185 "ses",186 listener=AwsApiListener("ses", MotoFallbackDispatcher(provider)),187 lifecycle_hook=provider,188 )189@aws_provider()190def sns():191 from localstack.aws.proxy import AwsApiListener192 from localstack.services.sns.provider import SnsProvider193 provider = SnsProvider()194 return Service("sns", listener=AwsApiListener("sns", provider), lifecycle_hook=provider)195@aws_provider()196def sqs():197 from localstack.services.sqs import sqs_listener, sqs_starter198 return Service(199 "sqs",200 listener=sqs_listener.UPDATE_SQS,201 start=sqs_starter.start_sqs,202 check=sqs_starter.check_sqs,203 )204@aws_provider(api="sqs", name="asf")205def sqs_asf():206 from localstack.aws.proxy import AwsApiListener207 from localstack.services.sqs.provider import SqsProvider208 provider = SqsProvider()209 return Service("sqs", listener=AwsApiListener("sqs", provider), lifecycle_hook=provider)210@aws_provider()211def ssm():212 from localstack.services.moto import MotoFallbackDispatcher213 from localstack.services.ssm.provider import SsmProvider214 provider = SsmProvider()215 return Service(216 "ssm",217 listener=AwsApiListener("ssm", MotoFallbackDispatcher(provider)),218 )219@aws_provider()220def events():221 from localstack.services.events.provider import EventsProvider222 from localstack.services.moto import MotoFallbackDispatcher223 provider = EventsProvider()224 return Service(225 "events",226 listener=AwsApiListener("events", MotoFallbackDispatcher(provider)),227 )228@aws_provider()229def stepfunctions():230 from localstack.services.stepfunctions.provider import StepFunctionsApiListener231 listener = StepFunctionsApiListener()232 return Service(233 "stepfunctions",234 listener=listener,235 lifecycle_hook=listener.provider,236 )237@aws_provider()238def swf():239 from localstack.services.moto import MotoFallbackDispatcher240 from localstack.services.swf.provider import SWFProvider241 provider = SWFProvider()242 return Service(243 "swf",244 listener=AwsApiListener("swf", MotoFallbackDispatcher(provider)),245 )246@aws_provider()247def resourcegroupstaggingapi():248 from localstack.services.moto import MotoFallbackDispatcher249 from localstack.services.resourcegroupstaggingapi.provider import (250 ResourcegroupstaggingapiProvider,251 )252 provider = ResourcegroupstaggingapiProvider()253 return Service(254 "resourcegroupstaggingapi",255 listener=AwsApiListener("resourcegroupstaggingapi", MotoFallbackDispatcher(provider)),256 )257@aws_provider(api="resource-groups")258def resource_groups():259 from localstack.services.moto import MotoFallbackDispatcher260 from localstack.services.resourcegroups.provider import ResourceGroupsProvider261 provider = ResourceGroupsProvider()262 return Service(263 "resource-groups",264 listener=AwsApiListener("resource-groups", MotoFallbackDispatcher(provider)),265 )266@aws_provider()267def support():268 from localstack.services.moto import MotoFallbackDispatcher269 from localstack.services.support.provider import SupportProvider270 provider = SupportProvider()271 return Service(272 "support",273 listener=AwsApiListener("support", MotoFallbackDispatcher(provider)),...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful