Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

RegisterTargetWithMaintenanceWindow

Registers a target with a Maintenance Window.

Request Syntax

{
   "ClientToken": "string",
   "Description": "string",
   "Name": "string",
   "OwnerInformation": "string",
   "ResourceType": "string",
   "Targets": [ 
      { 
         "Key": "string",
         "Values": [ "string" ]
      }
   ],
   "WindowId": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ClientToken

User-provided idempotency token.

Type: String

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

Required: No

Description

An optional description for the target.

Type: String

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

Required: No

Name

An optional name for the target.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 128.

Pattern: ^[a-zA-Z0-9_\-.]{3,128}$

Required: No

OwnerInformation

User-provided value that will be included in any CloudWatch events raised while running tasks for these targets in this Maintenance Window.

Type: String

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

Required: No

ResourceType

The type of target being registered with the Maintenance Window.

Type: String

Valid Values: INSTANCE

Required: Yes

Targets

The targets (either instances or tags). Instances are specified using Key=instanceids,Values=<instanceid1>,<instanceid2>. Tags are specified using Key=<tag name>,Values=<tag value>.

Type: Array of Target objects

Array Members: Minimum number of 0 items. Maximum number of 5 items.

Required: Yes

WindowId

The ID of the Maintenance Window the target should be registered with.

Type: String

Length Constraints: Fixed length of 20.

Pattern: ^mw-[0-9a-f]{17}$

Required: Yes

Response Syntax

{
   "WindowTargetId": "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.

WindowTargetId

The ID of the target definition in this Maintenance Window.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

Errors

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

DoesNotExistException

Error returned when the ID specified for a resource (e.g. a Maintenance Window) doesn't exist.

HTTP Status Code: 400

IdempotentParameterMismatch

Error returned when an idempotent operation is retried and the parameters don't match the original call to the API with the same idempotency token.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

ResourceLimitExceededException

Error returned when the caller has exceeded the default resource limits (e.g. too many Maintenance Windows have been created).

HTTP Status Code: 400

See Also

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