Best Python code snippet using localstack_python
provider.py
Source:provider.py
...97 )98 region_details.firewall_rule_groups[id] = firewall_rule_group99 moto_route53resolver_backends[context.region].tagger.tag_resource(arn, tags or [])100 return CreateFirewallRuleGroupResponse(FirewallRuleGroup=firewall_rule_group)101 def delete_firewall_rule_group(102 self, context: RequestContext, firewall_rule_group_id: ResourceId103 ) -> DeleteFirewallRuleGroupResponse:104 """Delete a Firewall Rule Group."""105 firewall_rule_group: FirewallRuleGroup = delete_firewall_rule_group(firewall_rule_group_id)106 return DeleteFirewallRuleGroupResponse(FirewallRuleGroup=firewall_rule_group)107 def get_firewall_rule_group(108 self, context: RequestContext, firewall_rule_group_id: ResourceId109 ) -> GetFirewallRuleGroupResponse:110 """Get the details of a Firewall Rule Group."""111 firewall_rule_group: FirewallRuleGroup = get_firewall_rule_group(firewall_rule_group_id)112 return GetFirewallRuleGroupResponse(FirewallRuleGroup=firewall_rule_group)113 def list_firewall_rule_groups(114 self, context: RequestContext, max_results: MaxResults = None, next_token: NextToken = None115 ) -> ListFirewallRuleGroupsResponse:116 """List Firewall Rule Groups."""117 region_details = Route53ResolverBackend.get()118 firewall_rule_groups = []119 for firewall_rule_group in region_details.firewall_rule_groups.values():...
models.py
Source:models.py
...20 raise ResourceNotFoundException(21 f"Can't find the resource with ID '{id}'. Trace Id: '{aws_stack.get_trace_id()}'"22 )23 return firewall_rule_group24def delete_firewall_rule_group(id):25 """deletes the firewall rule group with the given id"""26 # if firewall_rule_groups doesn't exist it will throw an error27 region_details = Route53ResolverBackend.get()28 firewall_rule_group = get_firewall_rule_group(id)29 region_details.firewall_rule_groups.pop(id)30 return firewall_rule_group31def get_firewall_rule_group_association(id):32 """returns firewall rule group association with the given id if it exists"""33 region_details = Route53ResolverBackend.get()34 firewall_rule_group_association = region_details.firewall_rule_group_associations.get(id)35 if not firewall_rule_group_association:36 raise ResourceNotFoundException(37 f"[RSLVR-02025] Can't find the resource with ID '{id}'. Trace Id: '{aws_stack.get_trace_id()}'"38 )...
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!!