View a markdown version of this page

AssociateApplicationStatusCheck - Amazon Elastic Compute Cloud

AssociateApplicationStatusCheck

Associates an application status check with instances or tags. Once you create an association, health monitoring automatically begins for the specified instances or for instances that match the specified tags. The following rules apply:

  • You must specify either TargetTagAssociations or InstanceIds, but not both. Specifying both results in an InvalidParameterCombination error.

  • The application status check must already exist and belong to your account.

  • Tag keys must not be blank.

  • Maximum 50 tag associations per application status check.

  • Use DisassociateApplicationStatusCheck to remove associations.

  • When you associate tags, the application status check automatically monitors all current and future instances that have the specified tags.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

ApplicationStatusCheckId

The ID of the application status check to associate.

Type: String

Required: Yes

ClientToken

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

Type: String

Required: No

DryRun

Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

InstanceId.N

The IDs of the instances to associate with the application status check.

Type: Array of strings

Required: No

TargetTagAssociation.N

The tags to associate the application status check with. Each tag is a key-value pair. When you associate tags, the application status check automatically monitors all instances that have the specified tags.

Type: Array of CustomTagKeyValueRequestPair objects

Required: No

Response Elements

The following elements are returned by the service.

requestId

The ID of the request.

Type: String

successfulResultSet

The associations that were successfully created.

Type: Array of SuccessfulAssociationResponseObject objects

unsuccessfulResultSet

The associations that failed to be created.

Type: Array of UnsuccessfulAssociationResponseObject objects

Errors

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

Examples

To associate an application status check with instances

This example associates an application status check with the specified instance.

Sample Request

https://ec2.amazonaws.com/?Action=AssociateApplicationStatusCheck &ApplicationStatusCheckId=asc-0123456789abcdef0 &InstanceId.1=i-0123456789abcdef0 &AUTHPARAMS

Sample Response

<AssociateApplicationStatusCheckResult xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <successfulResultSet> <item> <applicationStatusCheckId>asc-0123456789abcdef0</applicationStatusCheckId> <associationType>instance</associationType> <associationValue>i-0123456789abcdef0</associationValue> </item> </successfulResultSet> </AssociateApplicationStatusCheckResult>

To associate an application status check with tags

The following example associates an application status check with instances that have the specified tag. All current and future instances with this tag are automatically monitored.

Sample Request

https://ec2.amazonaws.com/?Action=AssociateApplicationStatusCheck &ApplicationStatusCheckId=asc-0123456789abcdef0 &TargetTagAssociation.1.Key=environment &TargetTagAssociation.1.Value=production &AUTHPARAMS

Sample Response

<AssociateApplicationStatusCheckResult xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <successfulResultSet> <item> <applicationStatusCheckId>asc-0123456789abcdef0</applicationStatusCheckId> <associationType>tag</associationType> <associationValue>environment=production</associationValue> </item> </successfulResultSet> </AssociateApplicationStatusCheckResult>

See Also

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