Delete a service environment in AWS Batch
You can delete a service environment when it's no longer needed for your SageMaker Training jobs. Deleting a service environment removes the configuration and prevents further job submissions. Before deleting a service environment, ensure that no active SageMaker Training jobs depend on it and that no job queues are associated with the service environment.
Important
Service environment deletion is irreversible. Once deleted, you cannot recover the service environment or its configuration. If you need similar functionality in the future, you must create a new service environment with the required settings. Consider disabling the service environment instead of deletion if you may need to reactivate it later.
Note
Deleting all service environments in your account does not automatically remove the service-linked role created for AWS Batch and SageMaker AI integration. The service-linked role remains available for future service environment creation. If you want to remove the service-linked role, you must delete it separately using IAM after ensuring no service environments exist in your account.
Deletion prerequisites
Before you can delete a service environment you must disassociate any service job queue and then disable the service environment.
Before deleting a service environment:
-
Check active jobs - Ensure no SageMaker Training jobs are currently running through the service environment.
-
Review job queues - Identify job queues associated with the service environment and either associate the job queue with a different service environment or disable and delete the job queue.
Job queue management: Job queues that were associated with a deleted service environment can still exist but cannot process service jobs. You should either delete unused job queues or associate them with a different service environment before deleting the original service environment.