Updating an AWS Cloud Map service - AWS Cloud Map

Updating an AWS Cloud Map service

To update a service, perform the following procedure.

AWS Management Console
  1. Sign in to the AWS Management Console and open the AWS Cloud Map console at https://console.aws.amazon.com/cloudmap/.

  2. In the navigation pane, choose Namespaces.

  3. On the Namespaces page, choose the namespace that you want to edit the service for.

  4. On the Namespace: namespace-name page, select the service you want to edit and click Edit.

  5. On the Service: service-name page, click Edit.

  6. On the Edit service page, enter the applicable values.

  7. Click Update service.

AWS CLI
  • Update a service with the update-service command (replace the red 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)
  1. If you don't already have Boto3 installed, you can find instructions for installing, configuring, and using Boto3 here.

  2. Import Boto3 and use servicediscovery as your service.

    import boto3 client = boto3.client('servicediscovery')
  3. Update a service with update_service() (replace the red 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" }