@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
472 lines (471 loc) • 22.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a Route53 health check.
*
* ## Example Usage
*
* ### Connectivity and HTTP Status Code Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.route53.HealthCheck("example", {
* fqdn: "example.com",
* port: 80,
* type: "HTTP",
* resourcePath: "/",
* failureThreshold: 5,
* requestInterval: 30,
* tags: {
* Name: "tf-test-health-check",
* },
* });
* ```
*
* ### Connectivity and String Matching Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.route53.HealthCheck("example", {
* failureThreshold: 5,
* fqdn: "example.com",
* port: 443,
* requestInterval: 30,
* resourcePath: "/",
* searchString: "example",
* type: "HTTPS_STR_MATCH",
* });
* ```
*
* ### Aggregate Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const parent = new aws.route53.HealthCheck("parent", {
* type: "CALCULATED",
* childHealthThreshold: 1,
* childHealthchecks: [child.id],
* tags: {
* Name: "tf-test-calculated-health-check",
* },
* });
* ```
*
* ### CloudWatch Alarm Check
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const foobar = new aws.cloudwatch.MetricAlarm("foobar", {
* name: "test-foobar5",
* comparisonOperator: "GreaterThanOrEqualToThreshold",
* evaluationPeriods: 2,
* metricName: "CPUUtilization",
* namespace: "AWS/EC2",
* period: 120,
* statistic: "Average",
* threshold: 80,
* alarmDescription: "This metric monitors ec2 cpu utilization",
* });
* const foo = new aws.route53.HealthCheck("foo", {
* type: "CLOUDWATCH_METRIC",
* cloudwatchAlarmName: foobar.name,
* cloudwatchAlarmRegion: "us-west-2",
* insufficientDataHealthStatus: "Healthy",
* });
* ```
*
* ### CloudWatch Alarm Check With Triggers
*
* The `triggers` argument allows the Route53 health check to be synchronized when a change to the upstream CloudWatch alarm is made.
* In the configuration below, the health check will be synchronized any time the `threshold` of the alarm is changed.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.cloudwatch.MetricAlarm("example", {
* name: "example",
* comparisonOperator: "GreaterThanOrEqualToThreshold",
* evaluationPeriods: 2,
* metricName: "CPUUtilization",
* namespace: "AWS/EC2",
* period: 120,
* statistic: "Average",
* threshold: 80,
* alarmDescription: "This metric monitors ec2 cpu utilization",
* });
* const exampleHealthCheck = new aws.route53.HealthCheck("example", {
* type: "CLOUDWATCH_METRIC",
* cloudwatchAlarmName: example.name,
* cloudwatchAlarmRegion: "us-west-2",
* insufficientDataHealthStatus: "Healthy",
* triggers: {
* threshold: example.threshold,
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Route53 Health Checks using the health check `id`. For example:
*
* ```sh
* $ pulumi import aws:route53/healthCheck:HealthCheck http_check abcdef11-2222-3333-4444-555555fedcba
* ```
*/
export declare class HealthCheck extends pulumi.CustomResource {
/**
* Get an existing HealthCheck resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HealthCheckState, opts?: pulumi.CustomResourceOptions): HealthCheck;
/**
* Returns true if the given object is an instance of HealthCheck. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is HealthCheck;
/**
* The Amazon Resource Name (ARN) of the Health Check.
*/
readonly arn: pulumi.Output<string>;
/**
* The minimum number of child health checks that must be healthy for Route 53 to consider the parent health check to be healthy. Valid values are integers between 0 and 256, inclusive
*/
readonly childHealthThreshold: pulumi.Output<number | undefined>;
/**
* For a specified parent health check, a list of HealthCheckId values for the associated child health checks.
*/
readonly childHealthchecks: pulumi.Output<string[] | undefined>;
/**
* The name of the CloudWatch alarm.
*/
readonly cloudwatchAlarmName: pulumi.Output<string | undefined>;
/**
* The region that the CloudWatch alarm was created in.
*/
readonly cloudwatchAlarmRegion: pulumi.Output<string | undefined>;
/**
* A boolean value that stops Route 53 from performing health checks. When set to true, Route 53 will do the following depending on the type of health check:
* * For health checks that check the health of endpoints, Route53 stops submitting requests to your application, server, or other resource.
* * For calculated health checks, Route 53 stops aggregating the status of the referenced health checks.
* * For health checks that monitor CloudWatch alarms, Route 53 stops monitoring the corresponding CloudWatch metrics.
*
* > **Note:** After you disable a health check, Route 53 considers the status of the health check to always be healthy. If you configured DNS failover, Route 53 continues to route traffic to the corresponding resources. If you want to stop routing traffic to a resource, change the value of `invertHealthcheck`.
*/
readonly disabled: pulumi.Output<boolean | undefined>;
/**
* A boolean value that indicates whether Route53 should send the `fqdn` to the endpoint when performing the health check. This defaults to AWS' defaults: when the `type` is "HTTPS" `enableSni` defaults to `true`, when `type` is anything else `enableSni` defaults to `false`.
*/
readonly enableSni: pulumi.Output<boolean>;
/**
* The number of consecutive health checks that an endpoint must pass or fail.
*/
readonly failureThreshold: pulumi.Output<number>;
/**
* The fully qualified domain name of the endpoint to be checked. If a value is set for `ipAddress`, the value set for `fqdn` will be passed in the `Host` header.
*/
readonly fqdn: pulumi.Output<string | undefined>;
/**
* The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`.
*/
readonly insufficientDataHealthStatus: pulumi.Output<string | undefined>;
/**
* A boolean value that indicates whether the status of health check should be inverted. For example, if a health check is healthy but Inverted is True , then Route 53 considers the health check to be unhealthy.
*/
readonly invertHealthcheck: pulumi.Output<boolean | undefined>;
/**
* The IP address of the endpoint to be checked.
*/
readonly ipAddress: pulumi.Output<string | undefined>;
/**
* A Boolean value that indicates whether you want Route 53 to measure the latency between health checkers in multiple AWS regions and your endpoint and to display CloudWatch latency graphs in the Route 53 console.
*/
readonly measureLatency: pulumi.Output<boolean | undefined>;
/**
* The port of the endpoint to be checked.
*/
readonly port: pulumi.Output<number | undefined>;
/**
* This is a reference name used in Caller Reference
* (helpful for identifying single healthCheck set amongst others)
*/
readonly referenceName: pulumi.Output<string | undefined>;
/**
* A list of AWS regions that you want Amazon Route 53 health checkers to check the specified endpoint from.
*/
readonly regions: pulumi.Output<string[] | undefined>;
/**
* The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request.
*/
readonly requestInterval: pulumi.Output<number | undefined>;
/**
* The path that you want Amazon Route 53 to request when performing health checks.
*/
readonly resourcePath: pulumi.Output<string | undefined>;
/**
* The Amazon Resource Name (ARN) for the Route 53 Application Recovery Controller routing control. This is used when health check type is `RECOVERY_CONTROL`
*/
readonly routingControlArn: pulumi.Output<string | undefined>;
/**
* String searched in the first 5120 bytes of the response body for check to be considered healthy. Only valid with `HTTP_STR_MATCH` and `HTTPS_STR_MATCH`.
*/
readonly searchString: pulumi.Output<string | undefined>;
/**
* A map of tags to assign to the health check. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
readonly tagsAll: pulumi.Output<{
[key: string]: string;
}>;
/**
* Map of arbitrary keys and values that, when changed, will trigger an in-place update of the CloudWatch alarm arguments. Use this argument to synchronize the health check when an alarm is changed. See example above.
*/
readonly triggers: pulumi.Output<{
[key: string]: string;
}>;
/**
* The protocol to use when performing health checks. Valid values are `HTTP`, `HTTPS`, `HTTP_STR_MATCH`, `HTTPS_STR_MATCH`, `TCP`, `CALCULATED`, `CLOUDWATCH_METRIC` and `RECOVERY_CONTROL`.
*/
readonly type: pulumi.Output<string>;
/**
* Create a HealthCheck resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: HealthCheckArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering HealthCheck resources.
*/
export interface HealthCheckState {
/**
* The Amazon Resource Name (ARN) of the Health Check.
*/
arn?: pulumi.Input<string>;
/**
* The minimum number of child health checks that must be healthy for Route 53 to consider the parent health check to be healthy. Valid values are integers between 0 and 256, inclusive
*/
childHealthThreshold?: pulumi.Input<number>;
/**
* For a specified parent health check, a list of HealthCheckId values for the associated child health checks.
*/
childHealthchecks?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the CloudWatch alarm.
*/
cloudwatchAlarmName?: pulumi.Input<string>;
/**
* The region that the CloudWatch alarm was created in.
*/
cloudwatchAlarmRegion?: pulumi.Input<string>;
/**
* A boolean value that stops Route 53 from performing health checks. When set to true, Route 53 will do the following depending on the type of health check:
* * For health checks that check the health of endpoints, Route53 stops submitting requests to your application, server, or other resource.
* * For calculated health checks, Route 53 stops aggregating the status of the referenced health checks.
* * For health checks that monitor CloudWatch alarms, Route 53 stops monitoring the corresponding CloudWatch metrics.
*
* > **Note:** After you disable a health check, Route 53 considers the status of the health check to always be healthy. If you configured DNS failover, Route 53 continues to route traffic to the corresponding resources. If you want to stop routing traffic to a resource, change the value of `invertHealthcheck`.
*/
disabled?: pulumi.Input<boolean>;
/**
* A boolean value that indicates whether Route53 should send the `fqdn` to the endpoint when performing the health check. This defaults to AWS' defaults: when the `type` is "HTTPS" `enableSni` defaults to `true`, when `type` is anything else `enableSni` defaults to `false`.
*/
enableSni?: pulumi.Input<boolean>;
/**
* The number of consecutive health checks that an endpoint must pass or fail.
*/
failureThreshold?: pulumi.Input<number>;
/**
* The fully qualified domain name of the endpoint to be checked. If a value is set for `ipAddress`, the value set for `fqdn` will be passed in the `Host` header.
*/
fqdn?: pulumi.Input<string>;
/**
* The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`.
*/
insufficientDataHealthStatus?: pulumi.Input<string>;
/**
* A boolean value that indicates whether the status of health check should be inverted. For example, if a health check is healthy but Inverted is True , then Route 53 considers the health check to be unhealthy.
*/
invertHealthcheck?: pulumi.Input<boolean>;
/**
* The IP address of the endpoint to be checked.
*/
ipAddress?: pulumi.Input<string>;
/**
* A Boolean value that indicates whether you want Route 53 to measure the latency between health checkers in multiple AWS regions and your endpoint and to display CloudWatch latency graphs in the Route 53 console.
*/
measureLatency?: pulumi.Input<boolean>;
/**
* The port of the endpoint to be checked.
*/
port?: pulumi.Input<number>;
/**
* This is a reference name used in Caller Reference
* (helpful for identifying single healthCheck set amongst others)
*/
referenceName?: pulumi.Input<string>;
/**
* A list of AWS regions that you want Amazon Route 53 health checkers to check the specified endpoint from.
*/
regions?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request.
*/
requestInterval?: pulumi.Input<number>;
/**
* The path that you want Amazon Route 53 to request when performing health checks.
*/
resourcePath?: pulumi.Input<string>;
/**
* The Amazon Resource Name (ARN) for the Route 53 Application Recovery Controller routing control. This is used when health check type is `RECOVERY_CONTROL`
*/
routingControlArn?: pulumi.Input<string>;
/**
* String searched in the first 5120 bytes of the response body for check to be considered healthy. Only valid with `HTTP_STR_MATCH` and `HTTPS_STR_MATCH`.
*/
searchString?: pulumi.Input<string>;
/**
* A map of tags to assign to the health check. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
tagsAll?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Map of arbitrary keys and values that, when changed, will trigger an in-place update of the CloudWatch alarm arguments. Use this argument to synchronize the health check when an alarm is changed. See example above.
*/
triggers?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The protocol to use when performing health checks. Valid values are `HTTP`, `HTTPS`, `HTTP_STR_MATCH`, `HTTPS_STR_MATCH`, `TCP`, `CALCULATED`, `CLOUDWATCH_METRIC` and `RECOVERY_CONTROL`.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a HealthCheck resource.
*/
export interface HealthCheckArgs {
/**
* The minimum number of child health checks that must be healthy for Route 53 to consider the parent health check to be healthy. Valid values are integers between 0 and 256, inclusive
*/
childHealthThreshold?: pulumi.Input<number>;
/**
* For a specified parent health check, a list of HealthCheckId values for the associated child health checks.
*/
childHealthchecks?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the CloudWatch alarm.
*/
cloudwatchAlarmName?: pulumi.Input<string>;
/**
* The region that the CloudWatch alarm was created in.
*/
cloudwatchAlarmRegion?: pulumi.Input<string>;
/**
* A boolean value that stops Route 53 from performing health checks. When set to true, Route 53 will do the following depending on the type of health check:
* * For health checks that check the health of endpoints, Route53 stops submitting requests to your application, server, or other resource.
* * For calculated health checks, Route 53 stops aggregating the status of the referenced health checks.
* * For health checks that monitor CloudWatch alarms, Route 53 stops monitoring the corresponding CloudWatch metrics.
*
* > **Note:** After you disable a health check, Route 53 considers the status of the health check to always be healthy. If you configured DNS failover, Route 53 continues to route traffic to the corresponding resources. If you want to stop routing traffic to a resource, change the value of `invertHealthcheck`.
*/
disabled?: pulumi.Input<boolean>;
/**
* A boolean value that indicates whether Route53 should send the `fqdn` to the endpoint when performing the health check. This defaults to AWS' defaults: when the `type` is "HTTPS" `enableSni` defaults to `true`, when `type` is anything else `enableSni` defaults to `false`.
*/
enableSni?: pulumi.Input<boolean>;
/**
* The number of consecutive health checks that an endpoint must pass or fail.
*/
failureThreshold?: pulumi.Input<number>;
/**
* The fully qualified domain name of the endpoint to be checked. If a value is set for `ipAddress`, the value set for `fqdn` will be passed in the `Host` header.
*/
fqdn?: pulumi.Input<string>;
/**
* The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`.
*/
insufficientDataHealthStatus?: pulumi.Input<string>;
/**
* A boolean value that indicates whether the status of health check should be inverted. For example, if a health check is healthy but Inverted is True , then Route 53 considers the health check to be unhealthy.
*/
invertHealthcheck?: pulumi.Input<boolean>;
/**
* The IP address of the endpoint to be checked.
*/
ipAddress?: pulumi.Input<string>;
/**
* A Boolean value that indicates whether you want Route 53 to measure the latency between health checkers in multiple AWS regions and your endpoint and to display CloudWatch latency graphs in the Route 53 console.
*/
measureLatency?: pulumi.Input<boolean>;
/**
* The port of the endpoint to be checked.
*/
port?: pulumi.Input<number>;
/**
* This is a reference name used in Caller Reference
* (helpful for identifying single healthCheck set amongst others)
*/
referenceName?: pulumi.Input<string>;
/**
* A list of AWS regions that you want Amazon Route 53 health checkers to check the specified endpoint from.
*/
regions?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request.
*/
requestInterval?: pulumi.Input<number>;
/**
* The path that you want Amazon Route 53 to request when performing health checks.
*/
resourcePath?: pulumi.Input<string>;
/**
* The Amazon Resource Name (ARN) for the Route 53 Application Recovery Controller routing control. This is used when health check type is `RECOVERY_CONTROL`
*/
routingControlArn?: pulumi.Input<string>;
/**
* String searched in the first 5120 bytes of the response body for check to be considered healthy. Only valid with `HTTP_STR_MATCH` and `HTTPS_STR_MATCH`.
*/
searchString?: pulumi.Input<string>;
/**
* A map of tags to assign to the health check. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Map of arbitrary keys and values that, when changed, will trigger an in-place update of the CloudWatch alarm arguments. Use this argument to synchronize the health check when an alarm is changed. See example above.
*/
triggers?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The protocol to use when performing health checks. Valid values are `HTTP`, `HTTPS`, `HTTP_STR_MATCH`, `HTTPS_STR_MATCH`, `TCP`, `CALCULATED`, `CLOUDWATCH_METRIC` and `RECOVERY_CONTROL`.
*/
type: pulumi.Input<string>;
}