Deleting an AWS Cloud Map service
Before you can delete a service, you must deregister all service instances that were
registered using the service. For more information, see Deregistering an AWS Cloud Map service instance.
After deregistering all instances registered using the service, perform the following procedure to delete the service.
- AWS Management Console
-
Sign in to the AWS Management Console and open the AWS Cloud Map console at https://console.aws.amazon.com/cloudmap/.
-
In the navigation pane, choose Namespaces.
-
Choose the option for the namespace that contains the service that you want to
delete.
-
On the Namespace: namespace-name
page,
choose the option for the service that you want to delete.
-
Choose Delete.
-
Confirm that you want to delete the service.
- AWS CLI
-
- AWS SDK for Python (Boto3)
-
-
If you don't already have Boto3
installed, you can find instructions for
installing, configuring, and using Boto3
here.
-
Import Boto3
and use servicediscovery
as your service.
import boto3
client = boto3.client('servicediscovery')
-
Delete a service with delete_service()
(replace the
red
value with your own).
response = client.delete_service(
Id='srv-xxxxxx
',
)
# If you want to see the response
print(response)
Example response output
{
'ResponseMetadata': {
'...': '...',
},
}