associate_application_status_check
async
¶
associate_application_status_check(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
application_status_check_id: Optional[ApplicationStatusCheckId] = None,
target_tag_associations: Optional[CustomKeyValuePairRequestSet] = None,
instance_ids: Optional[InstanceIdList] = None,
client_token: Optional[String] = None,
dry_run: Optional[Boolean] = None,
) -> AssociateApplicationStatusCheckResult
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.
Parameters:
-
application_status_check_id(Optional[ApplicationStatusCheckId], default:None) –The ID of the application status check to associate.
-
target_tag_associations(Optional[CustomKeyValuePairRequestSet], default:None) –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.
-
instance_ids(Optional[InstanceIdList], default:None) –The IDs of the instances to associate with the application status check.
-
client_token(Optional[String], default:None) –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.
-
dry_run(Optional[Boolean], default:None) –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.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To associate an application status check with tags This example associates an application status check with instances matching the specified tag.
>>> await client.associate_application_status_check(application_status_check_id='asc-0123456789abcdef0', target_tag_associations=[{'Key': 'env', 'Value': 'prod'}])
Source code in docs_src/capo_ec2/_services/async_ec2.py
3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 | |