Best Python code snippet using localstack_python
aws_stack.py
Source:aws_stack.py
...340 return parts[6]341def state_machine_arn(name, account_id=None, region_name=None):342 pattern = 'arn:aws:states:%s:%s:stateMachine:%s'343 return _resource_arn(name, pattern, account_id=account_id, region_name=region_name)344def stepfunctions_activity_arn(name, account_id=None, region_name=None):345 pattern = 'arn:aws:states:%s:%s:activity:%s'346 return _resource_arn(name, pattern, account_id=account_id, region_name=region_name)347def fix_arn(arn):348 """ Function that attempts to "canonicalize" the given ARN. This includes converting349 resource names to ARNs, replacing incorrect regions, account IDs, etc. """350 if arn.startswith('arn:aws:lambda'):351 parts = arn.split(':')352 region = parts[3] if parts[3] in config.VALID_REGIONS else get_region()353 return lambda_function_arn(lambda_function_name(arn), region_name=region)354 LOG.warning('Unable to fix/canonicalize ARN: %s' % arn)355 return arn356def cognito_user_pool_arn(user_pool_id, account_id=None, region_name=None):357 pattern = 'arn:aws:cognito-idp:%s:%s:userpool/%s'358 return _resource_arn(user_pool_id, pattern, account_id=account_id, region_name=region_name)...
cloudformation_starter.py
Source:cloudformation_starter.py
...52 if isinstance(resource, lambda_models.LambdaFunction):53 func_arn = aws_stack.lambda_function_arn(resource.function_name)54 resource.function_arn = resource.physical_resource_id = func_arn55 elif isinstance(resource, service_models.StepFunctionsActivity):56 act_arn = aws_stack.stepfunctions_activity_arn(resource.params.get("Name"))57 resource.physical_resource_id = act_arn58 elif isinstance(resource, kinesis_models.Stream):59 resource.physical_resource_id = resource.stream_name60 elif isinstance(resource, logs.LogsLogGroup):61 resource.physical_resource_id = resource.params.get("LogGroupName")62 elif isinstance(resource, kinesisfirehose.FirehoseDeliveryStream):63 resource.physical_resource_id = resource.params.get("DeliveryStreamName")64 elif isinstance(resource, secretsmanager.SecretsManagerSecret):65 resource.physical_resource_id = resource.params.get("Name")66 elif isinstance(resource, events.EventsRule):67 resource.physical_resource_id = resource.params.get("Name")68 elif isinstance(resource, elasticsearch.ElasticsearchDomain):69 resource.physical_resource_id = resource.params.get("DomainName")70 elif isinstance(resource, secretsmanager.SecretsManagerSecret):...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!