Skip to content

Can't delete SageMaker VPC

0

Got some unexpected charges related to Sagemaker and would like to delete all Sagemaker resources from my account, but can't seem to do so. Here is what I am trying:

Action: Delete VPC

Error: The VPC contains one or more in-use network interfaces The following 4 network interfaces must be deleted before this VPC can be deleted..

Action: Delete Network Interface

Error: Network interface is currently in use and is of type vpc_endpoint . Possible owning resource is..

Action: Delete VPC endpoint

Error: There was an error deleting your endpoints. Operation is not allowed for requester-managed VPC endpoints for the service com.amazonaws.vpce.us-east-1.vpce-svc-.....

4 Answers
0
Accepted Answer

Hello.

As described in the following document, if a VPC endpoint was created within the last 90 days, it is possible to investigate which AWS resources it is associated with using CloudTrail.
So, check CloudTrail and investigate the resources associated with the VPC endpoint.
Once you have identified the AWS resources associated with the VPC endpoint, you can delete them and the VPC endpoint will disappear as well.
https://repost.aws/knowledge-center/vpc-delete-requester-managed-endpoint

If the VPC endpoint does not disappear even after deleting the AWS resources associated with it, please contact AWS Support via "Account and billing."
"Account and billing" inquiries are free of charge.

EXPERT
answered 10 months ago
0

This is a common issue when trying to delete a VPC that has requester-managed resources associated with it, particularly with SageMaker services. The problem is that you can't directly delete these network interfaces or VPC endpoints because they're managed by AWS services.

To successfully delete your SageMaker VPC, you need to follow these steps:

  1. First, identify and delete all SageMaker resources that might be using this VPC. This includes:
  • SageMaker Studio domains
  • SageMaker projects
  • Any SageMaker endpoints
  • MLflow resources
  • HyperPod clusters
  • Any connections created in the data explorer
  1. If you were using SageMaker Unified Studio, ensure you've deleted the domain completely.

  2. Check for and delete any AWS Glue databases and Athena workgroups that might have been created by your SageMaker projects.

  3. Look for any S3 buckets associated with your SageMaker domain.

  4. After deleting these underlying SageMaker resources, wait for a few minutes. AWS should automatically clean up the associated VPC endpoints and network interfaces.

  5. Once all dependencies are removed, try deleting the VPC again.

The key is to focus on removing the underlying SageMaker services or resources that are creating these dependencies, rather than trying to delete the network interfaces or endpoints directly. After the SageMaker resources are properly deleted, AWS will automatically clean up the requester-managed endpoints and interfaces, allowing you to delete the VPC.

If you continue to face issues after following these steps, you may need to check for other AWS services that might be using the VPC or creating requester-managed resources.
Sources
Sagemaker Unified Studio | AWS re:Post
Unable to Delete VPC Due to Requester-Managed VPC Endpoint and Network Interface Dependencies | AWS re:Post
Can not delete VPC. Endpoint does not exist. | AWS re:Post

answered 10 months ago
0

Went through the list and from what I can see in the console I don't have any of these listed resources. This is a good business model for AWS.. maximum frustration until the customer gives up and just keeps paying for unwanted services.. lol

answered 10 months ago
0

Using CloudTrail I was able to find a Redshift resource. Not even sure what it is and how it got created, but after I deleted it I was able to delete the Sagemaker VPC.

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.