associate_application_status_check
¶
associate_application_status_check(
*,
config_overrides: Optional[EC2ClientConfig] = 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.
>>> 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/ec2.py
3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 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 | |