Best Python code snippet using localstack_python
provider.py
Source:provider.py
...79 tags: TagList = None,80 ) -> CreateFirewallRuleGroupResponse:81 """Create a Firewall Rule Group."""82 region_details = Route53ResolverBackend.get()83 id = get_route53_resolver_firewall_rule_group_id()84 arn = aws_stack.get_route53_resolver_firewall_rule_group_arn(id)85 firewall_rule_group = FirewallRuleGroup(86 Id=id,87 Arn=arn,88 Name=name,89 RuleCount=0,90 Status="COMPLETE",91 OwnerId=context.account_id,92 ShareStatus="NOT_SHARED",93 StatusMessage="Created Firewall Rule Group",94 CreatorRequestId=creator_request_id,95 CreationTime=datetime.now(timezone.utc).isoformat(),96 ModificationTime=datetime.now(timezone.utc).isoformat(),97 )...
utils.py
Source:utils.py
1from localstack.aws.api.route53resolver import ValidationException2from localstack.utils.aws import aws_stack3from localstack.utils.strings import get_random_hex4def get_route53_resolver_firewall_rule_group_id():5 return f"rslvr-frg-{get_random_hex(17)}"6def get_route53_resolver_firewall_domain_list_id():7 return f"rslvr-fdl-{get_random_hex(17)}"8def get_route53_resolver_firewall_rule_group_association_id():9 return f"rslvr-frgassoc-{get_random_hex(17)}"10def validate_priority(priority):11 # value of priority can be null in case of update12 if priority:13 if priority not in range(100, 9900):14 raise ValidationException(15 f"[RSLVR-02017] The priority value you provided is reserved. Provide a number between '100' and '9900'. Trace Id: '{aws_stack.get_trace_id()}'"16 )17def validate_mutation_protection(mutation_protection):18 if mutation_protection:...
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!!