Skip to content

EC2  >  Operations  >  create_application_status_check

create_application_status_check

Operation

create_application_status_check async

create_application_status_check(input: CreateApplicationStatusCheckInput, plugins: list[Plugin] | None = None) -> CreateApplicationStatusCheckOutput

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 AssociateApplicationStatusCheck before health checks start.

  • You must set the Timeout value to less than the Interval value.

  • You must start the Path with a forward slash (/). Default: /.

  • You can specify Aggregation as included or excluded. If you do not specify a value, it defaults to included, which means the check contributes to the instance-level application status.

  • You can use the following default values: Interval is 60 seconds, Timeout is 6 seconds, FailureThreshold is 2, SuccessThreshold is 2, StatusCodeMatcher is 200, InitializationGracePeriodSeconds is 300 seconds.

  • You can tag the application status check during creation. For more information, see Tag your Amazon EC2 resources.

Parameters:

Name Type Description Default
input CreateApplicationStatusCheckInput

An instance of CreateApplicationStatusCheckInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateApplicationStatusCheckOutput

An instance of CreateApplicationStatusCheckOutput.

Input

CreateApplicationStatusCheckInput dataclass

Bases: _SerdeShape

Dataclass for CreateApplicationStatusCheckInput structure.

Attributes

aggregation class-attribute instance-attribute
aggregation: str | 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 by DescribeApplicationStatus. When set to excluded, the check runs independently and does not affect the instance-level status. Valid values: included | excluded.

client_token class-attribute instance-attribute
client_token: str | 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.

device_index class-attribute instance-attribute
device_index: int | None = ...

The index of the network device to use for the health check. The value must be greater than or equal to 0.

dry_run class-attribute instance-attribute
dry_run: bool | 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 is UnauthorizedOperation.

failure_threshold class-attribute instance-attribute
failure_threshold: int | None = ...

The number of consecutive failed health checks before the application status is considered impaired. The value must be greater than 0.

health_check_paths class-attribute instance-attribute
health_check_paths: list[HealthCheckPathRequestObject] | 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.

initialization_grace_period_seconds class-attribute instance-attribute
initialization_grace_period_seconds: int | None = ...

The number of seconds to wait before starting health checks after an instance is launched. Valid values: 1 to 600.

interval class-attribute instance-attribute
interval: int | None = ...

The interval, in seconds, between health checks. Valid value: 60.

ip_scope class-attribute instance-attribute
ip_scope: str | None = ...

The IP scope to use for the health check. Valid value: private.

ip_version class-attribute instance-attribute
ip_version: str | None = ...

The IP version to use for the health check. Valid values: ipv4 and ipv6.

path class-attribute instance-attribute
path: str | None = ...

The URL path to use for the health check HTTP request (for example, /health or /status).

port class-attribute instance-attribute
port: int | None = ...

The port to use for the health check. Valid values: 1 to 65535.

protocol class-attribute instance-attribute
protocol: str | None = ...

The protocol to use for the health check. Valid values: http | https.

status_code_matcher class-attribute instance-attribute
status_code_matcher: str | 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.

success_threshold class-attribute instance-attribute
success_threshold: int | None = ...

The number of consecutive successful health checks before the application status is considered healthy. The value must be greater than 0.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to apply to the application status check.

timeout class-attribute instance-attribute
timeout: int | 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.

Output

CreateApplicationStatusCheckOutput dataclass

Bases: _SerdeShape

Dataclass for CreateApplicationStatusCheckOutput structure.

Attributes

application_status_check class-attribute instance-attribute
application_status_check: ApplicationStatusCheckResponseObject | None = ...

Information about the application status check.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.