Best Python code snippet using localstack_python
vpc_description.py
Source: vpc_description.py
1from __future__ import absolute_import2import boto33import datetime4import splunksdc.log as logging5import splunk_ta_aws.common.ta_aws_consts as tac6from . import description as desc7logger = logging.get_module_logger()8CREDENTIAL_THRESHOLD=datetime.timedelta(minutes=20)9def get_vpc_conn(config):10 return desc.BotoRetryWrapper(boto_client=boto3.client(11 'ec2',12 region_name=config[tac.region],13 aws_access_key_id=config[tac.key_id],14 aws_secret_access_key=config[tac.secret_key],15 aws_session_token=config.get('aws_session_token')16 ))17@desc.generate_credentials18@desc.decorate19def vpcs(config):20 vpc_conn = get_vpc_conn(config)21 paginator = vpc_conn.get_paginator('describe_vpcs')22 for page in paginator.paginate():23 for vpc in page.get('Vpcs', []):24 yield vpc25 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)26@desc.generate_credentials27@desc.decorate28def vpc_subnets(config):29 vpc_conn = get_vpc_conn(config)30 paginator = vpc_conn.get_paginator('describe_subnets')31 for page in paginator.paginate():32 for subnet in page.get('Subnets', []):33 yield subnet34 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)35@desc.generate_credentials36@desc.decorate37def vpc_network_acls(config):38 vpc_conn = get_vpc_conn(config)39 paginator = vpc_conn.get_paginator('describe_network_acls')40 for page in paginator.paginate():41 for network_acl in page.get('NetworkAcls', []):42 yield network_acl43 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)44@desc.generate_credentials45@desc.decorate46def vpn_gateways(config):47 vpc_conn = get_vpc_conn(config)48 res = vpc_conn.describe_vpn_gateways()49 50 for vpn_gateway in res.get('VpnGateways', []):51 yield vpn_gateway52@desc.generate_credentials53@desc.decorate54def internet_gateways(config):55 vpc_conn = get_vpc_conn(config)56 paginator = vpc_conn.get_paginator('describe_internet_gateways')57 for page in paginator.paginate():58 for internet_gateway in page.get('InternetGateways', []):59 yield internet_gateway60 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)61@desc.generate_credentials62@desc.decorate63def customer_gateways(config):64 vpc_conn = get_vpc_conn(config)65 res = vpc_conn.describe_customer_gateways()66 for customer_gateway in res.get('CustomerGateways', []):67 yield customer_gateway68@desc.generate_credentials69@desc.decorate70def nat_gateways(config):71 vpc_conn = get_vpc_conn(config)72 paginator = vpc_conn.get_paginator('describe_nat_gateways')73 for page in paginator.paginate():74 for nat_gateway in page.get('NatGateways', []):75 yield nat_gateway76 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)77@desc.generate_credentials78@desc.decorate79def local_gateways(config):80 vpc_conn = get_vpc_conn(config)81 paginator = vpc_conn.get_paginator('describe_local_gateways')82 for page in paginator.paginate():83 for local_gateway in page.get('LocalGateways', []):84 yield local_gateway85 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)86@desc.generate_credentials87@desc.decorate88def carrier_gateways(config):89 vpc_conn = get_vpc_conn(config)90 paginator = vpc_conn.get_paginator('describe_carrier_gateways')91 for page in paginator.paginate():92 for carrier_gateway in page.get('CarrierGateways', []):93 yield carrier_gateway94 desc.refresh_credentials(config,CREDENTIAL_THRESHOLD,vpc_conn)95@desc.generate_credentials96@desc.decorate97def transit_gateways(config):98 vpc_conn = get_vpc_conn(config)99 paginator = vpc_conn.get_paginator('describe_transit_gateways')100 for page in paginator.paginate():101 for transit_gateway in page.get('TransitGateways', []):102 yield transit_gateway...
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!!