Best Python code snippet using localstack_python
ec2.py
Source: ec2.py
...170 VpnGatewayId=vpngwid,171 DryRun=noop,172 Options=options173 )174 def create_vpn_connection_route(self, cidr, vpnid):175 self.ec2Client.create_vpn_connection_route(176 DestinationCidrBlock=cidr,177 VpnConnectionId=vpnid178 )179 def delete_vpn_connection(self, vpnid, noop=False):180 self.ec2Client.delete_vpn_connection(181 VpnConnectionId=vpnid,182 DryRun=noop183 )184 def delete_vpn_connection_route(self, cidr, vpnid):185 self.ec2Client.delete_vpn_connection_route(186 DestinationCidrBlock=cidr,187 VpnConnectionId=vpnid188 )189 def delete_vpn_gateway(self, vpngwid, noop=False):...
vpn.py
Source: vpn.py
...103 vpnConnectionId = kwargs['vpnConnectionId']104 except KeyError as e:105 raise ArguementError(_requiredArgs, vpnConnection.createVpnRoute.__name__)106 try:107 vpnCreationResp = self.ec2Client.create_vpn_connection_route(VpnConnectionId=vpnConnectionId,108 DestinationCidrBlock=customerCidrBlock)109 except Exception as e:110 raise AwsError(boto3Api="create_vpn_connection_route", error=e)111 self.log.info("Created vpn connection route")112 return True113 def getCustomerConfigInfo(self, **kwargs):114 _requiredArgs = ['vpnConnectionId']115 try:116 vpnConnectionId = kwargs['vpnConnectionId']117 except KeyError as e:118 raise ArguementError(_requiredArgs, vpnConnection.getCustomerConfigInfo.__name__)119 try:120 vpnDescribeResp = self.ec2Client.describe_vpn_connections(VpnConnectionIds=[vpnConnectionId])121 except Exception as e:...
vpn_connection.py
Source: vpn_connection.py
1# Copyright 2015 Isotoma Limited2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14from touchdown.core import argument, serializers15from touchdown.core.plan import Plan, Present16from touchdown.core.resource import Resource17from ..common import SimpleApply, SimpleDescribe, SimpleDestroy, TagsMixin18from .customer_gateway import CustomerGateway19from .vpc import VPC20from .vpn_gateway import VpnGateway21class VpnConnection(Resource):22 resource_name = "vpn_connection"23 name = argument.String(field="Name", group="tags")24 customer_gateway = argument.Resource(CustomerGateway, field="CustomerGatewayId")25 vpn_gateway = argument.Resource(VpnGateway, field="VpnGatewayId")26 type = argument.String(default="ipsec.1", choices=["ipsec.1"], field="Type")27 static_routes_only = argument.Boolean(28 default=True,29 field="Options",30 serializer=serializers.Dict(StaticRoutesOnly=serializers.Boolean()),31 )32 static_routes = argument.List()33 # FIXME: This should somehow be a list of argument.IPNetwork34 tags = argument.Dict()35 vpc = argument.Resource(VPC)36class Describe(SimpleDescribe, Plan):37 resource = VpnConnection38 service_name = "ec2"39 api_version = "2015-10-01"40 describe_action = "describe_vpn_connections"41 describe_envelope = "VpnConnections"42 key = "VpnConnectionId"43 def get_describe_filters(self):44 vpc = self.runner.get_plan(self.resource.vpc)45 if not vpc.resource_id:46 return None47 return {"Filters": [{"Name": "tag:Name", "Values": [self.resource.name]}]}48class Apply(TagsMixin, SimpleApply, Describe):49 create_action = "create_vpn_connection"50 waiter = "vpn_connection_available"51 signature = (Present("name"), Present("vpn_gateway"), Present("customer_gateway"))52 def update_object(self):53 remote_routes = set(54 r["DestinationCidrBlock"]55 for r in self.object.get("Routes", [])56 if r["State"] != "deleted"57 )58 local_routes = set(self.resource.static_routes)59 for route in local_routes.difference(remote_routes):60 yield self.generic_action(61 "Add missing route {}".format(route),62 self.client.create_vpn_connection_route,63 VpnConnectionId=serializers.Identifier(),64 DestinationCidrBlock=route,65 )66 for route in remote_routes.difference(local_routes):67 yield self.generic_action(68 "Remove stale route {}".format(route),69 self.client.create_vpn_connection_route,70 VpnConnectionId=serializers.Identifier(),71 DestinationCidrBlock=route,72 )73class Destroy(SimpleDestroy, Describe):74 destroy_action = "delete_vpn_connection"...
Check out the latest blogs from LambdaTest on this topic:
The fact is not alien to us anymore that cross browser testing is imperative to enhance your application’s user experience. Enhanced knowledge of popular and highly acclaimed testing frameworks goes a long way in developing a new app. It holds more significance if you are a full-stack developer or expert programmer.
QA testers have a unique role and responsibility to serve the customer. Serving the customer in software testing means protecting customers from application defects, failures, and perceived failures from missing or misunderstood requirements. Testing for known requirements based on documentation or discussion is the core of the testing profession. One unique way QA testers can both differentiate themselves and be innovative occurs when senseshaping is used to improve the application user experience.
Having a good web design can empower business and make your brand stand out. According to a survey by Top Design Firms, 50% of users believe that website design is crucial to an organization’s overall brand. Therefore, businesses should prioritize website design to meet customer expectations and build their brand identity. Your website is the face of your business, so it’s important that it’s updated regularly as per the current web design trends.
Enterprise resource planning (ERP) is a form of business process management software—typically a suite of integrated applications—that assists a company in managing its operations, interpreting data, and automating various back-office processes. The introduction of a new ERP system is analogous to the introduction of a new product into the market. If the product is not handled appropriately, it will fail, resulting in significant losses for the business. Most significantly, the employees’ time, effort, and morale would suffer as a result of the procedure.
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!!