Best Python code snippet using localstack_python
provider.py
Source:provider.py
...182 """Update the domains in a Firewall Domain List."""183 region_details = Route53ResolverBackend.get()184 firewall_domain_list: FirewallDomainList = get_firewall_domain_list(firewall_domain_list_id)185 firewall_domain_list: FirewallDomainList = get_firewall_domain_list(firewall_domain_list_id)186 firewall_domains = get_firewall_domain(firewall_domain_list_id)187 if operation == FirewallDomainUpdateOperation.ADD:188 if not firewall_domains:189 region_details.firewall_domains[firewall_domain_list_id] = domains190 else:191 region_details.firewall_domains[firewall_domain_list_id].append(domains)192 if operation == FirewallDomainUpdateOperation.REMOVE:193 if firewall_domains:194 for domain in domains:195 if domain in firewall_domains:196 firewall_domains.remove(domain)197 else:198 raise ValidationException(199 f"[RSLVR-02502] The following domains don't exist in the DNS Firewall domain list '{firewall_domain_list_id}'. You can't delete a domain that isn't in a domain list. Example unknown domain: '{domain}'. Trace Id: '{aws_stack.get_trace_id()}'"200 )...
models.py
Source:models.py
...43 region_details = Route53ResolverBackend.get()44 firewall_rule_group_associations = get_firewall_rule_group_association(id)45 region_details.firewall_rule_group_associations.pop(id)46 return firewall_rule_group_associations47def get_firewall_domain(id):48 """returns firewall domain with the given id if it exists"""49 # firewall_domain can return none50 region_details = Route53ResolverBackend.get()51 firewall_domain = region_details.firewall_domains.get(id)52 return firewall_domain53def get_firewall_domain_list(id):54 """returns firewall domain list with the given id if it exists"""55 region_details = Route53ResolverBackend.get()56 firewall_domain_list = region_details.firewall_domain_lists.get(id)57 if not firewall_domain_list:58 raise ResourceNotFoundException(59 f"Can't find the resource with ID '{id}'. Trace Id: '{aws_stack.get_trace_id()}'"60 )61 return firewall_domain_list...
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!!