EC2 / Client / associate_application_status_check
associate_application_status_check¶
- EC2.Client.associate_application_status_check(**kwargs)¶
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.
See also: AWS API Documentation
Request Syntax
response = client.associate_application_status_check( ApplicationStatusCheckId='string', TargetTagAssociations=[ { 'Key': 'string', 'Value': 'string' }, ], InstanceIds=[ 'string', ], ClientToken='string', DryRun=True|False )
- Parameters:
ApplicationStatusCheckId (string) –
[REQUIRED]
The ID of the application status check to associate.
TargetTagAssociations (list) –
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.
(dict) –
Describes a tag key-value pair for an application status check association request.
Key (string) –
The key of the tag.
Value (string) –
The value of the tag.
InstanceIds (list) –
The IDs of the instances to associate with the application status check.
(string) –
ClientToken (string) –
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.
This field is autopopulated if not provided.
DryRun (boolean) – 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.
- Return type:
dict
- Returns:
Response Syntax
{ 'SuccessfulResults': [ { 'ApplicationStatusCheckId': 'string', 'AssociationType': 'string', 'AssociationValue': 'string' }, ], 'UnsuccessfulResults': [ { 'ApplicationStatusCheckId': 'string', 'AssociationType': 'string', 'AssociationValue': 'string', 'Reason': 'string' }, ] }
Response Structure
(dict) –
SuccessfulResults (list) –
The associations that were successfully created.
(dict) –
Describes a successful application status check association.
ApplicationStatusCheckId (string) –
The ID of the application status check.
AssociationType (string) –
The type of association. Valid values:
EC2TAGandINSTANCE_ID.AssociationValue (string) –
The association value. For
EC2TAG, the value is formatted askey=value. ForINSTANCE_ID, the value is the instance ID.
UnsuccessfulResults (list) –
The associations that failed to be created.
(dict) –
Describes an unsuccessful application status check association.
ApplicationStatusCheckId (string) –
The ID of the application status check.
AssociationType (string) –
The type of association. Valid values:
EC2TAGandINSTANCE_ID.AssociationValue (string) –
The association value. For
EC2TAG, the value is formatted askey=value. ForINSTANCE_ID, the value is the instance ID.Reason (string) –
The reason the association failed.