UpdateMonitor - Amazon CloudWatch Internet Monitor
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

UpdateMonitor

Updates a monitor. You can update a monitor to change the percentage of traffic to monitor or the maximum number of city-networks (locations and ASNs), to add or remove resources, or to change the status of the monitor. Note that you can't change the name of a monitor.

The city-network maximum that you choose is the limit, but you only pay for the number of city-networks that are actually monitored. For more information, see Choosing a city-network maximum value in the Amazon CloudWatch User Guide.

Request Syntax

PATCH /v20210603/Monitors/MonitorName HTTP/1.1 Content-type: application/json { "ClientToken": "string", "HealthEventsConfig": { "AvailabilityLocalHealthEventsConfig": { "HealthScoreThreshold": number, "MinTrafficImpact": number, "Status": "string" }, "AvailabilityScoreThreshold": number, "PerformanceLocalHealthEventsConfig": { "HealthScoreThreshold": number, "MinTrafficImpact": number, "Status": "string" }, "PerformanceScoreThreshold": number }, "InternetMeasurementsLogDelivery": { "S3Config": { "BucketName": "string", "BucketPrefix": "string", "LogDeliveryStatus": "string" } }, "MaxCityNetworksToMonitor": number, "ResourcesToAdd": [ "string" ], "ResourcesToRemove": [ "string" ], "Status": "string", "TrafficPercentageToMonitor": number }

URI Request Parameters

The request uses the following URI parameters.

MonitorName

The name of the monitor.

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

ClientToken

A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client token for other API requests.

Type: String

Required: No

HealthEventsConfig

The list of health score thresholds. A threshold percentage for health scores, along with other configuration information, determines when Internet Monitor creates a health event when there's an internet issue that affects your application end users.

For more information, see Change health event thresholds in the Internet Monitor section of the CloudWatch User Guide.

Type: HealthEventsConfig object

Required: No

InternetMeasurementsLogDelivery

Publish internet measurements for Internet Monitor to another location, such as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch Logs.

Type: InternetMeasurementsLogDelivery object

Required: No

MaxCityNetworksToMonitor

The maximum number of city-networks to monitor for your application. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. Setting this limit can help control billing costs.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 500000.

Required: No

ResourcesToAdd

The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, or Amazon WorkSpaces directories.

You can add a combination of VPCs and CloudFront distributions, or you can add WorkSpaces directories, or you can add NLBs. You can't add NLBs or WorkSpaces directories together with any other resources.

Note

If you add only Amazon Virtual Private Clouds resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.

Type: Array of strings

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*

Required: No

ResourcesToRemove

The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).

Type: Array of strings

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*

Required: No

Status

The status for a monitor. The accepted values for Status with the UpdateMonitor API call are the following: ACTIVE and INACTIVE. The following values are not accepted: PENDING, and ERROR.

Type: String

Valid Values: PENDING | ACTIVE | INACTIVE | ERROR

Required: No

TrafficPercentageToMonitor

The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.

To learn more, see Choosing an application traffic percentage to monitor in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "MonitorArn": "string", "Status": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

MonitorArn

The Amazon Resource Name (ARN) of the monitor.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 512.

Pattern: arn:.*

Status

The status of a monitor.

Type: String

Valid Values: PENDING | ACTIVE | INACTIVE | ERROR

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have sufficient permission to perform this action.

HTTP Status Code: 403

InternalServerException

An internal error occurred.

HTTP Status Code: 500

LimitExceededException

The request exceeded a service quota.

HTTP Status Code: 403

ResourceNotFoundException

The request specifies a resource that doesn't exist.

HTTP Status Code: 404

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429

ValidationException

Invalid request.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: