Updating an AWS Cloud Map service
To update a service, perform the following procedure.
- 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.
-
On the Namespaces page, choose the namespace that you want to edit the service for.
-
On the Namespace:
namespace-name
page, select the service you want to edit and click Edit. -
On the Service:
service-name
page, click Edit. -
On the Edit service page, enter the applicable values.
-
Click Update service.
- AWS CLI
-
-
Update a service with the
update-service
command (replace thered
value with your own).aws servicediscovery update-service \ --id
srv-xxxxxxxxxxx
\ --service "Description=new description
,DnsConfig={DnsRecords=[{Type=A,TTL=60
}]}"Output:
{ "OperationId": "l3pfx7f4ynndrbj3cfq5fm2qy2z37bms-5m6iaoty" }
-
- AWS SDK for Python (Boto3)
-
-
If you don't already have
Boto3
installed, you can find instructions for installing, configuring, and usingBoto3
here. -
Import
Boto3
and useservicediscovery
as your service.import boto3 client = boto3.client('servicediscovery')
-
Update a service with
update_service()
(replace thered
value with your own).response = client.update_service( Id='
srv-xxxxxxxxxxx
', Service={ 'DnsConfig': { 'DnsRecords': [ { 'TTL':300
, 'Type': 'A', }, ], }, 'Description': "new description
", } )Example response output
{ "OperationId": "l3pfx7f4ynndrbj3cfq5fm2qy2z37bms-5m6iaoty" }
-