associateApplicationStatusCheck
abstract suspend fun associateApplicationStatusCheck(input: AssociateApplicationStatusCheckRequest): AssociateApplicationStatusCheckResponse
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.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
DisassociateApplicationStatusCheckto remove associations.When you associate tags, the application status check automatically monitors all current and future instances that have the specified tags.
Samples
// This example associates an application status check with instances matching the specified tag.
val resp = ec2Client.associateApplicationStatusCheck {
applicationStatusCheckId = "asc-0123456789abcdef0"
targetTagAssociations = listOf<CustomTagKeyValueRequestPair>(
CustomTagKeyValueRequestPair {
key = "env"
value = "prod"
}
)
}Content copied to clipboard