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
TargetTagAssociationsorInstanceIds, but not both. Specifying both results in anInvalidParameterCombinationerror. -
You must own the application status check. The check must already exist in your account.
-
You must not leave tag keys blank.
-
You can create a maximum of 50 tag associations for each application status check.
-
You can use
DisassociateApplicationStatusCheckto remove associations. -
You can associate tags so that 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
-
A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same token, the service ignores the request but does not return an error. 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 isUnauthorizedOperation.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_ID</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>EC2TAG</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: