How to use describe_vpc_endpoint_service_configurations method in localstack

Best Python code snippet using localstack_python

vpc_service_configuration.py

Source:vpc_service_configuration.py Github

copy

Full Screen

...54 tag_value = tag.get("Value")55 config.add_tag(tag_key, tag_value)56 self.configurations[config.id] = config57 return config58 def describe_vpc_endpoint_service_configurations(self, service_ids):59 """60 The Filters, MaxResults, NextToken parameters are not yet implemented61 """62 if service_ids:63 found_configs = []64 for service_id in service_ids:65 if service_id in self.configurations:66 found_configs.append(self.configurations[service_id])67 else:68 raise UnknownVpcEndpointService(service_id)69 return found_configs70 return self.configurations.values()71 def delete_vpc_endpoint_service_configurations(self, service_ids):72 missing = [s for s in service_ids if s not in self.configurations]73 for s in service_ids:74 self.configurations.pop(s, None)75 return missing76 def describe_vpc_endpoint_service_permissions(self, service_id):77 """78 The Filters, MaxResults, NextToken parameters are not yet implemented79 """80 config = self.describe_vpc_endpoint_service_configurations([service_id])[0]81 return config.principals82 def modify_vpc_endpoint_service_permissions(83 self, service_id, add_principals, remove_principals84 ):85 config = self.describe_vpc_endpoint_service_configurations([service_id])[0]86 config.principals += add_principals87 config.principals = [p for p in config.principals if p not in remove_principals]88 config.principals = list(set(config.principals))89 def modify_vpc_endpoint_service_configuration(90 self,91 service_id,92 acceptance_required,93 private_dns_name,94 add_network_lbs,95 remove_network_lbs,96 add_gateway_lbs,97 remove_gateway_lbs,98 ):99 """100 The following parameters are not yet implemented: RemovePrivateDnsName101 """102 config = self.describe_vpc_endpoint_service_configurations([service_id])[0]103 if private_dns_name is not None:104 config.private_dns_name = private_dns_name105 if acceptance_required is not None:106 config.acceptance_required = str(acceptance_required).lower() == "true"107 for lb in add_network_lbs:108 config.network_load_balancer_arns.append(lb)109 for lb in remove_network_lbs:110 config.network_load_balancer_arns.remove(lb)111 for lb in add_gateway_lbs:112 config.gateway_load_balancer_arns.append(lb)113 for lb in remove_gateway_lbs:...

Full Screen

Full Screen

vpc_endpoint_service.py

Source:vpc_endpoint_service.py Github

copy

Full Screen

1"""Resource for VPC Endpoint Services"""2from typing import Type3from botocore.client import BaseClient4from altimeter.aws.resource.resource_spec import ListFromAWSResult5from altimeter.aws.resource.ec2 import EC2ResourceSpec6from altimeter.core.graph.field.scalar_field import ScalarField, EmbeddedScalarField7from altimeter.core.graph.field.list_field import ListField, AnonymousListField8from altimeter.core.graph.field.tags_field import TagsField9from altimeter.core.graph.schema import Schema10class VpcEndpointServiceResourceSpec(EC2ResourceSpec):11 """Resource for VPC Endpoint Services"""12 type_name = "vpc-endpoint-service"13 schema = Schema(14 AnonymousListField("ServiceType", ScalarField("ServiceType")),15 ScalarField("ServiceName"),16 ScalarField("ServiceState"),17 ScalarField("AcceptanceRequired"),18 ListField("AvailabilityZones", EmbeddedScalarField()),19 TagsField(),20 )21 @classmethod22 def list_from_aws(23 cls: Type["VpcEndpointServiceResourceSpec"],24 client: BaseClient,25 account_id: str,26 region: str,27 ) -> ListFromAWSResult:28 """Return a dict of dicts of the format:29 {'vpc_endpoint_svc_1_arn': {vpc_endpoint_svc_1_dict},30 'vpc_endpoint_svc_2_arn': {vpc_endpoint_svc_2_dict},31 ...}32 Where the dicts represent results from describe_vpc_endpoint_service_configurations."""33 services = {}34 paginator = client.get_paginator("describe_vpc_endpoint_service_configurations")35 for resp in paginator.paginate():36 for service in resp.get("ServiceConfigurations", []):37 resource_arn = cls.generate_arn(38 account_id=account_id, region=region, resource_id=service["ServiceId"]39 )40 services[resource_arn] = service...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful