How to use modify_vpc_endpoint_service_permissions method in localstack

Best Python code snippet using localstack_python

vpc_service_configuration.py

Source:vpc_service_configuration.py Github

copy

Full Screen

...59 add_gateway_lbs=add_gateway_lbs,60 remove_gateway_lbs=remove_gateway_lbs,61 )62 return MODIFY_VPC_ENDPOINT_SERVICE_CONFIGURATION63 def modify_vpc_endpoint_service_permissions(self):64 service_id = self._get_param("ServiceId")65 add_principals = self._get_multi_param("AddAllowedPrincipals")66 remove_principals = self._get_multi_param("RemoveAllowedPrincipals")67 self.ec2_backend.modify_vpc_endpoint_service_permissions(68 service_id, add_principals, remove_principals69 )70 return MODIFY_VPC_ENDPOINT_SERVICE_PERMISSIONS71CREATE_VPC_ENDPOINT_SERVICE_CONFIGURATION = """72<CreateVpcEndpointServiceConfigurationResult xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">73 <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>74 <serviceConfiguration>75 <serviceType>76 <item><serviceType>{{ config.service_type }}</serviceType></item>77 </serviceType>78 <serviceId>{{ config.id }}</serviceId>79 <serviceName>{{ config.service_name }}</serviceName>80 <serviceState>{{ config.service_state }}</serviceState>81 <availabilityZoneSet>...

Full Screen

Full Screen

modify_vpce_service_permissions_sample.py

Source:modify_vpce_service_permissions_sample.py Github

copy

Full Screen

...31 """32 logging.info(f"Removing {principal_arns} from VPCE Service: {service_id}")33 try:34 if add_remove == 'add':35 response = ec2.modify_vpc_endpoint_service_permissions(36 ServiceId=service_id,37 AddAllowedPrincipals=principal_arns38 )39 elif add_remove == 'remove':40 response = ec2.modify_vpc_endpoint_service_permissions(41 ServiceId=service_id,42 RemoveAllowedPrincipals=principal_arns43 )44 return response45 except ClientError as e:46 logging.error(e)47 return None48def main():49 """50 Adds/Removes AWS Principal to a VPC Endpoint Service (VPC-E Service)51 Accepts: service_id, principal_arns, add_remove52 --service_id: VPC-E Service id53 --principal_arns: iam_user1_arn54 --remove: remove arns...

Full Screen

Full Screen

addRoleToEndpointService.py

Source:addRoleToEndpointService.py Github

copy

Full Screen

...22except ClientError as err:23 print(err.response['Error'])24for serviceEndpoint in serviceEndpoints:25 endpointDNS = serviceEndpoint['Service_Endpoint_DNS']26 #response = ec2Client.modify_vpc_endpoint_service_permissions(27 response = ec2Client.describe_vpc_endpoint_services(28 ServiceNames=[29 endpointDNS,30 ]31 )32 for service in response['ServiceDetails']:33 serviceId = service['ServiceId']34 response = ec2Client.modify_vpc_endpoint_service_permissions(35 DryRun=False,36 ServiceId=serviceId,37 AddAllowedPrincipals=[38 remote_user_arn,39 ] 40 )...

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