in python/vpce/modify_vpce_service_configuration_sample.py [0:0]
def modify_vpce_service_acceptance(service_id, accept=True):
"""
Allows to either accept (True) or reject(False) requests to
create an endpoint to the service.
Accepts
- service_id: Service id.
- accept (bool): True|False: Default is True (accept)
Usage:
- modify_vpce_service_acceptance('service1', True, True, db_dict)
- modify_vpce_service_acceptance('service-xxxx', False)
"""
logging.info(f"Changing AcceptaneRequired to {accept} for"
f" VPCE Service:")
try:
response = ec2.modify_vpc_endpoint_service_configuration(
ServiceId=service_id,
AcceptanceRequired=accept
)
return response
except ClientError as e:
logging.error(e)
return None