create_application_status_check
¶
create_application_status_check(
*,
config_overrides: Optional[EC2ClientConfig] = None,
health_check_paths: Optional[HealthCheckPathRequestList] = None,
aggregation: Optional[AggregationStatusEnum] = None,
protocol: Optional[NetworkProtocolEnum] = None,
port: Optional[PortNumber] = None,
path: Optional[String] = None,
device_index: Optional[Integer] = None,
ip_version: Optional[IpVersionEnum] = None,
ip_scope: Optional[IpScopeEnum] = None,
interval: Optional[Integer] = None,
timeout: Optional[Integer] = None,
failure_threshold: Optional[Integer] = None,
success_threshold: Optional[Integer] = None,
status_code_matcher: Optional[String] = None,
initialization_grace_period_seconds: Optional[
InitializationGracePeriodSeconds
] = None,
tag_specifications: Optional[TagSpecificationList] = None,
client_token: Optional[String] = None,
dry_run: Optional[Boolean] = None,
) -> CreateApplicationStatusCheckResult
Creates an application status check for monitoring the health of applications running on your instances. You can configure the protocol, port, path, and thresholds for the health check. The following rules apply:
-
You can create a maximum of 50 application status checks for each account.
-
You must associate the check with instances or tags using
AssociateApplicationStatusCheckbefore health checks start. -
You must set the
Timeoutvalue to less than theIntervalvalue. -
You must start the
Pathwith a forward slash (/). Default:/. -
You can specify
Aggregationasincludedorexcluded. If you do not specify a value, it defaults toincluded, which means the check contributes to the instance-level application status. -
You can use the following default values:
Intervalis 60 seconds,Timeoutis 6 seconds,FailureThresholdis 2,SuccessThresholdis 2,StatusCodeMatcheris200,InitializationGracePeriodSecondsis 300 seconds. -
You can tag the application status check during creation. For more information, see Tag your Amazon EC2 resources.
Parameters:
-
health_check_paths(Optional[HealthCheckPathRequestList], default:None) –The health check paths to use for the application status check. Health check paths define the network path from a source subnet to one or more destination subnets for cross-Availability Zone or Availability Zone to Local Zone health checking. If omitted, health checks are performed in the same subnet as the instance.
-
aggregation(Optional[AggregationStatusEnum], default:None) –The aggregation setting for the application status check. When set to
included, the result of this check contributes to the instance-level application status reported byDescribeApplicationStatus. When set toexcluded, the check runs independently and does not affect the instance-level status. Valid values:included|excluded. -
protocol(Optional[NetworkProtocolEnum], default:None) –The protocol to use for the health check. Valid values:
http|https. -
port(Optional[PortNumber], default:None) –The port to use for the health check. Valid values: 1 to 65535.
-
path(Optional[String], default:None) –The URL path to use for the health check HTTP request (for example,
/healthor/status). -
device_index(Optional[Integer], default:None) –The index of the network device to use for the health check. The value must be greater than or equal to 0.
-
ip_version(Optional[IpVersionEnum], default:None) –The IP version to use for the health check. Valid values:
ipv4andipv6. -
ip_scope(Optional[IpScopeEnum], default:None) –The IP scope to use for the health check. Valid value:
private. -
interval(Optional[Integer], default:None) –The interval, in seconds, between health checks. Valid value: 60.
-
timeout(Optional[Integer], default:None) –The amount of time, in seconds, to wait for a health check response before considering it failed. Valid values: 1 to 30. The value must be less than
Interval. -
failure_threshold(Optional[Integer], default:None) –The number of consecutive failed health checks before the application status is considered impaired. The value must be greater than 0.
-
success_threshold(Optional[Integer], default:None) –The number of consecutive successful health checks before the application status is considered healthy. The value must be greater than 0.
-
status_code_matcher(Optional[String], default:None) –The HTTP status codes that indicate a successful health check response. Specify a comma-separated list of individual status codes or ranges, for example,
200,202,300-399. For a range, the first value must be less than the second value. Maximum length: 64 characters. Default:200. -
initialization_grace_period_seconds(Optional[InitializationGracePeriodSeconds], default:None) –The number of seconds to wait before starting health checks after an instance is launched. Valid values: 1 to 600.
-
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to apply to 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 create an application status check This example creates an application status check that monitors HTTP health on port 80.
>>> client.create_application_status_check(protocol='http', port=80, path='/health', aggregation='included')
Source code in docs_src/capo_ec2/_services/ec2.py
6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 | |