Use DeleteVpcEndpoint with an AWS SDK - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DeleteVpcEndpoint with an AWS SDK

The following code example shows how to use DeleteVpcEndpoint.

PHP
SDK for PHP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * @param string $vpcEndpointId * @return void */ public function deleteVpcEndpoint(string $vpcEndpointId) { try { $this->ec2Client->deleteVpcEndpoints([ "VpcEndpointIds" => [$vpcEndpointId], ]); }catch (Ec2Exception $caught){ echo "There was a problem deleting the VPC Endpoint: {$caught->getAwsErrorMessage()}\n"; throw $caught; } }