Best Python code snippet using localstack_python
client.pyi
Source:client.pyi
...148 def exceptions(self) -> Exceptions:149 """150 Route53ResolverClient exceptions.151 """152 def associate_firewall_rule_group(153 self,154 *,155 CreatorRequestId: str,156 FirewallRuleGroupId: str,157 VpcId: str,158 Priority: int,159 Name: str,160 MutationProtection: MutationProtectionStatusType = None,161 Tags: List["TagTypeDef"] = None162 ) -> AssociateFirewallRuleGroupResponseTypeDef:163 """164 Associates a FirewallRuleGroup with a VPC, to provide DNS filtering for the165 VPC.166 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.associate_firewall_rule_group)167 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#associate_firewall_rule_group)168 """169 def associate_resolver_endpoint_ip_address(170 self, *, ResolverEndpointId: str, IpAddress: "IpAddressUpdateTypeDef"171 ) -> AssociateResolverEndpointIpAddressResponseTypeDef:172 """173 Adds IP addresses to an inbound or an outbound Resolver endpoint.174 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.associate_resolver_endpoint_ip_address)175 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#associate_resolver_endpoint_ip_address)176 """177 def associate_resolver_query_log_config(178 self, *, ResolverQueryLogConfigId: str, ResourceId: str179 ) -> AssociateResolverQueryLogConfigResponseTypeDef:180 """181 Associates an Amazon VPC with a specified query logging configuration.182 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.associate_resolver_query_log_config)183 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#associate_resolver_query_log_config)184 """185 def associate_resolver_rule(186 self, *, ResolverRuleId: str, VPCId: str, Name: str = None187 ) -> AssociateResolverRuleResponseTypeDef:188 """189 Associates a Resolver rule with a VPC.190 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.associate_resolver_rule)191 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#associate_resolver_rule)192 """193 def can_paginate(self, operation_name: str) -> bool:194 """195 Check if an operation can be paginated.196 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.can_paginate)197 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#can_paginate)198 """199 def close(self) -> None:200 """201 Closes underlying endpoint connections.202 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.close)203 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#close)204 """205 def create_firewall_domain_list(206 self, *, CreatorRequestId: str, Name: str, Tags: List["TagTypeDef"] = None207 ) -> CreateFirewallDomainListResponseTypeDef:208 """209 Creates an empty firewall domain list for use in DNS Firewall rules.210 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.create_firewall_domain_list)211 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#create_firewall_domain_list)212 """213 def create_firewall_rule(214 self,215 *,216 CreatorRequestId: str,217 FirewallRuleGroupId: str,218 FirewallDomainListId: str,219 Priority: int,220 Action: ActionType,221 Name: str,222 BlockResponse: BlockResponseType = None,223 BlockOverrideDomain: str = None,224 BlockOverrideDnsType: Literal["CNAME"] = None,225 BlockOverrideTtl: int = None226 ) -> CreateFirewallRuleResponseTypeDef:227 """228 Creates a single DNS Firewall rule in the specified rule group, using the229 specified domain list.230 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.create_firewall_rule)231 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#create_firewall_rule)232 """233 def create_firewall_rule_group(234 self, *, CreatorRequestId: str, Name: str, Tags: List["TagTypeDef"] = None235 ) -> CreateFirewallRuleGroupResponseTypeDef:236 """237 Creates an empty DNS Firewall rule group for filtering DNS network traffic in a238 VPC.239 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.create_firewall_rule_group)240 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#create_firewall_rule_group)241 """242 def create_resolver_endpoint(243 self,244 *,245 CreatorRequestId: str,246 SecurityGroupIds: List[str],247 Direction: ResolverEndpointDirectionType,248 IpAddresses: List["IpAddressRequestTypeDef"],249 Name: str = None,250 Tags: List["TagTypeDef"] = None251 ) -> CreateResolverEndpointResponseTypeDef:252 """253 Creates a Resolver endpoint.254 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.create_resolver_endpoint)255 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#create_resolver_endpoint)256 """257 def create_resolver_query_log_config(258 self,259 *,260 Name: str,261 DestinationArn: str,262 CreatorRequestId: str,263 Tags: List["TagTypeDef"] = None264 ) -> CreateResolverQueryLogConfigResponseTypeDef:265 """266 Creates a Resolver query logging configuration, which defines where you want267 Resolver to save DNS query logs that originate in your VPCs.268 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.create_resolver_query_log_config)269 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#create_resolver_query_log_config)270 """271 def create_resolver_rule(272 self,273 *,274 CreatorRequestId: str,275 RuleType: RuleTypeOptionType,276 DomainName: str,277 Name: str = None,278 TargetIps: List["TargetAddressTypeDef"] = None,279 ResolverEndpointId: str = None,280 Tags: List["TagTypeDef"] = None281 ) -> CreateResolverRuleResponseTypeDef:282 """283 For DNS queries that originate in your VPCs, specifies which Resolver endpoint284 the queries pass through, one domain name that you want to forward to your285 network, and the IP addresses of the DNS resolvers in your network.286 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.create_resolver_rule)287 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#create_resolver_rule)288 """289 def delete_firewall_domain_list(290 self, *, FirewallDomainListId: str291 ) -> DeleteFirewallDomainListResponseTypeDef:292 """293 Deletes the specified domain list.294 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.delete_firewall_domain_list)295 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#delete_firewall_domain_list)296 """297 def delete_firewall_rule(298 self, *, FirewallRuleGroupId: str, FirewallDomainListId: str299 ) -> DeleteFirewallRuleResponseTypeDef:300 """301 Deletes the specified firewall rule.302 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.delete_firewall_rule)303 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#delete_firewall_rule)304 """305 def delete_firewall_rule_group(306 self, *, FirewallRuleGroupId: str307 ) -> DeleteFirewallRuleGroupResponseTypeDef:308 """309 Deletes the specified firewall rule group.310 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.delete_firewall_rule_group)311 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#delete_firewall_rule_group)312 """313 def delete_resolver_endpoint(314 self, *, ResolverEndpointId: str315 ) -> DeleteResolverEndpointResponseTypeDef:316 """317 Deletes a Resolver endpoint.318 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.delete_resolver_endpoint)319 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#delete_resolver_endpoint)320 """321 def delete_resolver_query_log_config(322 self, *, ResolverQueryLogConfigId: str323 ) -> DeleteResolverQueryLogConfigResponseTypeDef:324 """325 Deletes a query logging configuration.326 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.delete_resolver_query_log_config)327 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#delete_resolver_query_log_config)328 """329 def delete_resolver_rule(self, *, ResolverRuleId: str) -> DeleteResolverRuleResponseTypeDef:330 """331 Deletes a Resolver rule.332 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.delete_resolver_rule)333 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#delete_resolver_rule)334 """335 def disassociate_firewall_rule_group(336 self, *, FirewallRuleGroupAssociationId: str337 ) -> DisassociateFirewallRuleGroupResponseTypeDef:338 """339 Disassociates a FirewallRuleGroup from a VPC, to remove DNS filtering from the340 VPC.341 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.disassociate_firewall_rule_group)342 [Show boto3-stubs documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_route53resolver/client.html#disassociate_firewall_rule_group)343 """344 def disassociate_resolver_endpoint_ip_address(345 self, *, ResolverEndpointId: str, IpAddress: "IpAddressUpdateTypeDef"346 ) -> DisassociateResolverEndpointIpAddressResponseTypeDef:347 """348 Removes IP addresses from an inbound or an outbound Resolver endpoint.349 [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/1.24.58/reference/services/route53resolver.html#Route53Resolver.Client.disassociate_resolver_endpoint_ip_address)...
provider.py
Source:provider.py
...330 firewall_rule["Name"] = name331 return UpdateFirewallRuleResponse(332 FirewallRule=firewall_rule,333 )334 def associate_firewall_rule_group(335 self,336 context: RequestContext,337 creator_request_id: CreatorRequestId,338 firewall_rule_group_id: ResourceId,339 vpc_id: ResourceId,340 priority: Priority,341 name: Name,342 mutation_protection: MutationProtectionStatus = None,343 tags: TagList = None,344 ) -> AssociateFirewallRuleGroupResponse:345 """Associate a firewall rule group with a VPC."""346 region_details = Route53ResolverBackend.get()347 validate_priority(priority=priority)348 validate_mutation_protection(mutation_protection=mutation_protection)349 for (350 firewall_rule_group_association351 ) in region_details.firewall_rule_group_associations.values():352 if (353 firewall_rule_group_association.get("VpcId") == vpc_id354 and firewall_rule_group_association.get("FirewallRuleGroupId")355 == firewall_rule_group_id356 ):357 raise ValidationException(358 f"[RSLVR-02302] This DNS Firewall rule group can't be associated to a VPC: '{vpc_id}'. It is already associated to VPC '{firewall_rule_group_id}'. Try again with another VPC or DNS Firewall rule group. Trace Id: '{aws_stack.get_trace_id()}'"359 )360 id = get_route53_resolver_firewall_rule_group_association_id()361 arn = aws_stack.get_route53_resolver_firewall_rule_group_associations_arn(id)362 firewall_rule_group_association = FirewallRuleGroupAssociation(363 Id=id,364 Arn=arn,365 FirewallRuleGroupId=firewall_rule_group_id,366 VpcId=vpc_id,367 Name=name,368 Priority=priority,369 MutationProtection=mutation_protection or "DISABLED",370 Status="COMPLETE",371 StatusMessage="Creating Firewall Rule Group Association",372 CreatorRequestId=creator_request_id,373 CreationTime=datetime.now(timezone.utc).isoformat(),374 ModificationTime=datetime.now(timezone.utc).isoformat(),375 )376 region_details.firewall_rule_group_associations[id] = firewall_rule_group_association377 moto_route53resolver_backends[context.region].tagger.tag_resource(arn, tags or [])378 return AssociateFirewallRuleGroupResponse(379 FirewallRuleGroupAssociation=firewall_rule_group_association380 )381 def disassociate_firewall_rule_group(382 self, context: RequestContext, firewall_rule_group_association_id: ResourceId383 ) -> DisassociateFirewallRuleGroupResponse:384 """Disassociate a DNS Firewall rule group from a VPC."""385 firewall_rule_group_association: FirewallRuleGroupAssociation = (386 delete_firewall_rule_group_association(firewall_rule_group_association_id)387 )388 return DisassociateFirewallRuleGroupResponse(389 FirewallRuleGroupAssociation=firewall_rule_group_association390 )391 def get_firewall_rule_group_association(392 self, context: RequestContext, firewall_rule_group_association_id: ResourceId393 ) -> GetFirewallRuleGroupAssociationResponse:394 """Returns the Firewall Rule Group Association that you specified."""395 firewall_rule_group_association: FirewallRuleGroupAssociation = (...
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!!