Package com.pulumi.aws.route53
Class HealthCheck
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.route53.HealthCheck
-
public class HealthCheck extends com.pulumi.resources.CustomResourceProvides a Route53 health check. ## Example Usage ### Connectivity and HTTP Status Code Check
### Connectivity and String Matching Checkpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.route53.HealthCheck; import com.pulumi.aws.route53.HealthCheckArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new HealthCheck("example", HealthCheckArgs.builder() .fqdn("example.com") .port(80) .type("HTTP") .resourcePath("/") .failureThreshold(5) .requestInterval(30) .tags(Map.of("Name", "tf-test-health-check")) .build()); } }
### Aggregate Checkpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.route53.HealthCheck; import com.pulumi.aws.route53.HealthCheckArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new HealthCheck("example", HealthCheckArgs.builder() .failureThreshold(5) .fqdn("example.com") .port(443) .requestInterval(30) .resourcePath("/") .searchString("example") .type("HTTPS_STR_MATCH") .build()); } }
### CloudWatch Alarm Checkpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.route53.HealthCheck; import com.pulumi.aws.route53.HealthCheckArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var parent = new HealthCheck("parent", HealthCheckArgs.builder() .type("CALCULATED") .childHealthThreshold(1) .childHealthchecks(child.id()) .tags(Map.of("Name", "tf-test-calculated-health-check")) .build()); } }
### 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.package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.cloudwatch.MetricAlarm; import com.pulumi.aws.cloudwatch.MetricAlarmArgs; import com.pulumi.aws.route53.HealthCheck; import com.pulumi.aws.route53.HealthCheckArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var foobar = new MetricAlarm("foobar", MetricAlarmArgs.builder() .name("test-foobar5") .comparisonOperator("GreaterThanOrEqualToThreshold") .evaluationPeriods(2) .metricName("CPUUtilization") .namespace("AWS/EC2") .period(120) .statistic("Average") .threshold(80.0) .alarmDescription("This metric monitors ec2 cpu utilization") .build()); var foo = new HealthCheck("foo", HealthCheckArgs.builder() .type("CLOUDWATCH_METRIC") .cloudwatchAlarmName(foobar.name()) .cloudwatchAlarmRegion("us-west-2") .insufficientDataHealthStatus("Healthy") .build()); } }
## 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 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.cloudwatch.MetricAlarm; import com.pulumi.aws.cloudwatch.MetricAlarmArgs; import com.pulumi.aws.route53.HealthCheck; import com.pulumi.aws.route53.HealthCheckArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new MetricAlarm("example", MetricAlarmArgs.builder() .name("example") .comparisonOperator("GreaterThanOrEqualToThreshold") .evaluationPeriods(2) .metricName("CPUUtilization") .namespace("AWS/EC2") .period(120) .statistic("Average") .threshold(80.0) .alarmDescription("This metric monitors ec2 cpu utilization") .build()); var exampleHealthCheck = new HealthCheck("exampleHealthCheck", HealthCheckArgs.builder() .type("CLOUDWATCH_METRIC") .cloudwatchAlarmName(example.name()) .cloudwatchAlarmRegion("us-west-2") .insufficientDataHealthStatus("Healthy") .triggers(Map.of("threshold", example.threshold())) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description HealthCheck(java.lang.String name)HealthCheck(java.lang.String name, HealthCheckArgs args)HealthCheck(java.lang.String name, HealthCheckArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>childHealthchecks()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>childHealthThreshold()com.pulumi.core.Output<java.util.Optional<java.lang.String>>cloudwatchAlarmName()com.pulumi.core.Output<java.util.Optional<java.lang.String>>cloudwatchAlarmRegion()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>disabled()com.pulumi.core.Output<java.lang.Boolean>enableSni()com.pulumi.core.Output<java.lang.Integer>failureThreshold()com.pulumi.core.Output<java.util.Optional<java.lang.String>>fqdn()static HealthCheckget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, HealthCheckState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.String>>insufficientDataHealthStatus()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>invertHealthcheck()com.pulumi.core.Output<java.util.Optional<java.lang.String>>ipAddress()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>measureLatency()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>port()com.pulumi.core.Output<java.util.Optional<java.lang.String>>referenceName()com.pulumi.core.Output<java.util.List<java.lang.String>>regions()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>requestInterval()com.pulumi.core.Output<java.util.Optional<java.lang.String>>resourcePath()com.pulumi.core.Output<java.util.Optional<java.lang.String>>routingControlArn()com.pulumi.core.Output<java.util.Optional<java.lang.String>>searchString()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>triggers()com.pulumi.core.Output<java.lang.String>type()
-
-
-
Constructor Detail
-
HealthCheck
public HealthCheck(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
HealthCheck
public HealthCheck(java.lang.String name, HealthCheckArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
HealthCheck
public HealthCheck(java.lang.String name, HealthCheckArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the Health Check.
-
childHealthThreshold
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> childHealthThreshold()
- Returns:
- 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
-
childHealthchecks
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> childHealthchecks()
- Returns:
- For a specified parent health check, a list of HealthCheckId values for the associated child health checks.
-
cloudwatchAlarmName
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> cloudwatchAlarmName()
- Returns:
- The name of the CloudWatch alarm.
-
cloudwatchAlarmRegion
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> cloudwatchAlarmRegion()
- Returns:
- The region that the CloudWatch alarm was created in.
-
disabled
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disabled()
- Returns:
- 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`.
-
enableSni
public com.pulumi.core.Output<java.lang.Boolean> enableSni()
- Returns:
- 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`.
-
failureThreshold
public com.pulumi.core.Output<java.lang.Integer> failureThreshold()
- Returns:
- The number of consecutive health checks that an endpoint must pass or fail.
-
fqdn
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> fqdn()
- Returns:
- 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.
-
insufficientDataHealthStatus
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> insufficientDataHealthStatus()
- Returns:
- The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`.
-
invertHealthcheck
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> invertHealthcheck()
- Returns:
- 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.
-
ipAddress
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> ipAddress()
- Returns:
- The IP address of the endpoint to be checked.
-
measureLatency
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> measureLatency()
- Returns:
- 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.
-
port
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> port()
- Returns:
- The port of the endpoint to be checked.
-
referenceName
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> referenceName()
- Returns:
- This is a reference name used in Caller Reference (helpful for identifying single healthCheck set amongst others)
-
regions
public com.pulumi.core.Output<java.util.List<java.lang.String>> regions()
- Returns:
- List of AWS Regions from which Amazon Route 53 health checkers check the specified endpoint. Valid values are `us-east-1`, `us-west-1`, `us-west-2`, `eu-west-1`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1`, and `sa-east-1`. If not specified, all of the regions listed under **Valid values** are used by default. Once this argument is set, removing it has no effect.
-
requestInterval
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> requestInterval()
- Returns:
- 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.
-
resourcePath
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> resourcePath()
- Returns:
- The path that you want Amazon Route 53 to request when performing health checks.
-
routingControlArn
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> routingControlArn()
- Returns:
- ARN for the Route 53 Application Recovery Controller routing control. This is used when health check type is `RECOVERY_CONTROL`
-
searchString
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> searchString()
- Returns:
- 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`.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- 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.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
triggers
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> triggers()
- Returns:
- 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.
-
type
public com.pulumi.core.Output<java.lang.String> type()
- Returns:
- 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`.
-
get
public static HealthCheck get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable HealthCheckState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-